/* ============================================================================
   CryptoGate — Auth (sign up / login)  ·  "Quiet Luxury" rebuild
   Apple, not crypto. Ink + white + grey is 90%; the blue→purple gradient is
   punctuation only. Left = premium brand/marketing surface (ink, aurora, a live
   payment product card). Right = a clean, frictionless form. Light + dark.
   JS hooks (#signup/#login/.form.active/.tab/.input-group/...) are preserved.
   ============================================================================ */

:root {
  --primary-color: #2563eb;
  --secondary-color: #7c3aed;
  --purple: #8b5cf6;
  --grad: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);

  --text-dark: #0f172a;
  --text-medium: #334155;
  --text-light: #64748b;
  --text-white: #ffffff;

  --bg-white: #ffffff;
  --bg-light: #f8fafc;

  --hairline: #e9ecf2;
  --border-color: #e2e8f0;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(13, 18, 34, 0.07);

  --error-color: #ef4444;
  --success-color: #16a34a;

  --shadow-sm: 0 1px 2px 0 rgba(20, 27, 56, 0.05);
  --shadow-md: 0 10px 30px -12px rgba(20, 27, 56, 0.12), 0 2px 8px -4px rgba(20, 27, 56, 0.07);
  --shadow-lg: 0 24px 50px -20px rgba(20, 27, 56, 0.18), 0 8px 20px -12px rgba(20, 27, 56, 0.1);
  --ink-shadow: 0 40px 80px -28px rgba(15, 23, 42, 0.45), 0 12px 30px -16px rgba(15, 23, 42, 0.3);

  --radius-md: 0.875rem;
  --radius-lg: 1.25rem;
  --radius-full: 9999px;
  --btn-radius: 12px;

  --ink: #0b1120;          /* the premium left surface */
  --ink-soft: #111a2e;
  --container-width: 1080px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
}

html.dark-mode {
  --primary-color: #3b82f6;
  --secondary-color: #8b5cf6;
  --text-dark: #e6edf7;
  --text-medium: #c3cdde;
  --text-light: #8b97ad;
  --bg-white: #161d2e;     /* form surface in dark */
  --bg-light: #0c111d;     /* page canvas in dark */
  --hairline: rgba(255, 255, 255, 0.09);
  --border-color: rgba(255, 255, 255, 0.12);
  --glass: rgba(22, 28, 44, 0.6);
  --glass-border: rgba(255, 255, 255, 0.09);
  --ink: #080d18;
  --ink-soft: #0e1626;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html { transition: background-color 0.3s ease; }

body {
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-osx-font-smoothing: grayscale;
  background-color: var(--bg-light);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

.grad {
  background-image: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ----------------------------------------------------------------------------
   The card shell
   ---------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-width);
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  background: var(--bg-white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--ink-shadow);
  overflow: hidden;
  position: relative;
}

/* ============================================================================
   LEFT — premium brand / marketing surface (ink + aurora + product card)
   ============================================================================ */
.left-panel {
  position: relative;
  background: var(--ink);
  color: #e8edf7;
  padding: 3.25rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  overflow: hidden;
  isolation: isolate;
}

/* aurora — the single futuristic flourish, very soft */
.left-panel::before,
.left-panel::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  z-index: -1;
  pointer-events: none;
}
.left-panel::before {
  width: 460px; height: 460px;
  top: -160px; left: -120px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.55), transparent 70%);
}
.left-panel::after {
  width: 420px; height: 420px;
  bottom: -160px; right: -120px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.5), transparent 70%);
}

.logo-container { display: inline-flex; }
.left-panel .lp-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.15rem;
}
.left-panel .logo { width: 38px; height: 38px; object-fit: contain; }

.hero-content { display: flex; flex-direction: column; gap: 1.25rem; margin-top: auto; }

.lp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  align-self: flex-start;
  padding: 6px 13px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.78rem;
  font-weight: 600;
  color: #c9d4e8;
}
.lp-eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--grad);
}

.hero-content h1 {
  font-size: clamp(1.9rem, 2.6vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 700;
  color: #fff;
}
.hero-content > p {
  font-size: 1rem;
  line-height: 1.6;
  color: #aab6cd;
  max-width: 34ch;
}

/* live payment product card (the signature mock) */
.lp-card {
  position: relative;
  margin-top: 0.5rem;
  background: var(--glass);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.6);
  animation: lpFloat 7s ease-in-out infinite;
}
.lp-card-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.7rem;
}
.lp-live {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.72rem; font-weight: 600; color: #c9d4e8;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.lp-live .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #34d399; box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: lpPulse 2.2s infinite;
}
.lp-coin {
  font-size: 0.72rem; font-weight: 700; color: #e8edf7;
  background: rgba(255, 255, 255, 0.08); padding: 3px 9px; border-radius: var(--radius-full);
}
.lp-amount { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; color: #fff; }
.lp-fiat { font-size: 0.85rem; color: #9fabc4; margin-top: 2px; }
.lp-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 0.9rem; padding-top: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.82rem; color: #aab6cd;
}
.lp-check { display: inline-flex; align-items: center; gap: 0.35rem; color: #34d399; font-weight: 600; }

/* quiet trust points */
.features { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 0.25rem; }
.feature {
  display: flex; align-items: center; gap: 0.7rem;
  font-size: 0.9rem; color: #c3cdde;
}
.feature i {
  width: 26px; height: 26px; flex: none;
  display: grid; place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.22), rgba(139, 92, 246, 0.22));
  color: #cdd8ec; font-size: 0.78rem;
}

@keyframes lpFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes lpPulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* ============================================================================
   RIGHT — the form surface
   ============================================================================ */
.right-panel {
  background: var(--bg-white);
  padding: 3rem 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  max-height: 92vh;
  overflow-y: auto;
}

/* segmented tab control */
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--bg-light);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-full);
  margin-bottom: 2rem;
}
.tab {
  text-align: center;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.tab.active {
  background: var(--bg-white);
  color: var(--text-dark);
  box-shadow: var(--shadow-sm);
}
html.dark-mode .tab.active { background: rgba(255, 255, 255, 0.08); }

.form-container { position: relative; }
.form { display: none; animation: formIn 0.35s ease; }
.form.active { display: block; }
@keyframes formIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.form h2 {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-dark);
  line-height: 1.1;
}
.subtitle {
  margin-top: 0.4rem;
  margin-bottom: 1.6rem;
  font-size: 0.92rem;
  color: var(--text-light);
}

/* fields */
.form-group { margin-bottom: 1.05rem; }
.form-group > label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-medium);
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
html.dark-mode .input-group { background: #1b2334; }
.input-group:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
}
.input-group > i:first-child {
  position: absolute;
  left: 0.95rem;
  color: var(--text-light);
  font-size: 0.9rem;
  pointer-events: none;
}
.input-group input {
  flex: 1;
  width: 100%;
  border: none;
  background: transparent;
  padding: 0.85rem 1rem 0.85rem 2.65rem;
  font-size: 0.95rem;
  font-family: var(--font);
  color: var(--text-dark);
  border-radius: var(--radius-md);
}
.input-group input::placeholder { color: var(--text-light); opacity: 0.8; }
.input-group input:focus { outline: none; }
.input-group input:-webkit-autofill {
  -webkit-text-fill-color: var(--text-dark);
  -webkit-box-shadow: 0 0 0 1000px var(--bg-white) inset;
  transition: background-color 9999s ease-in-out 0s;
}

.toggle-password {
  position: absolute;
  right: 0.95rem;
  color: var(--text-light);
  cursor: pointer;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}
.toggle-password:hover { color: var(--text-dark); }

/* password strength */
.password-strength { margin-top: 0.6rem; }
.strength-meter { display: flex; gap: 6px; margin-bottom: 0.35rem; }
.strength-segment {
  height: 4px;
  flex: 1;
  border-radius: var(--radius-full);
  background: var(--hairline);
  transition: background 0.25s ease;
}
.strength-segment.weak { background: var(--error-color); }
.strength-segment.medium { background: #f59e0b; }
.strength-segment.strong { background: var(--success-color); }
.strength-text { font-size: 0.76rem; color: var(--text-light); }

/* terms + remember/forgot */
.terms, .remember-me {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.84rem;
  color: var(--text-medium);
}
.terms { margin: 0.3rem 0 1.25rem; }
.terms input[type="checkbox"],
.remember-me input[type="checkbox"] {
  width: 16px; height: 16px;
  margin-top: 1px;
  accent-color: var(--primary-color);
  cursor: pointer;
  flex: none;
}
.terms a, .forgot-password { color: var(--primary-color); font-weight: 500; }
.terms a:hover, .forgot-password:hover { text-decoration: underline; }

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.85rem;
  flex-wrap: wrap;
}
.forgot-password { font-size: 0.84rem; }

/* buttons */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.9rem 1.4rem;
  border-radius: var(--btn-radius);
  font-size: 0.96rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.25s ease, background 0.2s ease;
}
.btn-primary {
  background-image: var(--grad);
  color: #fff;
  box-shadow: 0 12px 30px -10px rgba(99, 102, 241, 0.55);
  margin-top: 0.4rem;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -10px rgba(99, 102, 241, 0.65); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: transparent;
  color: var(--text-dark);
  border-color: var(--border-color);
}
.btn-secondary:hover { border-color: var(--text-light); transform: translateY(-1px); }

/* fixed utilities: theme toggle + lang switch live over the card */
.theme-toggle { position: fixed; top: 18px; right: 18px; z-index: 1000; }
.theme-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-label {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 54px; height: 28px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--bg-white);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  position: relative;
}
.toggle-label i { font-size: 0.72rem; color: var(--text-light); z-index: 1; }
.toggle-ball {
  position: absolute;
  top: 50%; left: 3px;
  transform: translateY(-50%);
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--grad);
  transition: transform 0.25s ease;
}
#theme-switch:checked + .toggle-label .toggle-ball { transform: translate(26px, -50%); }

/* ----------------------------------------------------------------------------
   Device-fingerprint loading overlay
   ---------------------------------------------------------------------------- */
.fingerprint-loading {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--bg-light) 86%, transparent);
  backdrop-filter: blur(8px);
}
.fingerprint-loading.hidden { display: none; }
.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  padding: 2rem 2.5rem;
  background: var(--bg-white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.loading-content i { font-size: 1.6rem; background-image: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.loading-text { font-size: 0.92rem; color: var(--text-medium); font-weight: 500; }
.loading-spinner {
  width: 26px; height: 26px;
  border: 3px solid var(--hairline);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------------------------------------------------------
   Email-verification + security notices + plan-intent banner (JS-shown)
   ---------------------------------------------------------------------------- */
.plan-intent-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radius-md);
  background: var(--bg-light);
  border: 1px solid var(--hairline);
  font-size: 0.85rem;
  color: var(--text-medium);
}

.verification-modal {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: color-mix(in srgb, var(--ink) 55%, transparent);
  backdrop-filter: blur(8px);
}
.verification-modal.hidden, .email-verification-notice.hidden, .security-notice.hidden { display: none; }
.verification-notice, .email-verification-notice, .security-notice {
  background: var(--bg-white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  max-width: 440px;
  width: 100%;
}
.notice-content { display: flex; flex-direction: column; gap: 0.6rem; }
.notice-content h3 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text-dark); }
.notice-content p { font-size: 0.9rem; line-height: 1.6; color: var(--text-medium); }
.notice-actions { display: flex; gap: 0.7rem; margin-top: 1rem; flex-wrap: wrap; }
.notice-actions .btn-primary, .notice-actions .btn-secondary { width: auto; }
.verification-form { display: flex; flex-direction: column; gap: 0.9rem; margin-top: 1rem; }

/* 2FA / device-verification modal (JS-injected by login-main.js:
   .modal-content > .modal-header + .modal-body > .code-inputs > .code-input) */
.verification-modal .modal-content {
  width: min(420px, 94vw);
  background: var(--bg-white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: formIn 0.25s ease;
}
.verification-modal .modal-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1.35rem 1.4rem 0.25rem;
}
.verification-modal .modal-header i {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
  background-image: linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(139, 92, 246, 0.14));
  color: var(--primary-color);
  font-size: 1rem;
}
.verification-modal .modal-header h3 {
  font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text-dark);
}
.verification-modal .modal-close {
  position: absolute; top: 0.7rem; right: 0.8rem;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: none; background: transparent;
  border-radius: var(--radius-full);
  color: var(--text-light); font-size: 1.4rem; line-height: 1; cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.verification-modal .modal-close:hover { background: var(--bg-light); color: var(--text-dark); }
.verification-modal .modal-body { padding: 0.9rem 1.4rem 1.5rem; }
.verification-modal .modal-body > p:first-child {
  font-size: 0.9rem; color: var(--text-medium); line-height: 1.5; margin-bottom: 1.1rem;
}

.code-inputs { display: flex; gap: 0.5rem; justify-content: center; margin-bottom: 0.4rem; }
.code-input {
  width: 46px; height: 54px;
  text-align: center;
  font-size: 1.4rem; font-weight: 600;
  font-family: var(--font);
  color: var(--text-dark);
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
html.dark-mode .code-input { background: #1b2334; }
.code-input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14); }

.form-input {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 0.95rem; font-family: var(--font);
  color: var(--text-dark);
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
html.dark-mode .form-input { background: #1b2334; }
.form-input::placeholder { color: var(--text-light); }
.form-input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14); }

.verification-modal .verification-form .btn-primary,
.verification-modal .verification-form .btn { width: 100%; margin-top: 0.4rem; }
.verification-modal .help-text { margin-top: 0.9rem; font-size: 0.82rem; color: var(--text-light); text-align: center; }
.verification-modal .help-text a { color: var(--primary-color); font-weight: 500; }
.verification-modal .help-text a:hover { text-decoration: underline; }

/* ----------------------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------------------- */
@media (max-width: 900px) {
  body { padding: 0; align-items: stretch; }
  .container {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin: 0 auto;
    border: none;
    border-radius: 0;
    box-shadow: none;
    min-height: 100vh;
  }
  /* condense the brand panel into a slim header band */
  .left-panel {
    padding: 2rem 1.75rem;
    gap: 1rem;
  }
  .left-panel .lp-card, .left-panel .features { display: none; }
  .hero-content { margin-top: 0; gap: 0.75rem; }
  .hero-content h1 { font-size: 1.5rem; }
  .hero-content > p { font-size: 0.92rem; max-width: none; }
  .right-panel { padding: 2rem 1.75rem 2.5rem; max-height: none; }
}

@media (max-width: 480px) {
  .left-panel { padding: 1.6rem 1.4rem; }
  .right-panel { padding: 1.75rem 1.4rem 2.25rem; }
  .form h2 { font-size: 1.45rem; }
  .login-options { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .lp-card { animation: none; }
  .lp-live .dot { animation: none; }
  .form { animation: none; }
}

@media (prefers-contrast: high) {
  .input-group { border-width: 2px; }
  .tab.active { outline: 1px solid var(--text-dark); }
}
