/* Split-screen auth pages (login / signup) */
body.auth-page {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  background: #ffffff;
}

body.auth-page .site-background {
  display: none;
}

body.auth-page .site-footer {
  display: none;
}

body.auth-page .site-content {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
  display: block;
  overflow-x: hidden;
}

.auth-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
}

/* ── Left: form panel ── */
.auth-split-form {
  background: #ffffff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  overflow-x: hidden;
}

.auth-brand-row {
  padding: 32px 48px 0;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.5px;
}

.auth-brand i {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  color: #fff;
  font-size: 16px;
}

.auth-form-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 48px 40px;
}

.auth-form-inner h1 {
  font-size: 32px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: 15px;
  color: #6b7280;
  margin-bottom: 32px;
  line-height: 1.5;
}

.auth-page .auth-form-inner .form-group {
  margin-bottom: 20px;
}

.auth-page .auth-form-inner .form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  text-transform: none;
  letter-spacing: 0;
}

.auth-page .auth-form-inner .form-group label .optional {
  color: #9ca3af;
  font-weight: 400;
}

.auth-input-wrap {
  position: relative;
}

.auth-page .auth-form-inner input[type="email"],
.auth-page .auth-form-inner input[type="password"],
.auth-page .auth-form-inner input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 16px;
  color: #0f172a;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.auth-page .auth-form-inner input:focus {
  outline: none;
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(0, 173, 181, 0.15);
}

.auth-page .auth-form-inner input::placeholder {
  color: #9ca3af;
}

.auth-input-wrap input {
  padding-right: 44px !important;
}

.auth-pw-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 10px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  touch-action: manipulation;
}

.auth-pw-toggle:hover {
  color: #6b7280;
}

.auth-form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: wrap;
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #4b5563;
  cursor: pointer;
  user-select: none;
}

.auth-remember input {
  width: 16px;
  height: 16px;
  accent-color: #14b8a6;
  cursor: pointer;
}

.auth-link {
  color: #14b8a6;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-btn-primary {
  width: 100%;
  min-height: 48px;
  padding: 14px 20px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(0, 173, 181, 0.35);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.auth-btn-primary:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 173, 181, 0.4);
}

.auth-btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

@media (hover: none) {
  .auth-btn-primary:hover,
  .auth-btn-ghost:hover {
    transform: none;
  }
}

.auth-btn-ghost {
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  margin-top: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #4b5563;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.auth-btn-ghost:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.auth-page .alert {
  margin-top: 16px;
}

.auth-switch {
  margin-top: 28px;
  text-align: center;
  font-size: 14px;
  color: #6b7280;
}

.auth-switch a {
  color: #14b8a6;
  font-weight: 700;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.auth-legal {
  margin-top: auto;
  padding: 24px 48px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: #9ca3af;
  border-top: 1px solid #f3f4f6;
}

.auth-legal a {
  color: #6b7280;
  text-decoration: none;
}

.auth-legal a:hover {
  color: #14b8a6;
}

/* Signup steps */
.auth-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 28px;
}

.auth-step-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 64px;
}

.auth-step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  background: #f3f4f6;
  color: #9ca3af;
  border: 2px solid #e5e7eb;
  transition: all 0.2s;
}

.auth-step-node.active .auth-step-circle {
  background: #14b8a6;
  border-color: #14b8a6;
  color: #fff;
}

.auth-step-node.done .auth-step-circle {
  background: #ecfdf5;
  border-color: #10b981;
  color: #059669;
}

.auth-step-label {
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.auth-step-node.active .auth-step-label {
  color: #14b8a6;
}

.auth-step-node.done .auth-step-label {
  color: #059669;
}

.auth-step-line {
  flex: 1;
  height: 2px;
  background: #e5e7eb;
  min-width: 24px;
  max-width: 48px;
  margin-bottom: 20px;
  transition: background 0.2s;
}

.auth-step-line.done {
  background: #10b981;
}

.auth-form-panel {
  display: none;
}

.auth-form-panel.active {
  display: block;
}

.auth-notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #f0fdfa;
  border: 1px solid rgba(0, 173, 181, 0.25);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 20px;
  font-size: 13px;
  color: #0f766e;
  line-height: 1.5;
}

.auth-notice strong {
  color: #b45309;
}

.auth-code-input {
  letter-spacing: 6px !important;
  font-size: 22px !important;
  text-align: center !important;
}

/* ── Right: promo panel ── */
.auth-split-promo {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: linear-gradient(145deg, #14b8a6 0%, #0d9488 45%, #0f766e 100%);
}

.auth-split-promo::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 90% 10%, rgba(255, 255, 255, 0.12), transparent 50%),
    radial-gradient(ellipse 50% 40% at 10% 90%, rgba(0, 0, 0, 0.15), transparent 50%);
  pointer-events: none;
}

.auth-promo-inner {
  position: relative;
  z-index: 1;
  max-width: 520px;
  width: 100%;
  color: #fff;
}

.auth-promo-inner h2 {
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.5px;
  margin-bottom: 14px;
}

.auth-promo-inner > p {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.6;
  margin-bottom: 36px;
}

/* Dashboard preview mockup */
.auth-dashboard-preview {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(8px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
}

.auth-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.auth-preview-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.auth-preview-card.wide {
  grid-column: 1 / -1;
}

.auth-preview-label {
  font-size: 11px;
  color: #6b7280;
  font-weight: 600;
  margin-bottom: 4px;
}

.auth-preview-value {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}

.auth-preview-value.sm {
  font-size: 16px;
}

.auth-preview-value.teal {
  color: #14b8a6;
}

.auth-preview-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 48px;
  margin-top: 8px;
}

.auth-preview-bars span {
  flex: 1;
  background: linear-gradient(180deg, #14b8a6, #0d9488);
  border-radius: 4px 4px 0 0;
  opacity: 0.85;
}

.auth-preview-bars span:nth-child(1) { height: 40%; }
.auth-preview-bars span:nth-child(2) { height: 65%; }
.auth-preview-bars span:nth-child(3) { height: 50%; }
.auth-preview-bars span:nth-child(4) { height: 85%; }
.auth-preview-bars span:nth-child(5) { height: 60%; }
.auth-preview-bars span:nth-child(6) { height: 75%; }

.auth-preview-table {
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.auth-preview-table-head {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f3f4f6;
}

.auth-preview-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  font-size: 11px;
  color: #6b7280;
  padding: 6px 0;
  border-bottom: 1px solid #f9fafb;
}

.auth-preview-row:last-child {
  border-bottom: none;
}

.auth-preview-row strong {
  color: #374151;
  font-weight: 600;
}

.auth-preview-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: #ecfdf5;
  color: #059669;
}

/* Compact banner on mobile (replaces hidden promo panel) */
.auth-mobile-banner {
  display: none;
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .auth-split {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .auth-split-form {
    min-height: 100vh;
    min-height: 100dvh;
  }

  .auth-split-promo {
    display: none;
  }

  .auth-mobile-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 24px 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(0, 173, 181, 0.12), rgba(14, 116, 144, 0.08));
    border: 1px solid rgba(0, 173, 181, 0.2);
    color: #0f766e;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
  }

  .auth-mobile-banner i {
    flex-shrink: 0;
    font-size: 16px;
    color: #14b8a6;
  }

  .auth-brand-row {
    padding: calc(16px + env(safe-area-inset-top, 0px)) 24px 0;
  }

  .auth-form-inner {
    justify-content: flex-start;
    flex: 0 1 auto;
    padding: 20px 24px 24px;
    max-width: 100%;
  }

  .auth-subtitle {
    margin-bottom: 24px;
  }

  .auth-legal {
    margin-top: auto;
    padding: 16px 24px calc(20px + env(safe-area-inset-bottom, 0px));
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
  }

  .auth-form-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
  }

  .auth-link {
    font-size: 13px;
  }

  .auth-steps {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    margin-bottom: 22px;
  }

  .auth-steps::-webkit-scrollbar {
    display: none;
  }

  .auth-step-node {
    min-width: 52px;
    flex-shrink: 0;
  }

  .auth-step-line {
    min-width: 16px;
    max-width: 32px;
  }

  .auth-code-input {
    letter-spacing: 4px !important;
    font-size: 20px !important;
  }
}

@media (max-width: 480px) {
  .auth-brand {
    font-size: 18px;
  }

  .auth-brand i {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .auth-form-inner h1 {
    font-size: 24px;
    margin-bottom: 6px;
  }

  .auth-subtitle {
    font-size: 14px;
    margin-bottom: 20px;
  }

  .auth-form-inner {
    padding: 16px 16px 20px;
  }

  .auth-brand-row {
    padding-left: 16px;
    padding-right: 16px;
  }

  .auth-mobile-banner {
    margin-left: 16px;
    margin-right: 16px;
    font-size: 12px;
  }

  .auth-legal {
    padding-left: 16px;
    padding-right: 16px;
    font-size: 12px;
  }

  .auth-page .auth-form-inner .form-group {
    margin-bottom: 16px;
  }

  .auth-switch {
    margin-top: 20px;
    font-size: 13px;
  }

  .auth-notice {
    font-size: 12px;
    padding: 10px 12px;
  }
}

@media (max-width: 360px) {
  .auth-step-label {
    font-size: 10px;
  }

  .auth-step-circle {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
}
