/* Oriremap launcher — ธีมสว่างสอดคล้อง v2 (ไม่ใช้พื้นหลังดำ) */
:root {
  --bg: #ececee;
  --bg-soft: linear-gradient(165deg, #e8eaef 0%, #ececee 45%, #e2e8f0 100%);
  --surface: #ffffff;
  --text: #1c1c1e;
  --text-secondary: rgba(28, 28, 30, 0.55);
  --text-tertiary: rgba(28, 28, 30, 0.38);
  --border: rgba(0, 0, 0, 0.08);
  --brand: #0ea5e9;
  --brand-deep: #0284c7;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --v2-login-brand: #0ea5e9;
  --v2-login-brand-deep: #0284c7;
  --v2-login-brand-soft: rgba(14, 165, 233, 0.14);
  --v2-login-label: #1c1c1e;
  --v2-login-secondary: rgba(28, 28, 30, 0.55);
  --v2-login-tertiary: rgba(28, 28, 30, 0.38);
  --v2-login-card: #ffffff;
  --v2-login-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  --v2-login-radius: 22px;
  --v2-login-input-bg: rgba(0, 0, 0, 0.05);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-soft);
  color: var(--text);
  font-family: "Inter", "Sarabun", system-ui, sans-serif;
}

/* เปิดแอปแล้วเข้าหน้าล็อกอินโดยตรง (ไม่แสดงการ์ดเลือกเวอร์ชัน) */
.launcher-page--login-only .launcher--hidden,
.launcher-page--login-only .launcher-footer.launcher--hidden {
  display: none !important;
}

.launcher-page {
  -webkit-font-smoothing: antialiased;
}

.launcher {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 100px;
}

.launcher-tagline {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.launcher h1 {
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 40px;
  text-align: center;
  color: var(--text);
}

.profiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px 32px;
  max-width: 960px;
}

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.profile-card:hover,
.profile-card:focus-visible {
  transform: translateY(-4px);
  outline: none;
}

.profile-card:focus-visible .profile-avatar {
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.45);
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.profile-card:hover .profile-avatar {
  border-color: rgba(14, 165, 233, 0.35);
  box-shadow: var(--shadow);
}

.profile-card--add .profile-avatar {
  background: rgba(255, 255, 255, 0.65);
  border: 2px dashed rgba(100, 116, 139, 0.45);
  font-size: 56px;
  color: #94a3b8;
}

.profile-card--add:hover .profile-avatar {
  border-color: var(--brand);
  color: var(--brand-deep);
}

.profile-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  max-width: 160px;
  text-align: center;
  line-height: 1.35;
}

.profile-card:hover .profile-name {
  color: var(--brand-deep);
}

.profile-sub {
  font-size: 12px;
  color: var(--text-secondary);
  max-width: 180px;
  text-align: center;
  line-height: 1.35;
}

.profile-lock {
  font-size: 13px;
  opacity: 0.85;
}

.launcher-footer {
  position: fixed;
  bottom: 28px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
}

.btn-manage {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-secondary);
  border: 0.5px solid var(--border);
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.btn-manage:hover {
  color: var(--brand-deep);
  border-color: rgba(14, 165, 233, 0.4);
  background: #fff;
}

.error-banner {
  max-width: 520px;
  margin-bottom: 24px;
  padding: 14px 18px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  font-size: 14px;
  color: #b91c1c;
  text-align: center;
  display: none;
}

.error-banner.is-visible {
  display: block;
}

/* Modal ทั่วไป — โทนสว่าง */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 50;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.is-open {
  display: flex;
}

.modal-box {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 16px;
  max-width: 520px;
  width: 100%;
  padding: 24px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.modal-box h2 {
  margin: 0 0 16px;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
}

.modal-box p,
.modal-box li {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.modal-box code {
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--text);
}

.modal-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-actions button {
  background: #f1f5f9;
  color: var(--text);
  border: 0.5px solid var(--border);
  padding: 8px 18px;
  cursor: pointer;
  font-family: inherit;
  border-radius: 10px;
  font-weight: 500;
}

.modal-actions button:hover {
  background: #e2e8f0;
}

.modal-actions button.primary {
  background: linear-gradient(180deg, #0ea5e9 0%, #0284c7 100%);
  border-color: transparent;
  color: #fff;
}

.modal-actions button.primary:hover {
  filter: brightness(1.05);
}

.version-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}

.version-list li {
  padding: 12px 0;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.version-list a {
  color: var(--brand-deep);
  font-weight: 500;
}

/* ----- Demo notice (ประกาศเวอร์ชันทดสอบ หลังกดเข้าสู่ระบบ) ----- */
.demo-notice-modal {
  z-index: 300;
  background: rgba(248, 250, 252, 0.86);
  backdrop-filter: saturate(140%) blur(18px);
  -webkit-backdrop-filter: saturate(140%) blur(18px);
}

.demo-notice-box {
  max-width: 560px;
  border-radius: 20px;
  border: 0.5px solid rgba(14, 165, 233, 0.28);
  box-shadow: 0 30px 70px rgba(2, 132, 199, 0.18);
}

.demo-notice-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #b45309;
  background: linear-gradient(180deg, #fef3c7 0%, #fde68a 100%);
  border: 0.5px solid rgba(180, 83, 9, 0.28);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.demo-notice-box h2 {
  margin: 0 0 12px;
  font-size: 1.4rem;
}

.demo-notice-lead {
  font-size: 14.5px !important;
  color: var(--text) !important;
  margin: 0 0 14px;
}

.demo-notice-list {
  margin: 0 0 14px;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.demo-notice-list li {
  font-size: 14px;
  line-height: 1.6;
}

.demo-notice-list li strong {
  color: var(--text);
}

.demo-notice-foot {
  font-size: 13px !important;
  color: var(--text-secondary) !important;
  margin: 0;
}

.demo-notice-box .modal-actions {
  margin-top: 22px;
}

/* ----- Launcher login — การ์ดสว่าง (โมดัลทับด้วยฟrost สว่าง ไม่ดำทึบ) ----- */
.launcher-login-modal {
  z-index: 200;
  background: rgba(248, 250, 252, 0.82);
  backdrop-filter: saturate(140%) blur(18px);
  -webkit-backdrop-filter: saturate(140%) blur(18px);
}

.launcher-login-sheet--v2 {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--v2-login-card);
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--v2-login-radius);
  padding: 0;
  box-shadow: var(--v2-login-shadow);
  overflow: hidden;
  font-family: "Inter", "Sarabun", system-ui, sans-serif;
}

.v2-login-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.07) 0%, transparent 100%);
}

.v2-login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.v2-login-brand-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--v2-login-brand-soft);
  box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.12) inset;
}

.v2-login-brand-text {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--v2-login-label);
}

.login-head-brand--v2 {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.login-head-brand--v1 {
  display: none;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.launcher-login-sheet--v1 .login-head-brand--v2 {
  display: none;
}

.launcher-login-sheet--v1 .login-head-brand--v1 {
  display: flex;
}

.v1-login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.v1-login-brand-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
}

.v1-login-brand-text {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #f8fafc;
}

.v2-login-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--v2-login-secondary);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.v2-login-close:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--v2-login-label);
}

.v2-login-logo-wrap {
  padding: 20px 22px 8px;
  text-align: center;
}

.v2-login-kicker {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
  line-height: 1.45;
}

.login-kicker--v1 {
  display: none;
}

.launcher-login-sheet--v1 .login-kicker--v2 {
  display: none;
}

.launcher-login-sheet--v1 .login-kicker--v1 {
  display: block;
}

.login-intro--v1 {
  display: none;
}

.launcher-login-sheet--v1 .login-intro--v2 {
  display: none;
}

.launcher-login-sheet--v1 .login-intro--v1 {
  display: block;
}

.launcher-login-copy--v1 {
  display: none;
}

.launcher-login-sheet--v1 .launcher-login-copy--v2 {
  display: none;
}

.launcher-login-sheet--v1 .launcher-login-copy--v1 {
  display: block;
}

/* กรอบโลโก้ — แยก artwork ต่อเวอร์ชัน (v1 ส้ม / v2 ฟ้า) */
.login-logo-stage {
  display: none;
  justify-content: center;
  align-items: center;
  max-width: 320px;
  margin: 0 auto;
  border-radius: 18px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.launcher-login-sheet--v1 .login-logo-stage--v1 {
  display: flex;
}

.launcher-login-sheet--v2 .login-logo-stage--v2 {
  display: flex;
}

.v2-login-logo-svg {
  width: 100%;
  max-width: 320px;
  height: auto;
  display: block;
  vertical-align: middle;
}

.v2-login-version-row {
  text-align: center;
  min-height: 0;
}

.v2-login-version-pill {
  margin: 0;
  padding: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--v2-login-brand-deep);
}

.v2-login-version-pill:empty {
  display: none;
}

.v2-login-version-pill:not(:empty) {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--v2-login-brand-soft);
  box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.12) inset;
}

.v2-login-body {
  padding: 8px 24px 22px;
}

.launcher-login-welcome {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--v2-login-label);
  text-align: center;
}

.launcher-login-hint {
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--v2-login-secondary);
  text-align: center;
}

.launcher-login-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--v2-login-label);
  margin-bottom: 8px;
}

.launcher-login-field-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 4px 14px;
  margin-bottom: 24px;
  border-radius: 12px;
  background: var(--v2-login-input-bg);
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.launcher-login-field-wrap:focus-within {
  border-color: rgba(14, 165, 233, 0.55);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.14);
}

.launcher-login-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--v2-login-label);
  font-size: 16px;
  padding: 12px 0;
  font-family: inherit;
  outline: none;
}

.launcher-login-input::placeholder {
  color: var(--v2-login-tertiary);
}

.launcher-login-eye {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--v2-login-secondary);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.launcher-login-eye:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--v2-login-brand-deep);
}

.launcher-login-submit {
  width: 100%;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(180deg, #0ea5e9 0%, #0284c7 100%);
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.32), 0 1px 0 rgba(255, 255, 255, 0.2) inset;
  transition: filter 0.2s, transform 0.15s;
}

.launcher-login-submit:hover {
  filter: brightness(1.05);
}

.launcher-login-submit:active {
  transform: scale(0.99);
}

.launcher-login-copy {
  margin: 0;
  padding: 14px 18px 18px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  text-align: center;
  border-top: 0.5px solid rgba(0, 0, 0, 0.06);
  background: rgba(0, 0, 0, 0.02);
}

/* ----- ธีมล็อกอิน v1 — Engineer REMAP / CARTUNING (แยกจาก Oriremap · เข้ม) ----- */
.launcher-login-modal[data-version="v1"] {
  background: rgba(10, 12, 18, 0.82);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.launcher-login-sheet--v1 {
  --v2-login-label: #f1f5f9;
  --v2-login-secondary: rgba(241, 245, 249, 0.7);
  --v2-login-tertiary: rgba(148, 163, 184, 0.65);
  --v2-login-card: #12151c;
  --v2-login-shadow: 0 28px 72px rgba(0, 0, 0, 0.6);
  --v2-login-input-bg: rgba(0, 0, 0, 0.35);
  background: linear-gradient(165deg, #1a1f2c 0%, #0c0e14 55%, #0a0c12 100%);
  border: 1px solid rgba(90, 169, 230, 0.28);
  color: #e2e8f0;
  box-shadow: var(--v2-login-shadow);
}

.launcher-login-sheet--v1 .v2-login-head {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.45) 0%, transparent 100%);
}

.launcher-login-sheet--v1 .login-logo-stage--v1 {
  background: #050608;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 8px 32px rgba(0, 0, 0, 0.45);
  padding: 22px 20px;
}

.eremap-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.eremap-logo__badge {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.eremap-logo__lines {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  line-height: 1;
}

.eremap-logo__engineer {
  font-size: clamp(1.75rem, 5vw, 2.35rem);
  font-weight: 800;
  font-style: italic;
  color: #ef4444;
  letter-spacing: -0.03em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.eremap-logo__remap {
  font-size: clamp(1.1rem, 3.5vw, 1.45rem);
  font-weight: 800;
  letter-spacing: 0.42em;
  color: #f8fafc;
  padding-left: 0.42em;
}

.launcher-login-sheet--v1 .login-kicker--v1 {
  color: rgba(226, 232, 240, 0.55);
  font-weight: 500;
}

.launcher-login-sheet--v1 .launcher-login-welcome--er {
  color: #fff;
  font-weight: 700;
}

.launcher-login-sheet--v1 .launcher-login-hint--er {
  color: rgba(203, 213, 225, 0.88);
  margin-bottom: 22px;
}

.launcher-login-sheet--v1 .v2-login-version-pill:not(:empty) {
  color: #fecaca;
  background: rgba(185, 28, 28, 0.25);
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.3) inset;
}

.launcher-login-sheet--v1 .launcher-login-label {
  color: #e2e8f0;
}

.launcher-login-sheet--v1 .launcher-login-field-wrap {
  border-color: rgba(90, 169, 230, 0.4);
  background: rgba(0, 0, 0, 0.35);
}

.launcher-login-sheet--v1 .launcher-login-field-wrap:focus-within {
  border-color: #5aa9e6;
  box-shadow: 0 0 0 3px rgba(90, 169, 230, 0.22);
}

.launcher-login-sheet--v1 .launcher-login-input {
  color: #f8fafc;
}

.launcher-login-sheet--v1 .launcher-login-input::placeholder {
  color: rgba(148, 163, 184, 0.65);
}

.launcher-login-sheet--v1 .launcher-login-eye {
  color: rgba(203, 213, 225, 0.65);
}

.launcher-login-sheet--v1 .launcher-login-eye:hover {
  color: #7dd3fc;
  background: rgba(90, 169, 230, 0.12);
}

.launcher-login-sheet--v1 .launcher-login-submit {
  background: linear-gradient(180deg, #5aa9e6 0%, #3d7ec4 100%);
  box-shadow: 0 6px 24px rgba(90, 169, 230, 0.38);
}

.launcher-login-sheet--v1 .launcher-login-copy--v1 {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 0, 0, 0.35);
  color: rgba(148, 163, 184, 0.9);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
}
