/* ============================================================================
   Clid Auth — signup & login pages
   Matches the dark-premium ecosystem landing page (Inter, glass morphism,
   brand gradient #00e88a → #12c8b0 → #3b82f6, accent #00d97e, radius 12).
   ========================================================================== */

:root {
  --bg: #08090c;
  --bg-soft: #0e1014;
  --bg-card: rgba(255, 255, 255, 0.025);
  --bg-card-hover: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --fg: #f5f6f8;
  --fg-muted: #9aa3b0;
  --fg-dim: #6b7380;
  --accent: #00d97e;
  --accent-2: #00e88a;
  --accent-3: #12c8b0;
  --blue: #3b82f6;
  --warn: #ff5b6b;
  --warn-soft: rgba(255, 91, 107, 0.12);
  --ok: #00d97e;
  --ok-soft: rgba(0, 217, 126, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --brand-gradient: linear-gradient(120deg, #00e88a 0%, #12c8b0 45%, #3b82f6 100%);
  --brand-gradient-soft: linear-gradient(120deg, rgba(0, 232, 138, 0.18) 0%, rgba(18, 200, 176, 0.14) 45%, rgba(59, 130, 246, 0.18) 100%);
  --shadow-card: 0 30px 70px -30px rgba(0, 0, 0, 0.6), 0 8px 24px -12px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px -8px rgba(0, 217, 126, 0.35);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: var(--accent-2); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--accent); }

/* ─── Aurora + grid backdrop ───────────────────────────────────────────── */
.clid-auth-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.clid-auth-bg::before {
  content: '';
  position: absolute; inset: -10%;
  background:
    radial-gradient(45% 55% at 18% 30%, rgba(0, 232, 138, 0.16), transparent 60%),
    radial-gradient(50% 50% at 85% 75%, rgba(59, 130, 246, 0.18), transparent 65%),
    radial-gradient(40% 60% at 70% 18%, rgba(18, 200, 176, 0.10), transparent 70%);
  filter: blur(20px);
  animation: aurora-drift 22s ease-in-out infinite alternate;
}
.clid-auth-bg::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 40%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 40%, black 30%, transparent 80%);
}
@keyframes aurora-drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(2%, -2%, 0) scale(1.05); }
  100% { transform: translate3d(-2%, 1%, 0) scale(0.98); }
}

/* ─── Top bar (compact) ───────────────────────────────────────────────── */
.clid-auth-topbar {
  position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 36px;
  max-width: 1280px; margin: 0 auto;
}
.clid-auth-topbar-brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--fg); font-weight: 700; font-size: 17px; letter-spacing: -0.02em;
}
.clid-auth-topbar-brand img { width: 28px; height: 28px; }
.clid-auth-topbar-brand span {
  background: var(--brand-gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.clid-auth-topbar-back {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--fg-muted); font-size: 13.5px; font-weight: 500;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: all 0.2s var(--ease);
}
.clid-auth-topbar-back:hover {
  color: var(--fg); border-color: var(--border-strong);
  background: var(--bg-card-hover);
}

/* ─── Layout: split-screen on desktop ─────────────────────────────────── */
.clid-auth-shell {
  position: relative; z-index: 2;
  max-width: 1180px; margin: 0 auto;
  padding: 24px 36px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 56px;
  align-items: center;
  min-height: calc(100vh - 80px);
}

/* ─── Left side: brand storytelling panel ─────────────────────────────── */
.clid-auth-aside {
  position: relative;
  padding: 20px 0;
}
.clid-auth-aside-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent-2);
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--ok-soft);
  border: 1px solid rgba(0, 217, 126, 0.22);
}
.clid-auth-aside-eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px var(--accent);
  animation: pulse-dot 2.2s var(--ease) infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.6; transform: scale(1.4); }
}
.clid-auth-aside h1 {
  font-size: clamp(32px, 4.2vw, 46px);
  line-height: 1.06; letter-spacing: -0.03em;
  font-weight: 800;
  margin: 18px 0 16px;
}
.clid-auth-aside h1 .grad {
  background: var(--brand-gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.clid-auth-aside p.lead {
  font-size: 16px; line-height: 1.6;
  color: var(--fg-muted);
  max-width: 460px;
  margin-bottom: 28px;
}

.clid-auth-perks {
  list-style: none;
  display: grid; gap: 14px;
  margin-top: 8px;
}
.clid-auth-perks li {
  display: grid; grid-template-columns: 32px 1fr; gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all 0.25s var(--ease);
}
.clid-auth-perks li:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  transform: translateX(2px);
}
.clid-auth-perks .perk-icon {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px;
  background: var(--brand-gradient-soft);
  color: var(--accent-2);
  border: 1px solid rgba(0, 232, 138, 0.18);
}
.clid-auth-perks .perk-body strong {
  display: block; font-size: 14px; font-weight: 600; color: var(--fg);
  margin-bottom: 2px;
}
.clid-auth-perks .perk-body span {
  font-size: 13px; color: var(--fg-muted); line-height: 1.45;
}

/* ─── Right side: the auth card ───────────────────────────────────────── */
.clid-auth-card-wrap {
  position: relative;
}
.clid-auth-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0.015) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 36px 28px;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.clid-auth-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 232, 138, 0.5), transparent);
}

.clid-auth-card-head {
  text-align: center;
  margin-bottom: 26px;
}
.clid-auth-card-head h2 {
  font-size: 24px; font-weight: 700; letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.clid-auth-card-head p {
  font-size: 14px; color: var(--fg-muted);
}

/* ─── Mode tabs (Password | Magic link | Magic code) ─────────────────── */
.clid-auth-modes {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-bottom: 22px;
}
.clid-auth-mode {
  appearance: none; border: 0; background: transparent;
  padding: 9px 12px; border-radius: 999px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--fg-muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: all 0.22s var(--ease);
}
.clid-auth-mode i { font-size: 12px; }
.clid-auth-mode:hover { color: var(--fg); }
.clid-auth-mode.is-active {
  background: var(--brand-gradient-soft);
  color: var(--fg);
  border: 1px solid rgba(0, 232, 138, 0.25);
  box-shadow: 0 4px 14px -6px rgba(0, 217, 126, 0.4);
}

/* ─── Google OAuth button (always on top) ─────────────────────────────── */
.clid-auth-google {
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 18px;
  background: #fff;
  color: #1f2937;
  border: 1px solid #fff;
  border-radius: var(--radius);
  font-family: inherit; font-size: 14.5px; font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.clid-auth-google:hover {
  background: #f8fafc; transform: translateY(-1px);
  box-shadow: 0 10px 22px -10px rgba(255, 255, 255, 0.25);
}
.clid-auth-google:active { transform: translateY(0); }
.clid-auth-google svg { width: 18px; height: 18px; }

.clid-auth-divider {
  display: flex; align-items: center; gap: 14px;
  margin: 20px 0;
  color: var(--fg-dim); font-size: 12px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.1em;
}
.clid-auth-divider::before, .clid-auth-divider::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}

/* ─── Form fields ─────────────────────────────────────────────────────── */
.clid-auth-form {
  display: grid; gap: 14px;
}
.clid-auth-form.is-hidden { display: none; }

.clid-field {
  display: grid; gap: 6px;
}
.clid-field-label {
  font-size: 12.5px; font-weight: 600; color: var(--fg-muted);
  letter-spacing: 0.005em;
}
.clid-field-control {
  position: relative;
  display: flex; align-items: center;
}
.clid-field-control i.lead {
  position: absolute; left: 14px;
  font-size: 13px; color: var(--fg-dim);
  pointer-events: none;
  transition: color 0.2s var(--ease);
}
.clid-field-input {
  width: 100%;
  padding: 14px 18px 14px 44px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  border-radius: 999px;  /* pill-shaped */
  color: var(--fg);
  font-family: inherit; font-size: 14.5px;
  transition: all 0.18s var(--ease);
  outline: none;
}
.clid-field-input::placeholder { color: var(--fg-dim); }
.clid-field-input:focus {
  border-color: rgba(0, 217, 126, 0.5);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 4px rgba(0, 217, 126, 0.12);
}
.clid-field-input:focus + i.lead,
.clid-field-control:focus-within i.lead { color: var(--accent-2); left: 18px; }

.clid-field-input.no-icon { padding-left: 18px; }
.clid-field-control i.lead { left: 18px; }

.clid-field-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; cursor: pointer;
  width: 30px; height: 30px; border-radius: 8px;
  color: var(--fg-dim);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.18s var(--ease);
}
.clid-field-toggle:hover { color: var(--fg); background: rgba(255, 255, 255, 0.05); }

.clid-field-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}

/* ─── OTP / magic-code input row ──────────────────────────────────────── */
.clid-otp-row {
  display: flex; gap: 8px; justify-content: center;
  margin: 4px 0 8px;
}
.clid-otp-input {
  width: 48px; height: 56px;
  text-align: center;
  font-size: 22px; font-weight: 600;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-family: inherit;
  outline: none;
  transition: all 0.18s var(--ease);
}
.clid-otp-input:focus {
  border-color: rgba(0, 217, 126, 0.5);
  background: rgba(0, 0, 0, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 217, 126, 0.12);
  transform: translateY(-1px);
}
.clid-otp-input.filled { border-color: rgba(0, 217, 126, 0.35); }

/* ─── Submit button ───────────────────────────────────────────────────── */
.clid-auth-submit {
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 14px 18px;
  background: var(--brand-gradient);
  color: #04140d;
  border: 0;
  border-radius: 999px;  /* pill-shaped to match inputs */
  font-family: inherit; font-size: 14.5px; font-weight: 700;
  cursor: pointer;
  letter-spacing: -0.005em;
  transition: all 0.22s var(--ease);
  box-shadow: 0 12px 28px -10px rgba(0, 217, 126, 0.5);
  position: relative; overflow: hidden;
  margin-top: 4px;
}
.clid-auth-submit::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 0.6s var(--ease);
}
.clid-auth-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px -12px rgba(0, 217, 126, 0.6);
}
.clid-auth-submit:hover:not(:disabled)::before { transform: translateX(100%); }
.clid-auth-submit:active:not(:disabled) { transform: translateY(0); }
.clid-auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.clid-auth-submit .spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(0, 0, 0, 0.25);
  border-top-color: #04140d;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Fineprint + secondary actions ───────────────────────────────────── */
.clid-auth-fineprint {
  font-size: 12px; line-height: 1.55;
  color: var(--fg-dim);
  text-align: center;
  margin-top: 14px;
}
.clid-auth-fineprint a { color: var(--fg-muted); text-decoration: underline; text-underline-offset: 2px; }
.clid-auth-fineprint a:hover { color: var(--fg); }

.clid-auth-switch {
  text-align: center;
  font-size: 13.5px; color: var(--fg-muted);
  margin-top: 18px; padding-top: 18px;
  border-top: 1px solid var(--border);
}
.clid-auth-switch a { font-weight: 600; }

/* ─── Inline alerts (error / success / info) ──────────────────────────── */
.clid-auth-alert {
  display: none;
  align-items: flex-start; gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.5;
  margin-bottom: 14px;
  border: 1px solid;
  animation: alert-in 0.3s var(--ease);
}
@keyframes alert-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.clid-auth-alert.is-visible { display: flex; }
.clid-auth-alert i { font-size: 14px; margin-top: 1px; flex-shrink: 0; }
.clid-auth-alert.is-error   { background: var(--warn-soft); border-color: rgba(255, 91, 107, 0.32); color: #ffb3bb; }
.clid-auth-alert.is-error i   { color: var(--warn); }
.clid-auth-alert.is-success { background: var(--ok-soft); border-color: rgba(0, 217, 126, 0.32); color: #9ee9c4; }
.clid-auth-alert.is-success i { color: var(--ok); }
.clid-auth-alert.is-info    { background: rgba(59, 130, 246, 0.10); border-color: rgba(59, 130, 246, 0.32); color: #a7c4f5; }
.clid-auth-alert.is-info i    { color: var(--blue); }

/* ─── Resend / secondary link inside the form ─────────────────────────── */
.clid-auth-secondary {
  margin-top: 6px;
  text-align: center;
  font-size: 13px;
  color: var(--fg-muted);
}
.clid-auth-secondary button {
  background: none; border: 0; cursor: pointer;
  font-family: inherit; font-size: inherit;
  color: var(--accent-2); font-weight: 600;
  text-decoration: underline; text-underline-offset: 2px;
}
.clid-auth-secondary button:disabled { color: var(--fg-dim); cursor: not-allowed; text-decoration: none; }

/* ─── Success state (post-signup) ─────────────────────────────────────── */
.clid-auth-success {
  display: none;
  text-align: center;
  padding: 20px 8px;
}
.clid-auth-success.is-visible { display: block; animation: alert-in 0.4s var(--ease); }
.clid-auth-success-icon {
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 28px;
  background: var(--brand-gradient-soft);
  color: var(--accent-2);
  border: 1px solid rgba(0, 217, 126, 0.32);
  box-shadow: var(--shadow-glow);
}
.clid-auth-success h3 {
  font-size: 19px; font-weight: 700; margin-bottom: 6px;
}
.clid-auth-success p {
  font-size: 14px; color: var(--fg-muted);
  max-width: 320px; margin: 0 auto;
}
.clid-auth-success .clid-auth-success-actions {
  margin-top: 18px;
  display: inline-flex; gap: 10px;
}
.clid-auth-success .clid-btn-primary,
.clid-auth-success .clid-btn-ghost {
  padding: 9px 16px; border-radius: 10px;
  font-size: 13.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 7px;
  cursor: pointer; border: 0; font-family: inherit;
  transition: all 0.2s var(--ease);
}
.clid-auth-success .clid-btn-primary {
  background: var(--brand-gradient); color: #04140d;
}
.clid-auth-success .clid-btn-ghost {
  background: var(--bg-card); color: var(--fg);
  border: 1px solid var(--border);
}
.clid-auth-success .clid-btn-ghost:hover { background: var(--bg-card-hover); border-color: var(--border-strong); }

/* ─── Mobile ──────────────────────────────────────────────────────────── */
@media (max-width: 880px) {
  .clid-auth-topbar { padding: 18px 22px; }
  .clid-auth-shell {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 12px 22px 60px;
    min-height: auto;
  }
  .clid-auth-aside { padding: 12px 0 0; order: 2; }
  .clid-auth-aside h1 { font-size: 30px; }
  .clid-auth-aside p.lead { font-size: 15px; }
  .clid-auth-perks { grid-template-columns: 1fr; gap: 10px; }
  .clid-auth-card { padding: 28px 22px 22px; }
  .clid-auth-card-head h2 { font-size: 22px; }
  .clid-auth-modes { grid-template-columns: 1fr; }
  .clid-auth-mode { justify-content: flex-start; padding: 11px 16px; }
  .clid-field-row { grid-template-columns: 1fr; }
  .clid-otp-input { width: 42px; height: 50px; font-size: 19px; }
}

@media (max-width: 480px) {
  .clid-auth-topbar { padding: 14px 16px; }
  .clid-auth-topbar-back span { display: none; }
  .clid-auth-shell { padding: 8px 16px 50px; }
  .clid-auth-card { padding: 22px 18px 18px; border-radius: 18px; }
  .clid-auth-aside h1 { font-size: 26px; }
  .clid-otp-input { width: 38px; height: 46px; font-size: 17px; }
  .clid-otp-row { gap: 6px; }
}
