/* ============================================
   AUTHENTICATION PAGES - UNIFIED STYLES
   ============================================

   Shared styles for login.html and userinfo.html
   Clean, modern, two-panel layout
   ============================================ */

/* ==============================================
   PAGE LAYOUT
   ============================================== */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

body.login-screen {
  overflow: hidden;
}

body.login-screen .page {
  height: 100svh;
  min-height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(circle at 8% 10%, rgba(83, 198, 183, 0.08), transparent 45%),
    radial-gradient(circle at 88% 14%, rgba(255, 107, 90, 0.08), transparent 40%),
    var(--paper);
}

[data-theme="dark"] .page {
  background: var(--paper);
}

/* Section container */
.section {
  flex: 1;
  padding: 0 20px 80px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

body.login-screen .section {
  max-width: 100%;
  padding: 8px 20px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 0;
}

/* ==============================================
   PAGE HEADER (simplified)
   ============================================== */
.page-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 40px;
  padding: 0 20px;
}

body.login-screen .page-header {
  display: none;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.page-header p {
  color: var(--ink-2);
  max-width: 520px;
  margin: 0 auto;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ==============================================
   AUTH CONTAINER (two-panel layout)
   ============================================== */
.auth-container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  max-width: 880px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid rgba(20, 19, 32, 0.06);
  box-shadow: 0 4px 16px rgba(20, 19, 32, 0.06),
              0 1px 3px rgba(20, 19, 32, 0.03);
  overflow: hidden;
}

[data-theme="dark"] .auth-container {
  background: var(--surface);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2),
              0 1px 3px rgba(0, 0, 0, 0.15);
}

/* ==============================================
   AUTH PANEL (each side)
   ============================================== */
.auth-panel {
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.auth-panel form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ==============================================
   AUTH PANEL HEADER
   ============================================== */
.auth-panel-header {
  margin-bottom: 24px;
}

.auth-panel-header h2 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.auth-panel-header p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ==============================================
   AUTH DIVIDER (vertical line)
   ============================================== */
.auth-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 0;
}

.auth-divider-line {
  width: 1px;
  height: 100%;
  background: rgba(20, 19, 32, 0.08);
}

[data-theme="dark"] .auth-divider-line {
  background: rgba(255, 255, 255, 0.08);
}

/* ==============================================
   FORM FIELDS
   ============================================== */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-panel label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
  display: block;
}

.auth-panel input {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid rgba(20, 19, 32, 0.1);
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.auth-panel input:hover:not(:disabled) {
  border-color: rgba(20, 19, 32, 0.15);
}

.auth-panel input:focus {
  outline: none;
  border-color: var(--accent-3);
  box-shadow: 0 0 0 3px rgba(83, 198, 183, 0.12);
}

.auth-panel input:disabled {
  background: rgba(20, 19, 32, 0.03);
  color: var(--muted);
  cursor: not-allowed;
}

.auth-panel input::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

[data-theme="dark"] .auth-panel input {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--ink);
}

[data-theme="dark"] .auth-panel input:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .auth-panel input:focus {
  background: var(--paper);
  border-color: var(--accent-3);
  box-shadow: 0 0 0 3px rgba(83, 198, 183, 0.2);
}

/* Validation states */
.auth-panel input.valid {
  border-color: var(--success);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2222c55e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

.auth-panel input.invalid {
  border-color: var(--danger);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ef4444' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

.form-field-error {
  font-size: 0.8rem;
  color: var(--danger);
  margin-top: 2px;
  display: none;
}

.form-field-error.visible {
  display: block;
}

/* ==============================================
   PASSWORD INPUT & TOGGLE (fixed jumping)
   ============================================== */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  padding-right: 42px !important;
}

/* Password toggle button - fixed dimensions prevent jumping */
.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  /* Use CSS grid to stack both icons in the same cell */
  display: grid;
  place-items: center;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.password-toggle:hover {
  background: rgba(20, 19, 32, 0.06);
  color: var(--ink-2);
}

[data-theme="dark"] .password-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

.password-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(83, 198, 183, 0.3);
}

/* Both SVGs occupy the same grid cell - no layout shift */
.password-toggle svg {
  grid-area: 1 / 1;
  width: 18px;
  height: 18px;
  transition: opacity 0.15s ease;
}

/* Default state: show eye-open, hide eye-closed */
.password-toggle .icon-show {
  opacity: 1;
}

.password-toggle .icon-hide {
  opacity: 0;
}

/* Active state: show eye-closed, hide eye-open */
.password-toggle.active .icon-show {
  opacity: 0;
}

.password-toggle.active .icon-hide {
  opacity: 1;
}

/* ==============================================
   PASSWORD STRENGTH INDICATOR
   ============================================== */
.password-strength {
  margin-top: 6px;
  padding: 10px;
  background: rgba(20, 19, 32, 0.02);
  border-radius: 8px;
  border: 1px solid rgba(20, 19, 32, 0.05);
  display: none;
}

.password-strength.visible {
  display: block;
}

[data-theme="dark"] .password-strength {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
}

.strength-bar {
  height: 4px;
  background: rgba(20, 19, 32, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

[data-theme="dark"] .strength-bar {
  background: rgba(255, 255, 255, 0.08);
}

.strength-fill {
  height: 100%;
  width: 0%;
  background: var(--danger);
  border-radius: 999px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-text {
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 4px;
  display: block;
}

.strength-feedback {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.strength-feedback li {
  padding-left: 16px;
  position: relative;
}

.strength-feedback li::before {
  content: "\2022";
  position: absolute;
  left: 4px;
  color: var(--muted);
}

/* ==============================================
   FORM STATUS MESSAGES
   ============================================== */
.form-status,
.form-error {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.4;
  display: none;
}

.form-status:not(:empty),
.form-error:not(:empty) {
  display: block;
}

.form-status-error,
.form-error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.form-status-success {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.form-status-info {
  background: rgba(83, 198, 183, 0.08);
  border: 1px solid rgba(83, 198, 183, 0.15);
  color: var(--accent-3);
}

.form-status-warning {
  background: rgba(251, 146, 60, 0.08);
  border: 1px solid rgba(251, 146, 60, 0.15);
  color: #f97316;
}

/* ==============================================
   BUTTONS
   ============================================== */
.auth-panel .btn.primary {
  width: 100%;
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 10px;
  background: var(--accent-3);
  color: white;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 6px rgba(83, 198, 183, 0.2);
}

.auth-panel .btn.primary:hover:not(:disabled) {
  background: var(--primary-strong);
  box-shadow: 0 4px 10px rgba(83, 198, 183, 0.25);
}

.auth-panel .btn.primary:active:not(:disabled) {
  box-shadow: 0 2px 6px rgba(83, 198, 183, 0.2);
}

.auth-panel .btn.primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-panel .btn.primary.loading {
  opacity: 0.8;
  pointer-events: none;
}

.btn-spinner {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.auth-panel .btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

/* ==============================================
   FORM LINKS
   ============================================== */
.form-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}

.form-links a,
.forgot-password-link {
  font-size: 0.85rem;
  color: var(--accent-3);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.form-links a:hover,
.forgot-password-link:hover {
  color: var(--primary-strong);
  text-decoration: underline;
}

/* ==============================================
   MODALS
   ============================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 19, 32, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 28px;
  max-width: 420px;
  width: calc(100% - 40px);
  box-shadow: 0 8px 24px rgba(20, 19, 32, 0.12),
              0 2px 6px rgba(20, 19, 32, 0.08);
  border: 1px solid rgba(20, 19, 32, 0.06);
  transform: scale(0.96);
  transition: transform 0.2s ease;
}

.modal-overlay.show .modal-card {
  transform: scale(1);
}

[data-theme="dark"] .modal-card {
  background: var(--surface);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3),
              0 2px 6px rgba(0, 0, 0, 0.2);
}

.modal-header {
  margin-bottom: 20px;
}

.modal-header strong {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  display: block;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.modal-header span {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

.modal-body {
  margin-bottom: 24px;
}

.modal-body label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
  display: block;
  margin-bottom: 6px;
}

.modal-body input {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid rgba(20, 19, 32, 0.1);
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.modal-body input:focus {
  outline: none;
  border-color: var(--accent-3);
  box-shadow: 0 0 0 3px rgba(83, 198, 183, 0.12);
}

[data-theme="dark"] .modal-body input {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--ink);
}

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

.modal-actions .btn {
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.modal-actions .btn svg {
  width: 14px;
  height: 14px;
}

.modal-actions .btn.secondary {
  background: rgba(20, 19, 32, 0.06);
  color: var(--ink-2);
}

.modal-actions .btn.secondary:hover {
  background: rgba(20, 19, 32, 0.1);
}

.modal-actions .btn.primary {
  background: var(--accent-3);
  color: white;
  box-shadow: 0 2px 6px rgba(83, 198, 183, 0.2);
}

.modal-actions .btn.primary:hover {
  background: var(--primary-strong);
  box-shadow: 0 4px 10px rgba(83, 198, 183, 0.25);
}

.modal-actions .btn.primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ==============================================
   LEGACY AUTH OVERLAY (unused)
   ============================================== */
.verification-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 19, 32, 0.5);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.verification-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

[data-theme="dark"] .verification-overlay {
  background: rgba(0, 0, 0, 0.6);
}

.verification-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 32px;
  max-width: 480px;
  width: calc(100% - 40px);
  box-shadow: 0 12px 32px rgba(20, 19, 32, 0.15),
              0 4px 8px rgba(20, 19, 32, 0.1);
  border: 1px solid rgba(20, 19, 32, 0.06);
  transform: scale(0.94);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.verification-overlay.show .verification-card {
  transform: scale(1);
}

[data-theme="dark"] .verification-card {
  background: var(--surface);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4),
              0 4px 8px rgba(0, 0, 0, 0.3);
}

.verification-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(83, 198, 183, 0.1);
  border-radius: 16px;
  color: var(--accent-3);
}

.verification-icon svg {
  width: 36px;
  height: 36px;
  stroke-width: 2;
}

.verification-header {
  text-align: center;
  margin-bottom: 24px;
}

.verification-header strong {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
  display: block;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.verification-header span {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
}

.verification-body {
  margin-bottom: 24px;
}

.verification-body p {
  font-size: 0.9rem;
  color: var(--ink-2);
  line-height: 1.6;
  margin-bottom: 12px;
  text-align: center;
}

.verification-email {
  font-weight: 600;
  color: var(--accent-3);
  background: rgba(83, 198, 183, 0.08);
  padding: 8px 16px;
  border-radius: 8px;
  display: block;
  font-size: 0.9rem;
  border: 1px solid rgba(83, 198, 183, 0.15);
  margin: 0 auto 20px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.verification-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: rgba(20, 19, 32, 0.02);
  border-radius: 10px;
  border: 1px solid rgba(20, 19, 32, 0.05);
}

[data-theme="dark"] .verification-steps {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
}

.verification-step {
  display: flex;
  align-items: center;
  gap: 12px;
}

.step-number {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-3);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
}

.step-text {
  font-size: 0.9rem;
  color: var(--ink-2);
  flex: 1;
}

.verification-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 24px;
}

.verification-actions .btn {
  padding: 11px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.verification-actions .btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.verification-actions .btn.secondary {
  background: rgba(20, 19, 32, 0.06);
  color: var(--ink-2);
}

.verification-actions .btn.secondary:hover {
  background: rgba(20, 19, 32, 0.1);
}

[data-theme="dark"] .verification-actions .btn.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

[data-theme="dark"] .verification-actions .btn.secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.verification-actions .btn.primary {
  background: var(--accent-3);
  color: white;
  box-shadow: 0 2px 6px rgba(83, 198, 183, 0.25);
}

.verification-actions .btn.primary:hover {
  background: var(--primary-strong);
  box-shadow: 0 4px 10px rgba(83, 198, 183, 0.3);
}

.verification-actions .btn.primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Cancel registration section */
.verification-cancel {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(20, 19, 32, 0.06);
  text-align: center;
}

[data-theme="dark"] .verification-cancel {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.verification-cancel .btn-link {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.verification-cancel .btn-link:hover {
  color: var(--danger);
  background: rgba(255, 71, 87, 0.08);
}

/* ==============================================
   LOGIN PAGE AUTH FLOW (single-panel mode)
   ============================================== */
.auth-container.auth-flow {
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  max-width: 640px;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
  width: min(640px, 100%);
  height: min(100%, 700px);
  max-height: 100%;
}

.auth-container.auth-flow .auth-divider {
  display: none;
}

.auth-flow-header {
  position: relative;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  min-height: 112px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(20, 19, 32, 0.06);
  background:
    linear-gradient(135deg, rgba(83, 198, 183, 0.08), rgba(255, 255, 255, 0) 45%),
    linear-gradient(225deg, rgba(255, 107, 90, 0.08), rgba(255, 255, 255, 0) 55%),
    var(--surface);
  box-shadow:
    0 12px 28px rgba(20, 19, 32, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  overflow: hidden;
}

.auth-flow-header::before {
  content: "";
  position: absolute;
  inset: auto -12% -48% auto;
  width: 34%;
  height: 58%;
  background: radial-gradient(circle, rgba(255, 107, 90, 0.08), transparent 68%);
  pointer-events: none;
}

[data-theme="dark"] .auth-flow-header {
  border-color: rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(135deg, rgba(83, 198, 183, 0.12), rgba(255, 255, 255, 0) 45%),
    linear-gradient(225deg, rgba(255, 107, 90, 0.12), rgba(255, 255, 255, 0) 55%),
    rgba(255, 255, 255, 0.02);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] .auth-flow-header::before {
  background: radial-gradient(circle, rgba(255, 107, 90, 0.12), transparent 70%);
}

.auth-flow-visual {
  position: relative;
  min-height: 92px;
  border-radius: 14px;
  border: 1px solid rgba(20, 19, 32, 0.08);
  background:
    radial-gradient(circle at 15% 20%, rgba(83, 198, 183, 0.28), transparent 50%),
    radial-gradient(circle at 80% 75%, rgba(255, 107, 90, 0.22), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 255, 0.86));
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 8px 18px rgba(20, 19, 32, 0.05);
}

[data-theme="dark"] .auth-flow-visual {
  border-color: rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 15% 20%, rgba(83, 198, 183, 0.2), transparent 52%),
    radial-gradient(circle at 80% 75%, rgba(255, 107, 90, 0.16), transparent 56%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 8px 18px rgba(0, 0, 0, 0.22);
}

.auth-flow-visual-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(20, 19, 32, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 19, 32, 0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.35;
}

[data-theme="dark"] .auth-flow-visual-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
}

.auth-flow-visual-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(10px);
  opacity: 0.7;
}

.auth-flow-visual-glow-a {
  width: 86px;
  height: 86px;
  top: -12px;
  right: 18px;
  background: rgba(83, 198, 183, 0.25);
}

.auth-flow-visual-glow-b {
  width: 74px;
  height: 74px;
  bottom: 8px;
  left: 10px;
  background: rgba(255, 107, 90, 0.18);
}

.auth-flow-preview-card {
  position: absolute;
  border-radius: 12px;
  border: 1px solid rgba(20, 19, 32, 0.08);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 6px 16px rgba(20, 19, 32, 0.08);
}

[data-theme="dark"] .auth-flow-preview-card {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(22, 25, 36, 0.78);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
}

.auth-flow-preview-chat {
  left: 10px;
  top: 10px;
  width: 62px;
  height: 42px;
  padding: 6px;
  display: flex;
  gap: 5px;
  align-items: flex-start;
}

.preview-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-3), #68d9cb);
  flex: 0 0 auto;
  margin-top: 2px;
}

.preview-lines {
  display: grid;
  gap: 3px;
  width: 100%;
}

.preview-lines span {
  display: block;
  height: 3px;
  border-radius: 999px;
  background: rgba(20, 19, 32, 0.1);
}

[data-theme="dark"] .preview-lines span {
  background: rgba(255, 255, 255, 0.12);
}

.preview-lines span:nth-child(1) { width: 88%; }
.preview-lines span:nth-child(2) { width: 100%; }
.preview-lines span:nth-child(3) { width: 68%; }

.auth-flow-preview-map {
  right: 10px;
  top: 12px;
  width: 62px;
  height: 46px;
}

.preview-node {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(20, 19, 32, 0.12);
  box-sizing: border-box;
}

[data-theme="dark"] .preview-node {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.15);
}

.preview-node-center {
  left: 26px;
  top: 19px;
  width: 9px;
  height: 9px;
  border-color: rgba(83, 198, 183, 0.45);
  box-shadow: 0 0 0 3px rgba(83, 198, 183, 0.12);
}

.preview-node-a { left: 8px; top: 8px; }
.preview-node-b { right: 8px; bottom: 8px; }

.preview-link {
  position: absolute;
  height: 2px;
  background: linear-gradient(90deg, rgba(83, 198, 183, 0.3), rgba(255, 107, 90, 0.3));
  transform-origin: left center;
  border-radius: 999px;
}

.preview-link-a {
  left: 12px;
  top: 12px;
  width: 17px;
  transform: rotate(26deg);
}

.preview-link-b {
  left: 28px;
  top: 24px;
  width: 16px;
  transform: rotate(26deg);
}

.auth-flow-preview-task {
  display: none;
}

.preview-task-row {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 6px;
  align-items: center;
}

.preview-task-row i {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: rgba(83, 198, 183, 0.22);
  border: 1px solid rgba(83, 198, 183, 0.32);
}

.preview-task-row:nth-child(2) i {
  background: rgba(255, 183, 77, 0.22);
  border-color: rgba(255, 183, 77, 0.34);
}

.preview-task-row:nth-child(3) i {
  background: rgba(255, 107, 90, 0.18);
  border-color: rgba(255, 107, 90, 0.3);
}

.preview-task-row span {
  display: block;
  height: 5px;
  border-radius: 999px;
  background: rgba(20, 19, 32, 0.1);
}

[data-theme="dark"] .preview-task-row span {
  background: rgba(255, 255, 255, 0.12);
}

.preview-task-row:nth-child(1) span { width: 86%; }
.preview-task-row:nth-child(2) span { width: 72%; }
.preview-task-row:nth-child(3) span { width: 92%; }

.auth-flow-orbit {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: linear-gradient(135deg, var(--accent-3), var(--accent));
  box-shadow: 0 5px 10px rgba(83, 198, 183, 0.28);
  border: 2px solid rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .auth-flow-orbit {
  border-color: rgba(255, 255, 255, 0.14);
}

.auth-flow-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

.auth-flow-chip-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.auth-flow-chip {
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-3);
  background: rgba(83, 198, 183, 0.1);
  border: 1px solid rgba(83, 198, 183, 0.15);
}

.auth-flow-chip-secondary {
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 0.62rem;
  color: var(--ink-2);
  border: 1px solid rgba(20, 19, 32, 0.08);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(6px);
}

[data-theme="dark"] .auth-flow-chip-secondary {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.auth-flow-title {
  margin: 0;
  color: var(--ink);
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: clamp(1rem, 0.9vw + 0.72rem, 1.36rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  max-width: 19ch;
  text-wrap: balance;
}

.auth-flow-subtitle {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.73rem;
  line-height: 1.28;
  max-width: 52ch;
}

.auth-flow-pills {
  display: none;
}

.auth-flow-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--ink-2);
  background: rgba(20, 19, 32, 0.04);
  border: 1px solid rgba(20, 19, 32, 0.06);
}

.auth-flow-pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(83, 198, 183, 0.7);
  box-shadow: 0 0 0 3px rgba(83, 198, 183, 0.14);
}

[data-theme="dark"] .auth-flow-pill {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
}

.auth-container.auth-flow .auth-panel {
  padding: 22px 22px;
}

.auth-container.auth-flow .auth-panel form {
  gap: 14px;
}

.auth-container.auth-flow .auth-panel-header {
  margin-bottom: 14px;
}

.auth-container.auth-flow .auth-panel-header h2 {
  font-size: 1.15rem;
  margin-bottom: 2px;
}

.auth-container.auth-flow .auth-panel-header p {
  font-size: 0.82rem;
}

.auth-container.auth-flow .auth-mode-panel {
  border-radius: 16px;
  border: 1px solid rgba(20, 19, 32, 0.06);
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(20, 19, 32, 0.06);
  animation: authPanelFade 0.2s ease;
  max-height: none;
  min-height: 0;
  overflow: visible;
}

[data-theme="dark"] .auth-container.auth-flow .auth-mode-panel {
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
}

.auth-container.auth-flow .auth-mode-panel[hidden] {
  display: none !important;
}

.auth-panel-switch {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(20, 19, 32, 0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

[data-theme="dark"] .auth-panel-switch {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.auth-panel-switch-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.auth-switch-cta {
  width: 100%;
  justify-content: center;
  min-height: 40px;
  border-radius: 10px;
}

.auth-switch-cta:hover:not(:disabled) {
  transform: translateY(-1px);
}

@keyframes authPanelFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==============================================
   ACCESSIBILITY
   ============================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==============================================
   RESPONSIVE
   ============================================== */
@media (max-width: 768px) {
  .auth-container {
    grid-template-columns: 1fr;
    max-width: 440px;
  }

  .auth-divider {
    padding: 0 32px;
  }

  .auth-divider-line {
    width: 100%;
    height: 1px;
  }

  .auth-panel {
    padding: 28px 24px;
  }

  .auth-container.auth-flow {
    max-width: 520px;
    gap: 10px;
    height: min(100%, 676px);
  }

  .auth-flow-header {
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 8px;
    min-height: 102px;
    padding: 8px;
  }

  .auth-flow-visual {
    min-height: 84px;
  }

  .auth-flow-preview-chat {
    width: 54px;
    height: 38px;
    padding: 6px;
  }

  .auth-flow-preview-map {
    right: 8px;
    top: 10px;
    width: 54px;
    height: 40px;
  }

  .auth-flow-copy {
    gap: 5px;
  }

  .auth-flow-title {
    max-width: none;
    font-size: clamp(0.95rem, 3vw, 1.15rem);
  }

  .auth-flow-subtitle {
    max-width: none;
    font-size: 0.7rem;
    line-height: 1.22;
  }

  .auth-flow-pills {
    display: none;
  }

  body.login-screen .section {
    padding: 8px 14px 14px;
  }
}

@media (max-width: 480px) {
  .page-header h1 {
    font-size: 1.6rem;
  }

  .auth-panel {
    padding: 24px 20px;
  }

  .auth-flow-title {
    font-size: clamp(0.94rem, 5vw, 1.08rem);
  }

  .auth-flow-subtitle {
    font-size: 0.68rem;
  }

  .auth-flow-chip-row {
    gap: 6px;
  }

  .auth-flow-chip,
  .auth-flow-chip-secondary {
    font-size: 0.6rem;
    padding: 3px 6px;
  }

  .auth-flow-header {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .auth-flow-visual {
    display: none;
  }

  .auth-panel-header h2 {
    font-size: 1.2rem;
  }

  .auth-container.auth-flow .auth-mode-panel {
    min-height: 0;
  }

  .modal-card {
    padding: 24px 20px;
    border-radius: 12px;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .verification-card {
    padding: 28px 20px;
  }

  .verification-header strong {
    font-size: 1.3rem;
  }

  .verification-actions {
    flex-direction: column;
  }

  .verification-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-height: 820px) {
  body.login-screen {
    overflow-y: auto;
  }

  body.login-screen .page {
    height: auto;
    min-height: 100svh;
    overflow: visible;
  }

  body.login-screen .section {
    align-items: flex-start;
    overflow: visible;
    padding-top: 10px;
  }

  .auth-container.auth-flow {
    height: auto;
    max-height: none;
  }
}

/* ==============================================
   LOGIN PAGE OVERRIDE: NO TOP HERO, RE-LAYOUT CARD
   ============================================== */
body.login-screen .section {
  padding-top: 14px;
}

.auth-container.auth-flow {
  display: block;
  width: min(560px, 100%);
  height: auto;
  max-height: none;
  padding: 10px;
  border-radius: 22px;
  border: 1px solid rgba(20, 19, 32, 0.08);
  background:
    linear-gradient(160deg, rgba(83, 198, 183, 0.08), transparent 38%),
    linear-gradient(340deg, rgba(255, 107, 90, 0.08), transparent 42%),
    rgba(255, 255, 255, 0.68);
  box-shadow:
    0 24px 48px rgba(20, 19, 32, 0.08),
    0 6px 18px rgba(20, 19, 32, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.auth-container.auth-flow::before {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  top: -70px;
  right: -40px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 107, 90, 0.18), transparent 70%);
  pointer-events: none;
}

.auth-container.auth-flow::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  left: -90px;
  bottom: -110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(83, 198, 183, 0.16), transparent 70%);
  pointer-events: none;
}

[data-theme="dark"] .auth-container.auth-flow {
  border-color: rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(160deg, rgba(83, 198, 183, 0.1), transparent 38%),
    linear-gradient(340deg, rgba(255, 107, 90, 0.1), transparent 42%),
    rgba(255, 255, 255, 0.02);
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.28),
    0 6px 16px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.auth-container.auth-flow .auth-mode-panel {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(20, 19, 32, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.82)),
    var(--surface);
  box-shadow:
    0 12px 30px rgba(20, 19, 32, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.auth-container.auth-flow .auth-mode-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-3), var(--accent));
}

.auth-container.auth-flow[data-auth-mode="register"] .auth-mode-panel::before {
  background: linear-gradient(90deg, var(--accent), #ff9b7a);
}

[data-theme="dark"] .auth-container.auth-flow .auth-mode-panel {
  border-color: rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.01);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.auth-container.auth-flow .auth-panel {
  padding: 26px 24px 22px;
}

.auth-container.auth-flow .auth-panel form {
  gap: 14px;
}

.auth-container.auth-flow .auth-panel-header {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(20, 19, 32, 0.06);
}

[data-theme="dark"] .auth-container.auth-flow .auth-panel-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

#loginPanel .auth-panel-header::before,
#registerPanel .auth-panel-header::before {
  display: inline-flex;
  align-items: center;
  margin-bottom: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(20, 19, 32, 0.08);
  background: rgba(20, 19, 32, 0.03);
  color: var(--ink-2);
}

#loginPanel .auth-panel-header::before {
  content: "Sign In";
}

#registerPanel .auth-panel-header::before {
  content: "Create Account";
}

.auth-container.auth-flow .auth-panel-header h2 {
  font-size: 1.18rem;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.auth-container.auth-flow .auth-panel-header p {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--muted);
}

.auth-container.auth-flow .auth-panel .btn.primary {
  min-height: 42px;
  border-radius: 12px;
  box-shadow: 0 8px 16px rgba(83, 198, 183, 0.18);
}

.auth-container.auth-flow .auth-panel-switch {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(20, 19, 32, 0.06);
  background: rgba(20, 19, 32, 0.02);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

[data-theme="dark"] .auth-container.auth-flow .auth-panel-switch {
  border-color: rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
}

.auth-container.auth-flow .auth-panel-switch-label {
  text-align: left;
  font-size: 0.82rem;
}

.auth-container.auth-flow .auth-switch-cta {
  width: auto;
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.82rem;
  border-radius: 10px;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .auth-container.auth-flow {
    width: min(520px, 100%);
    padding: 8px;
    border-radius: 18px;
  }

  .auth-container.auth-flow .auth-panel {
    padding: 22px 20px 18px;
  }

  .auth-container.auth-flow .auth-panel-switch {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-container.auth-flow .auth-panel-switch-label {
    text-align: center;
  }

  .auth-container.auth-flow .auth-switch-cta {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .auth-container.auth-flow {
    padding: 6px;
    border-radius: 16px;
  }

  .auth-container.auth-flow .auth-panel {
    padding: 18px 16px 16px;
  }

  .auth-container.auth-flow .auth-panel-header h2 {
    font-size: 1.08rem;
  }

  .auth-container.auth-flow .auth-panel-header p {
    font-size: 0.8rem;
  }

  .auth-container.auth-flow .auth-panel form {
    gap: 12px;
  }
}
