@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --bg: #eaf3ff;
  --panel: #ffffff;
  --border: #dbe6ff;
  --text: #0d1c3b;
  --muted: #4e617d;
  --brand: #2563eb;
  --brand-2: #ff8a4c;
  --danger: #ef4444;
  --ok: #22c55e;
  --warn: #f59e0b;
  --shadow: 0 18px 50px rgba(13, 28, 59, 0.16);
  --radius: 22px;
  --footer-safe-area: 80px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: "Space Grotesk","Sora","Segoe UI",Roboto,Arial,sans-serif;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.12), transparent 32%),
    radial-gradient(circle at 80% 8%, rgba(255, 138, 76, 0.16), transparent 28%),
    radial-gradient(circle at 55% 82%, rgba(13, 28, 59, 0.10), transparent 45%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
}

.site-header {
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(13,28,59,0.08);
  color: var(--text);
  padding: clamp(10px, 3vw, 14px) clamp(14px, 4vw, 18px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  box-shadow: 0 8px 24px rgba(13,28,59,0.08);
  z-index: 5;
  flex-wrap: wrap;
}

.site-header .logo {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.site-header .logo .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg,var(--brand),#9bf9ff);
  box-shadow: 0 0 0 4px rgba(37,99,235,0.12);
}

.site-nav {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  margin-left: auto; /* push nav to right edge */
}

.site-nav a {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  opacity: 0.8;
}

.site-nav a:hover {
  opacity: 1;
  color: var(--brand);
}

.auth-session {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 18px;
  flex-wrap: wrap;
}

main {
  flex: 1;
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 24px) clamp(16px, 5vw, 28px) clamp(32px, 7vh, 40px);
  /* Removed extra padding for footer-safe-area from main, as it's handled by .auth */
}

.grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 16px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 24px);
  box-shadow: var(--shadow);
}

.card--compact {
  padding: 18px;
}

.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.muted {
  color: var(--muted);
}

.danger {
  color: var(--danger);
}

.success {
  color: var(--ok);
}

.notice {
  background: rgba(37,99,235,0.08);
  border: 1px solid rgba(37,99,235,0.16);
  color: var(--text);
  padding: 10px;
  border-radius: 10px;
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: #eef3ff;
  color: var(--text);
}

.badge.paid {
  background: rgba(34,197,94,0.12);
  border-color: rgba(34,197,94,0.22);
  color: #15803d;
}

.badge.free {
  background: rgba(148,163,184,0.12);
  border-color: rgba(148,163,184,0.22);
  color: #475569;
}

.plan-note {
  margin: 14px 0 0;
  padding: 16px 18px;
  border-radius: 16px;
  background: #f5f7ff;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 12px 30px rgba(13,28,59,0.08);
}

.plan-note strong {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}

.plan-note--stacked {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.billing-note {
  margin-top: 12px;
  padding: 18px 20px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(244, 196, 48, 0.25), rgba(255, 138, 76, 0.18)), #fffdfa;
  border: 1px solid rgba(244, 196, 48, 0.4);
  box-shadow: 0 20px 40px rgba(244, 196, 48, 0.25);
  display: flex;
  gap: 14px;
  align-items: center;
}

.billing-note__icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #fff4cf;
  border: 1px solid rgba(244, 196, 48, 0.6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #8a5b00;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.8);
}

.billing-note__title {
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
  color: #8a5b00;
}

.billing-note__text {
  margin: 4px 0 0 0;
  color: #5f3c00;
  line-height: 1.4;
}

.price-highlight {
  display: inline-flex;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(37,99,235,0.12);
  color: var(--brand);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(37,99,235,0.35);
}

.progress {
  height: 10px;
  background: #eef3ff;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress .bar {
  height: 100%;
  background: linear-gradient(90deg,var(--brand),var(--brand-2));
}

input,
button,
textarea {
  font-size: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f5f7ff;
  color: var(--text);
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

input:focus,
textarea:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.18);
  background: #fff;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 0.85;
}

button {
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  transition: background 0.2s, box-shadow 0.2s;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.primary {
  background: linear-gradient(135deg,var(--brand),#1d4ed8);
  color: #fff;
  box-shadow: 0 10px 30px rgba(37,99,235,0.25);
}

.secondary {
  background: #eef3ff;
  color: var(--text);
  border-color: var(--border);
}

.btn {
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: #f5f7ff;
  gap: 8px;
  font-weight: 600;
}

.btn.primary {
  border: none;
  color: #fff;
  background: linear-gradient(135deg,var(--brand),#1d4ed8);
}

.btn.primary:disabled {
  background: #cbd8ff;
  color: #6b7280;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.auth {
  min-height: auto;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 18px) clamp(12px, 4vw, 20px); /* More compact padding */
  background: radial-gradient(circle at 14% 22%, rgba(37,99,235,0.14), transparent 34%), var(--bg);
  width: 100%;
}

.auth .card {
  width: 100%;
  max-width: 520px;
}

.auth .row {
  width: 100%;
  justify-content: center;
}

.auth form .row:last-child {
  justify-content: space-between;
}

.auth h2 {
  margin: 0 0 6px 0;
  font-size: 26px;
}

.auth-field {
  margin-bottom: 18px;
}

.auth-field label {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.auth-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.auth-footer-link {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.auth-footer-link a {
  font-weight: 700;
}

.auth-grid {
  display: grid;
  width: 100%;
  max-width: 980px;
  gap: 18px; /* Reduced gap */
  grid-template-columns: minmax(320px,1fr) minmax(320px,1fr);
  align-items: stretch;
  margin-top: clamp(8px, 3vw, 20px); /* Reduced margin-top */
}

.auth-hero {
  background: linear-gradient(145deg, rgba(37,99,235,0.12), rgba(255,138,76,0.10)), #f7faff;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px 22px 28px 22px; /* Reduced padding */
  color: var(--text);
  box-shadow: var(--shadow);
}

.auth-hero ul {
  list-style: none;
  margin: 14px 0 0 0; /* Reduced margin */
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px; /* Reduced gap */
}

.auth-hero li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 10px 24px rgba(13,28,59,0.08);
}

.auth-hero li .feature-dot {
  display: inline-flex;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg,var(--brand),var(--brand-2));
  box-shadow: 0 0 0 4px rgba(37,99,235,0.14), 0 10px 24px rgba(13,28,59,0.18);
  border: 2px solid #fff;
  flex-shrink: 0;
}

.auth-card {
  padding: clamp(20px, 3vw, 28px) clamp(18px, 3vw, 26px); /* Reduced padding */
  border-radius: 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  background: #fff;
}

.auth-card h2 {
  font-size: 24px;
  margin: 0 0 6px 0;
  text-align: left;
  color: var(--text);
}

.auth-card p.subtitle {
  color: var(--muted);
  margin: 0 0 24px 0;
  font-size: 14px;
}

.footer-meta {
  border-top: 1px solid var(--border);
  padding: 14px 18px;
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  position: sticky;
  bottom: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  box-shadow: 0 -12px 28px rgba(13, 28, 59, 0.14);
  z-index: 6;
}

.terms-box {
  margin-top: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.checkbox-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.checkbox-row input {
  width: auto;
}

.helper-text {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.message {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
}

.message.error {
  border-color: rgba(239,68,68,0.25);
  background: rgba(239,68,68,0.12);
  color: var(--danger);
}

.message.success {
  border-color: rgba(34,197,94,0.30);
  background: rgba(34,197,94,0.14);
  color: #166534;
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: 1fr;
  }

  main {
    padding: clamp(14px, 6vw, 28px) clamp(14px, 6vw, 26px) clamp(24px, 7vh, 40px);
  }

  .auth {
    padding: clamp(8px, 4vw, 16px) clamp(10px, 5vw, 20px); /* More compact padding for smaller screens */
  }

  .auth-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .site-nav {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
    margin-top: 10px;
  }

  .auth-session {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
    margin-top: 10px;
  }

  .auth-card,
  .card {
    padding: 24px 22px;
  }
}

@media (max-width: 520px) {
  .site-header {
    padding: 12px 14px;
  }

  .site-nav {
    gap: 12px;
  }

  .auth-session {
    justify-content: flex-start;
    margin-left: 0;
  }

  .auth-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn,
  button,
  input {
    width: 100%;
  }
}
