/* ─── Betagro Identity Provider (IdP) Design System ───────────────────────── */
/* Clean Single Container Layout with Multi-Box Digits & Stepper              */
@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;700&family=Noto+Sans+Thai:wght@300;400;500;600;700&family=Sarabun:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #5ba125;
  --primary-hover: #4e8c1e;
  --primary-light: #f0fdf4;
  --primary-border: rgba(91, 161, 37, 0.25);
  --primary-shadow: rgba(91, 161, 37, 0.25);

  --bg-page: #f1f3f5;
  --surface: #ffffff;
  --border-card: #e5e7eb;
  --border-input: #cbd5e1;

  --text-main: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --font-family: 'Google Sans', 'Noto Sans Thai', 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-card: 20px;
  --radius-btn: 10px;
  --radius-input: 10px;
  --radius-pill: 999px;
  --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
}

/* ─── Global Reset & Body ────────────────────────────────────────────────── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
}

html, body {
  width: 100%;
  min-height: 100%;
}

body {
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px 24px;
  transition: background-color 0.35s ease, background-image 0.35s ease;
}

body.bg-landscape {
  background-color: #E7F4F8;
  background-image: url('public/04-green-landscape.svg');
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body.bg-landscape .login-card {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 20px 45px -10px rgba(31, 57, 37, 0.2), 0 8px 20px -6px rgba(0, 0, 0, 0.06);
}

body.bg-landscape .footer-wrapper {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  padding: 6px 18px;
  margin-top: 16px;
}

.page-wrapper {
  width: 100%;
  max-width: 450px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto;
}

/* ─── Login Card ─────────────────────────────────────────────────────────── */
.login-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  padding: 30px 28px 34px;
  animation: fadeIn 0.3s ease-out;
}

/* Tour Button in Top Left of Card */
.tour-trigger-link {
  position: absolute;
  top: 24px;
  left: 20px;
  right: auto;
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 500;
  transition: color 0.15s ease;
  z-index: 10;
  padding: 2px 4px;
}

.tour-trigger-link:hover {
  color: var(--primary);
}

.tour-trigger-link .help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1.2px solid currentColor;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

/* Circular Back Button (Top Right of Card) */
.back-circle-btn {
  position: absolute;
  top: 18px;
  right: 20px;
  left: auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.8px solid #94a3b8;
  background: transparent;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 20;
  box-shadow: none;
  padding: 0;
}

.back-circle-btn:hover {
  border-color: var(--primary);
  background: transparent;
  color: var(--primary);
  transform: translateX(-2px);
  box-shadow: none;
}

.back-circle-btn:active {
  transform: translateX(0) scale(0.96);
}

.back-circle-btn svg {
  display: block;
  stroke: #64748b;
  transition: all 0.2s ease;
}

.back-circle-btn:hover svg {
  stroke: var(--primary);
  transform: translateX(-1px);
}

/* ─── Language Selector Dropdown (Top Right on Screen 1) ───────────────── */
.lang-selector-wrap {
  position: absolute;
  top: 18px;
  right: 20px;
  z-index: 30;
}

.lang-trigger-btn {
  background: transparent;
  border: none;
  border-radius: 999px;
  height: 34px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  transition: all 0.2s ease;
  box-shadow: none;
}

.lang-trigger-btn:hover,
.lang-selector-wrap.is-open .lang-trigger-btn {
  border: none;
  color: var(--primary);
  background: transparent;
  box-shadow: none;
}

.lang-trigger-btn .chevron-icon {
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
  color: #64748b;
}

.lang-selector-wrap.is-open .chevron-icon {
  transform: rotate(180deg);
  color: var(--primary);
}

.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  padding: 6px;
  min-width: 185px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 50;
  animation: dropdownFade 0.2s ease-out;
}

.lang-selector-wrap.is-open .lang-dropdown-menu {
  display: flex;
}

@keyframes dropdownFade {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.lang-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  color: #334155;
  text-align: left;
  width: 100%;
  transition: all 0.15s ease;
}

.lang-item:hover {
  background: transparent;
  color: var(--primary);
}

.lang-item.is-active {
  background: transparent;
  color: var(--primary);
  font-weight: 700;
}

.lang-item .lang-name {
  flex: 1;
}

.lang-item .check-icon {
  margin-left: auto;
  color: var(--primary);
  font-weight: 800;
  font-size: 12px;
  opacity: 0;
}

.lang-item.is-active .check-icon {
  opacity: 1;
}

.flag-icon {
  width: 20px;
  height: 14px;
  border-radius: 2.5px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
  object-fit: cover;
  flex-shrink: 0;
  display: inline-block;
}

/* Card Header (Logo + Title) */
.card-header-center {
  text-align: center;
  margin-bottom: 20px;
}

.brand-logo-container {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.brand-logo-img {
  height: 52px;
  width: auto;
  object-fit: contain;
}

.card-title {
  font-size: 21px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
  margin-bottom: 3px;
}

.card-subtitle {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.brand-plus {
  color: var(--primary);
  font-weight: 800;
  margin-left: 2px;
}

/* ─── Alerts & Error Boxes ──────────────────────────────────────────────── */
.alert-box {
  margin-bottom: 16px;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeIn 0.2s ease;
}

.alert-danger {
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}

.alert-success {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.alert-info {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

/* ─── Digit Input Boxes (Multi-Box System) ───────────────────────────────── */
.digit-boxes-container {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin: 14px 0 18px;
}

.digit-box {
  width: clamp(38px, 12vw, 49px);
  height: 58px;
  border: 2px solid var(--border-input);
  border-radius: 12px;
  background: #ffffff;
  color: #1e293b;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  outline: none;
  padding: 0;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
  font-family: 'Google Sans', monospace, sans-serif;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.digit-box:hover {
  border-color: #94a3b8;
}

.digit-box:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3.5px rgba(91, 161, 37, 0.22);
}

.digit-box.is-filled {
  border-color: var(--primary);
  background: #ffffff;
  color: #0f172a;
}

/* Completion Wave Animation across 7 digits / date / phone */
.digit-box.complete-wave,
.date-box.complete-wave,
.phone-box.complete-wave {
  animation: digitCompleteWave 0.38s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes digitCompleteWave {
  0% {
    transform: translateY(0) scale(1);
  }
  40% {
    transform: translateY(-4px) scale(1.04);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(91, 161, 37, 0.28);
  }
  75% {
    transform: translateY(1px) scale(0.99);
  }
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  }
}

/* Container shake on incomplete or error */
.digit-boxes-container.is-error,
.phone-group-wrapper.is-error,
.date-group-wrapper.is-error {
  animation: shakeContainer 0.36s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shakeContainer {
  10%, 90% {
    transform: translateX(-2px);
  }
  20%, 80% {
    transform: translateX(4px);
  }
  30%, 50%, 70% {
    transform: translateX(-5px);
  }
  40%, 60% {
    transform: translateX(5px);
  }
}

.btn-primary.is-ready {
  animation: btnReadyPulse 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes btnReadyPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.025);
    box-shadow: 0 8px 24px rgba(91, 161, 37, 0.45);
  }
  100% {
    transform: scale(1);
  }
}

/* Grouped Date Boxes (YYYY - MM - DD) */
.date-group-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 8px 0 12px;
}

.date-cluster {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.date-boxes {
  display: flex;
  gap: 4px;
}

.date-box {
  width: clamp(28px, 8.5vw, 36px);
  height: 44px;
  border: 1.5px solid var(--border-input);
  border-radius: 8px;
  background: #f8fafc;
  color: #1e293b;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  outline: none;
  padding: 0;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
  font-family: 'Google Sans', monospace, sans-serif;
}

.date-box:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(91, 161, 37, 0.2);
}

.date-box.is-filled {
  border-color: var(--primary);
  background: #ffffff;
  color: #0f172a;
}

.date-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
}

.date-separator {
  color: #94a3b8;
  font-weight: 700;
  font-size: 14px;
  margin-top: -14px;
}

/* Grouped Phone Boxes (3 - 3 - 4) */
.phone-group-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 8px 0 14px;
}

.phone-boxes {
  display: flex;
  gap: 3px;
}

.phone-box {
  width: clamp(24px, 7.5vw, 32px);
  height: 44px;
  border: 1.5px solid var(--border-input);
  border-radius: 7px;
  background: #f8fafc;
  color: #1e293b;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  outline: none;
  padding: 0;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
  font-family: 'Google Sans', monospace, sans-serif;
}

.phone-box:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(91, 161, 37, 0.2);
}

.phone-box.is-filled {
  border-color: var(--primary);
  background: #ffffff;
  color: #0f172a;
}

.phone-separator {
  color: #94a3b8;
  font-weight: 700;
  font-size: 13px;
}

/* ─── Selected User Info (Step 2) ────────────────────────────────────────── */
.emp-id-badge {
  background: transparent;
  border: none;
  color: var(--text-main);
  padding: 0 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  font-size: 13.5px;
}

.emp-id-edit-btn {
  background: transparent;
  border: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.emp-id-edit-btn:hover {
  color: var(--primary-hover);
  background: rgba(91, 161, 37, 0.08);
}

/* ─── Buttons & Divider ─────────────────────────────────────────────────── */
.btn {
  border: none;
  border-radius: var(--radius-btn);
  padding: 12px 16px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px var(--primary-shadow);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(91, 161, 37, 0.35);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:focus,
.btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3.5px rgba(91, 161, 37, 0.35), 0 6px 16px rgba(91, 161, 37, 0.35);
}

.btn-secondary {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.btn-secondary:hover:not(:disabled) {
  background: #f1f5f9;
  color: #1e293b;
}

/* Microsoft Button */
.btn-microsoft {
  background: #ffffff;
  border: 1px solid #d1d5db;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
}

.btn-microsoft:hover:not(:disabled) {
  border-color: var(--primary);
  background: #f8fafc;
  color: #111827;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

/* OR Divider */
.or-divider {
  margin: 16px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.or-divider span {
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.or-divider strong {
  color: var(--text-light);
  font-size: 11px;
  letter-spacing: 0.08em;
  font-weight: 700;
}

/* ─── Links & Stepper ───────────────────────────────────────────────────── */
.back-button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 0 6px 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  transition: color 0.15s ease;
  margin-bottom: 8px;
}

.back-button:hover {
  color: var(--text-main);
}

.link-forgot {
  font-size: 12.5px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

.link-forgot:hover {
  text-decoration: underline;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.form-label {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-main);
}

.form-label .helper {
  font-size: 11px;
  font-weight: normal;
  color: var(--text-muted);
  margin-left: 4px;
}

.form-control {
  width: 100%;
  border: 1.5px solid var(--border-input);
  border-radius: var(--radius-input);
  padding: 11px 12px;
  font-size: 14.5px;
  font-weight: 500;
  background: #f8fafc;
  color: #111827;
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(91, 161, 37, 0.2);
}

/* Hide browser native password reveal icons (Edge, IE, Chromium) */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear,
input::-ms-reveal,
input::-ms-clear {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* Password Wrap with Show/Hide */
.password-input-wrap {
  position: relative;
  width: 100%;
}

.password-input-wrap .form-control {
  height: 52px;
  padding: 13px 48px 13px 15px;
  font-size: 16px;
  border-radius: 12px;
  border-width: 1.8px;
}

.password-toggle-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.18s ease, background 0.18s ease;
}

.password-toggle-btn:hover {
  background: #f0fdf4;
  color: var(--primary);
}

.password-toggle-btn:focus {
  outline: none;
  color: var(--primary);
}

.password-toggle-btn svg {
  display: block;
}

/* Remember Me */
.remember-me-container {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  margin-bottom: 0;
}

.remember-me-container input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.remember-me-container label {
  font-size: 12.5px;
  color: #475569;
  cursor: pointer;
  user-select: none;
  font-weight: 500;
  line-height: 1.4;
}

.remember-me-container .public-warning {
  color: #dc2626;
  font-weight: 700;
}

/* Submit Button in Step 2 (Spacing balanced: 26px > 14px above Remember Me) */
.btn-login-submit {
  margin-top: 26px;
}

/* ─── Forgot Password Category Chooser (Office vs Worker) ─────────────────── */
.forgot-choice-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 10px 0 16px;
}

.forgot-choice-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.forgot-choice-card:hover {
  border-color: var(--primary);
  background: #f0fdf4;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(91, 161, 37, 0.12);
}

.forgot-choice-card:active {
  transform: translateY(0);
}

.choice-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.choice-icon-wrap.ms-icon-wrap {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.choice-icon-wrap.worker-icon-wrap {
  background: #f0fdf4;
  border: 1px solid rgba(91, 161, 37, 0.2);
  color: var(--primary);
}

.choice-text-wrap {
  flex: 1;
  min-width: 0;
}

.choice-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 3px;
  line-height: 1.35;
}

.choice-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.choice-arrow {
  color: #94a3b8;
  flex-shrink: 0;
  transition: transform 0.2s ease, color 0.2s ease;
}

.forgot-choice-card:hover .choice-arrow {
  color: var(--primary);
  transform: translateX(3px);
}

/* ─── Password Strength Meter ────────────────────────────────────────────── */
.password-strength-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 8px;
}

.strength-bars {
  flex: 1;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  overflow: hidden;
}

.strength-bar {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-label {
  font-size: 11px;
  font-weight: 700;
  min-width: 48px;
  text-align: right;
}

.strength-score-1 { width: 25%; background-color: #dc2626; }
.strength-score-2 { width: 50%; background-color: #f97316; }
.strength-score-3 { width: 75%; background-color: #eab308; }
.strength-score-4 { width: 100%; background-color: #16a34a; }

.strength-text-1 { color: #dc2626; }
.strength-text-2 { color: #f97316; }
.strength-text-3 { color: #ca8a04; }
.strength-text-4 { color: #16a34a; }


/* ─── Profile View ───────────────────────────────────────────────────────── */
.profile-view {
  text-align: center;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-light);
  border: 3px solid var(--primary);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 8px;
}

.profile-meta-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 14px 0;
  text-align: left;
  font-size: 12.5px;
}

.profile-meta-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px dashed #e2e8f0;
}

.profile-meta-row:last-child {
  border-bottom: none;
}

.profile-meta-label {
  color: #64748b;
  font-weight: 500;
}

.profile-meta-value {
  color: #1e293b;
  font-weight: 600;
}

/* ─── Support Contact Info (Outside Container) ───────────────────────────── */
.support-contact-wrapper {
  width: 100%;
  text-align: center;
  font-size: 12px;
  color: #64748b;
  margin-top: 22px;
  line-height: 1.65;
}

.support-title {
  font-weight: 600;
  color: #475569;
  margin-bottom: 6px;
}

.support-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.support-link {
  color: var(--primary);
  text-decoration: underline;
  font-weight: 600;
}

.support-link:hover {
  color: var(--primary-hover);
}

.support-tel {
  margin-top: 4px;
  color: #475569;
  font-weight: 500;
}

/* ─── Footer Area (Bottom) ───────────────────────────────────────────────── */
.footer-wrapper {
  margin-top: 32px;
  text-align: center;
  font-size: 11px;
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.footer-version {
  color: var(--text-light);
}

.footer-dev {
  color: #64748b;
}

.footer-dev strong {
  color: var(--primary);
  font-weight: 700;
}

/* ─── Login Tour Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-close-btn {
  border: none;
  background: #f1f5f9;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 16px;
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.modal-body {
  padding: 18px 20px;
  max-height: 70vh;
  overflow-y: auto;
}

.tour-step-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #f8fafc;
}

.tour-step-card.highlight {
  border-color: #a7f3d0;
  background: #f0fdf4;
}

.tour-step-card h4 {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.tour-step-card p {
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
}

/* ─── Animations ─────────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Mobile Responsiveness ──────────────────────────────────────────────── */
@media (max-width: 480px) {
  body {
    padding: 16px 10px;
  }
  
  .login-card {
    padding: 22px 18px 26px;
    border-radius: 16px;
  }
  
  .tour-trigger-link {
    top: 19px;
    left: 14px;
    right: auto;
  }

  .back-circle-btn {
    top: 14px;
    right: 14px;
    left: auto;
    width: 32px;
    height: 32px;
  }

  .lang-selector-wrap {
    top: 14px;
    right: 14px;
  }

  .card-title {
    font-size: 19px;
  }

  .digit-boxes-container {
    gap: 5px;
    margin: 12px 0 16px;
  }

  .digit-box {
    width: clamp(35px, 11.2vw, 44px);
    height: 52px;
    font-size: 21px;
    border-radius: 10px;
  }

  .date-group-wrapper {
    gap: 4px;
  }

  .date-boxes {
    gap: 2px;
  }

  .date-box {
    width: clamp(24px, 8vw, 32px);
    height: 40px;
    font-size: 15px;
  }

  .phone-group-wrapper {
    gap: 3px;
  }

  .phone-boxes {
    gap: 2px;
  }

  .phone-box {
    width: clamp(22px, 6.8vw, 28px);
    height: 40px;
    font-size: 14px;
  }
}

/* ─── Floating Background Switcher Pill (Bottom-Right) ───────────────────── */
.bg-switcher-pill {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(203, 213, 225, 0.85);
  padding: 4px;
  border-radius: 999px;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
  gap: 3px;
  transition: all 0.25s ease;
}

.bg-switcher-pill:hover {
  background: #ffffff;
  border-color: rgba(91, 161, 37, 0.45);
  box-shadow: 0 10px 28px -4px rgba(0, 0, 0, 0.16), 0 4px 12px rgba(91, 161, 37, 0.12);
}

.bg-pill-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  outline: none;
}

.bg-pill-opt:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.04);
}

.bg-pill-opt.is-active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(91, 161, 37, 0.35);
}

.bg-pill-opt .bg-opt-icon {
  font-size: 13px;
  line-height: 1;
}

@media (max-width: 520px) {
  .bg-switcher-pill {
    bottom: 12px;
    right: 12px;
    padding: 3px;
  }
  .bg-pill-opt {
    padding: 5px 10px;
    font-size: 11.5px;
  }
}

/* ─── Account Chooser (Pick an account) ─────────────────────────────────── */
.account-picker-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0 10px;
}

.account-item-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #ffffff;
  border: 1.5px solid var(--border-card);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  width: 100%;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.account-item-card:hover {
  border-color: var(--primary);
  background: #f8fafc;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px rgba(91, 161, 37, 0.12), 0 2px 4px rgba(0, 0, 0, 0.04);
}

.account-item-card:active {
  transform: translateY(0) scale(0.99);
}

.account-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #f0fdf4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary);
  font-size: 14px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  border: 1.5px solid rgba(91, 161, 37, 0.3);
}

.account-info {
  flex: 1;
  min-width: 0;
}

.account-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.account-meta {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

.account-badge-sub {
  font-size: 11px;
  color: #15803d;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
}

.account-badge-sub::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
}

.account-remove-btn {
  opacity: 0.4;
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.account-item-card:hover .account-remove-btn {
  opacity: 0.8;
}

.account-remove-btn:hover {
  opacity: 1 !important;
  color: #ef4444;
  background: #fee2e2;
  transform: scale(1.1);
}

.add-account-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: transparent;
  border: 1.5px dashed #cbd5e1;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  width: 100%;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 600;
  margin-top: 4px;
}

.add-account-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(91, 161, 37, 0.05);
  transform: translateY(-1px);
}

.add-account-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.add-account-btn:hover .add-account-icon {
  background: rgba(91, 161, 37, 0.14);
  color: var(--primary);
}

.link-back-accounts {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
}

.link-back-accounts:hover {
  color: var(--primary-hover);
  background: rgba(91, 161, 37, 0.08);
  text-decoration: underline;
}

/* ─── Google Material 3 Style Account Switcher ────────────────────────────── */
.account-picker-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 8px;
}

.account-picker-list::-webkit-scrollbar {
  width: 5px;
}

.account-picker-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.google-acc-row {
  padding: 12px 6px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: all 0.15s ease;
  border-radius: 10px;
}

.google-acc-row:last-child {
  border-bottom: none;
}

.google-acc-row:hover {
  background: rgba(255, 255, 255, 0.65);
}

.google-acc-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.google-acc-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  user-select: none;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.google-acc-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.google-acc-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.google-acc-meta {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.google-acc-badge {
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  background: #f1f5f9;
  padding: 2.5px 8px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.google-acc-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  margin-left: 52px;
}

.btn-google-signin {
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid rgba(3, 105, 161, 0.2);
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 18px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.btn-google-signin:hover {
  background: #bae6fd;
  color: #0284c7;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(3, 105, 161, 0.15);
}

.btn-google-signin:active {
  transform: translateY(0);
}

.btn-google-remove {
  border-radius: 999px;
  background: transparent;
  color: #475569;
  border: 1px solid #cbd5e1;
  font-size: 12.5px;
  font-weight: 500;
  padding: 5px 16px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.btn-google-remove:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
  transform: translateY(-1px);
}

.btn-google-remove:active {
  transform: translateY(0);
}

.google-add-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 10px;
  width: 100%;
  border: 1.5px dashed #cbd5e1;
  background: transparent;
  cursor: pointer;
  border-radius: 12px;
  transition: all 0.18s ease;
  text-align: left;
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 600;
}

.google-add-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(91, 161, 37, 0.05);
}

.google-add-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid #cbd5e1;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.google-add-btn:hover .google-add-icon {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(91, 161, 37, 0.12);
}

