/* =========================================================================
   auth.css — Login & Register pages (redesigned 2026)
   Depends on tokens.css for design tokens
   ========================================================================= */

/* ── Page grid ────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  min-height: 100dvh;  /* iOS Safari fix: dynamic viewport */
  display: grid;
  grid-template-columns: 1fr 1fr;
  font-family: var(--font-sans);
  background: var(--c-bg-1);
  color: var(--c-text-1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ═══════════════════════════════════════════════════════════════════════
   LEFT VISUAL PANEL
   ═══════════════════════════════════════════════════════════════════════ */
.auth-visual {
  position: relative;
  background: linear-gradient(160deg, #f8f8f8 0%, #f0f0f0 40%, #eaeaea 100%);
  color: #1a1a1a;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 52px 44px;
}

/* Subtle grid overlay */
.auth-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,0,0,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 60% 40%, #000 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 60% 40%, #000 20%, transparent 70%);
  pointer-events: none;
}

/* Primary accent glow — top left */
.auth-visual::after {
  content: "";
  position: absolute;
  top: -180px;
  left: -140px;
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, rgba(234,179,8,0.18) 0%, rgba(234,179,8,0.04) 40%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
  animation: authGlow1 8s ease-in-out infinite alternate;
}

@keyframes authGlow1 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, 20px) scale(1.08); }
}

/* Secondary glow — bottom right */
.auth-visual-glow-2 {
  position: absolute;
  bottom: -200px;
  right: -120px;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(234,179,8,0.14) 0%, rgba(200,200,200,0.06) 40%, transparent 70%);
  filter: blur(50px);
  pointer-events: none;
  animation: authGlow2 10s ease-in-out infinite alternate;
}

@keyframes authGlow2 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-20px, -30px) scale(1.06); }
}

/* Floating decorative ring */
.auth-visual-glow-2::before {
  content: "";
  position: absolute;
  top: 40%;
  right: 10%;
  width: 200px;
  height: 200px;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 50%;
  animation: authRing 20s linear infinite;
}

@keyframes authRing {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.auth-visual-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
  gap: 36px;
}

/* Logo */
.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: #111;
  transition: opacity var(--transition-fast);
}

.auth-logo:hover {
  opacity: 0.7;
}

.auth-logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--c-accent), #f59e0b);
  color: #0a0a0a;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

/* Hero text */
.auth-hero {
  max-width: 440px;
}

.auth-hero h2 {
  font-size: 34px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  color: #111;
}

.auth-hero p {
  font-size: 15px;
  line-height: 1.7;
  color: #444;
  margin: 0;
}

/* Stats bar */
.auth-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: #666;
  font-variant-numeric: tabular-nums;
}

.auth-stats-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.auth-stats-item strong {
  color: #111;
  font-weight: 600;
}

.auth-stats-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #bbb;
}

/* Testimonial card */
.auth-testimonial {
  position: relative;
  padding: 22px 24px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.auth-testimonial:hover {
  border-color: rgba(234,179,8,0.3);
  box-shadow: 0 2px 12px rgba(234,179,8,0.08);
}

.auth-testimonial-mark {
  color: var(--c-accent);
  font-size: 32px;
  line-height: 1;
  margin-bottom: 4px;
  font-family: Georgia, serif;
  opacity: 0.8;
}

.auth-testimonial p {
  font-size: 14px;
  line-height: 1.7;
  color: #333;
  margin: 0 0 14px;
  font-style: italic;
}

.auth-testimonial-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #666;
}

.auth-testimonial-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-accent), #f59e0b);
  color: #0a0a0a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.auth-testimonial-author {
  color: #333;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════
   RIGHT FORM PANEL
   ═══════════════════════════════════════════════════════════════════════ */
.auth-form-panel {
  background: var(--c-bg-1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  overflow-y: auto;
  position: relative;
}

/* Subtle top accent line */
.auth-form-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--c-accent) 50%, transparent 100%);
  opacity: 0.4;
}

.auth-form-wrap {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Back link */
.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--c-text-3);
  text-decoration: none;
  transition: color var(--transition-fast);
  align-self: flex-start;
}

.auth-back:hover {
  color: var(--c-accent);
}

/* Promo badge */
.auth-promo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(234,179,8,0.1), rgba(234,179,8,0.04));
  border: 1px solid rgba(234,179,8,0.2);
  border-radius: var(--radius-2);
  font-size: 13px;
  color: var(--c-text-1);
  font-weight: 500;
}

/* Header */
.auth-header h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--c-text-1);
  margin: 0 0 6px;
}

.auth-header p {
  font-size: 14px;
  color: var(--c-text-3);
  margin: 0;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════════════════════════════════ */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.auth-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text-2);
  letter-spacing: 0.01em;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1.5px solid var(--c-border-1);
  border-radius: var(--radius-2);
  font-size: 14px;
  font-family: inherit;
  background: var(--c-bg-1);
  color: var(--c-text-1);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.auth-input::placeholder {
  color: var(--c-text-4);
}

.auth-input:hover {
  border-color: var(--c-border-2);
}

.auth-input:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(234,179,8,0.12);
}

/* Input with icon */
.auth-input-wrap.has-icon .auth-input {
  padding-left: 42px;
}

.auth-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-text-4);
  width: 18px;
  height: 18px;
  pointer-events: none;
  transition: color var(--transition-fast);
}

.auth-input:focus ~ .auth-input-icon,
.auth-input-wrap:focus-within .auth-input-icon {
  color: var(--c-accent);
}

.auth-input.has-toggle {
  padding-right: 56px;
}

.auth-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: var(--c-text-4);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius-1);
  cursor: pointer;
  transition: color var(--transition-fast);
  font-family: inherit;
}

.auth-toggle:hover {
  color: var(--c-text-1);
}

/* Phone row */
.auth-phone-row {
  display: flex;
  gap: 8px;
}

.auth-phone-row .auth-input-wrap:first-child {
  flex: 0 0 110px;
}

.auth-phone-row .auth-input-wrap:first-child .auth-input {
  padding-right: 26px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%239ca3af' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.auth-phone-row .auth-input-wrap:last-child {
  flex: 1;
}

/* Password strength */
.auth-strength {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-strength-bars {
  display: flex;
  gap: 4px;
}

.auth-strength-bar {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--c-border-1);
  transition: background 0.2s ease;
}

.auth-strength-bar.is-weak   { background: #dc2626; }
.auth-strength-bar.is-medium { background: #d97706; }
.auth-strength-bar.is-ok     { background: #ca8a04; }
.auth-strength-bar.is-strong { background: #16a34a; }

.auth-strength-label {
  font-size: 12px;
  color: var(--c-text-4);
  display: flex;
  justify-content: space-between;
}

.auth-strength-label strong {
  font-weight: 600;
  color: var(--c-text-1);
}

.auth-strength-label strong.lvl-weak   { color: #dc2626; }
.auth-strength-label strong.lvl-medium { color: #d97706; }
.auth-strength-label strong.lvl-ok     { color: #ca8a04; }
.auth-strength-label strong.lvl-strong { color: #16a34a; }

/* Inline row */
.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--c-text-3);
  user-select: none;
  font-size: 13px;
  min-height: 44px;
}

.auth-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--c-border-2);
  border-radius: 4px;
  background: var(--c-bg-1);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.auth-check input[type="checkbox"]:checked {
  background: var(--c-accent);
  border-color: var(--c-accent);
}

.auth-check input[type="checkbox"]:checked::after {
  content: "";
  width: 4px;
  height: 8px;
  border: 2px solid #0a0a0a;
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

.auth-check input[type="checkbox"]:focus-visible {
  box-shadow: 0 0 0 3px rgba(234,179,8,0.2);
  outline: none;
}

.auth-link {
  color: var(--c-accent);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.auth-link:hover {
  color: var(--c-accent-strong);
}

.auth-terms {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--c-text-3);
  min-height: 44px;
}

.auth-terms input[type="checkbox"] {
  margin-top: 2px;
}

/* ── Submit button ───────────────────────────────────────────────────── */
.auth-submit {
  width: 100%;
  height: 46px;
  background: var(--c-accent);
  color: #0a0a0a;
  border: 0;
  border-radius: var(--radius-2);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.auth-submit::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent 50%);
  pointer-events: none;
}

.auth-submit:hover {
  background: var(--c-accent-strong);
  box-shadow: 0 4px 16px rgba(234,179,8,0.3);
  transform: translateY(-1px);
}

.auth-submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(234,179,8,0.3);
}

.auth-submit:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ── Divider ─────────────────────────────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--c-text-4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--c-border-1);
}

/* ── Social buttons ──────────────────────────────────────────────────── */
.auth-social {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.auth-social-btn {
  width: 52px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--c-bg-1);
  color: var(--c-text-1);
  border: 1.5px solid var(--c-border-1);
  border-radius: var(--radius-2);
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.auth-social-btn:hover {
  border-color: var(--c-border-2);
  background: var(--c-bg-2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-1);
}

.auth-social-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Wide variant (for register page) */
.auth-social--wide {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-social--wide .auth-social-btn {
  width: 100%;
  height: 42px;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
}

/* ── Reassurance ─────────────────────────────────────────────────────── */
.auth-reassure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: var(--c-text-4);
}

/* ── Footer text ─────────────────────────────────────────────────────── */
.auth-foot {
  text-align: center;
  font-size: 13px;
  color: var(--c-text-3);
}

.auth-foot .auth-link {
  margin-left: 4px;
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .auth-page {
    grid-template-columns: 1fr;
  }
  .auth-visual {
    display: none;
  }
  .auth-form-panel {
    padding: 32px 24px;
    min-height: 100vh;
  min-height: 100dvh;  /* iOS Safari fix: dynamic viewport */
  }
  .auth-form-panel::before {
    display: none;
  }
}

@media (max-width: 380px) {
  .auth-phone-row {
    flex-direction: column;
  }
  .auth-phone-row .auth-input-wrap:first-child {
    flex: 1;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   forgot-password.html minimal auth styles (standalone page)
   ═══════════════════════════════════════════════════════════════════════ */
.auth-body {
  margin: 0;
  background: linear-gradient(135deg, #fafafa 0%, #f3f4f6 100%);
  min-height: 100vh;
  min-height: 100dvh;  /* iOS Safari fix: dynamic viewport */
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  padding: 20px;
}

.auth-body .auth-card {
  max-width: 440px;
  width: 100%;
  background: #fff;
  border-radius: var(--radius-3);
  border: 1px solid var(--c-border-1);
  padding: 36px 32px;
  box-shadow: var(--shadow-3);
}

.auth-body .auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #0a0a0a;
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
  margin-bottom: 24px;
}

.auth-body .auth-logo-mark svg {
  width: 28px;
  height: 28px;
  display: block;
}

.auth-body h1 {
  font-size: 22px;
  margin: 0 0 8px;
  color: #0a0a0a;
}

.auth-sub {
  color: var(--c-text-3);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 24px;
}

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-label { font-size: 13px; color: var(--c-text-2); font-weight: 500; }

.auth-form input[type="email"],
.auth-form input[type="text"] {
  padding: 12px 14px;
  border: 1.5px solid var(--c-border-1);
  border-radius: var(--radius-2);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--transition-fast);
}

.auth-form input:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(234,179,8,0.12);
}

.auth-status {
  font-size: 13px;
  padding: 10px 12px;
  border-radius: var(--radius-2);
  min-height: 1px;
}

.auth-status:empty { padding: 0; }
.auth-status.ok  { background: rgba(22,163,74,0.08); color: #166534; }
.auth-status.err { background: rgba(220,38,38,0.08); color: #991b1b; }

.auth-submit {
  background: var(--c-accent);
  color: #0a0a0a;
  font-weight: 700;
  border: none;
  padding: 12px 16px;
  border-radius: var(--radius-2);
  font-size: 14px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.auth-submit:hover:not(:disabled) { background: var(--c-accent-strong); }
.auth-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-foot {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-top: 8px;
}

.auth-foot a { color: var(--c-text-3); text-decoration: none; }
.auth-foot a:hover { color: var(--c-accent); }

.auth-help {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px dashed var(--c-border-1);
}

.auth-help h3 { font-size: 13px; color: #0a0a0a; margin: 0 0 8px; }
.auth-help ul { margin: 0; padding-left: 20px; }
.auth-help li { font-size: 13px; color: var(--c-text-3); line-height: 1.8; }
.auth-help a { color: var(--c-accent); text-decoration: none; }
