/* ─────────────────────────────────────────────────────────────────────────
   Rulki landing — shared styles
   Palette: forest #0F3D2E · pine #1F6F4E · amber #F2B632
            cream #F7F4ED · charcoal #111827 · muted #6B7280
   Font: Satoshi (Fontshare)
───────────────────────────────────────────────────────────────────────── */

:root {
  --forest:   #0F3D2E;
  --pine:     #1F6F4E;
  --amber:    #F2B632;
  --cream:    #F7F4ED;
  --charcoal: #111827;
  --muted:    #6B7280;
  --white:    #FFFFFF;

  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  24px;
  --radius-pill: 9999px;

  --shadow-card: 0 8px 40px rgba(15,61,46,0.08), 0 1px 4px rgba(15,61,46,0.04);
  --shadow-btn:  0 2px 8px rgba(15,61,46,0.18);
}

/* ── Reset ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Satoshi', system-ui, sans-serif;
  font-weight: 400;
  background: var(--cream);
  color: var(--charcoal);
  min-height: 100dvh;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  outline: none;
  border: none;
  background: none;
}

/* ── Nav ─────────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247,244,237,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(15,61,46,0.08);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Nav brand — logo + wordmark side by side */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-wordmark {
  height: 22px;
  width: auto;
  display: block;
  mix-blend-mode: multiply; /* dissolves white bg against cream nav */
}

/* Logo mark — nav (image already carries green bg) */
.logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
  overflow: hidden;
}

.logo-mark img {
  width: 44px;
  height: 44px;
  object-fit: cover;
}

/* Logo mark — cream version (for cards) */
.logo-mark-cream {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  flex-shrink: 0;
  overflow: hidden;
  margin: 0 auto 24px;
}

.logo-mark-cream img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  mix-blend-mode: multiply; /* blends cream bg seamlessly with white card */
}

.nav-signin {
  font-size: 12px;
  font-weight: 500;
  color: var(--forest);
  border: 1.5px solid var(--forest);
  border-radius: var(--radius-pill);
  padding: 8px 20px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.nav-signin:hover {
  background: var(--forest);
  color: var(--cream);
}

/* ── Shared input / select styles ────────────────────────────────────── */
.field {
  width: 100%;
  padding: 14px 16px;
  background: var(--white);
  border: 1.5px solid rgba(15,61,46,0.15);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 400;
  color: var(--charcoal);
  transition: border-color 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.field::placeholder { color: var(--muted); }
.field:focus { border-color: var(--forest); }
.field.is-error { border-color: #C0392B; }

.field-error {
  display: none;
  font-size: 12px;
  color: #C0392B;
  margin-top: -4px;
  padding-left: 2px;
}
.field-error.visible { display: block; }

select.field {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Primary button ──────────────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--forest);
  color: var(--cream);
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-btn);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover { background: var(--pine); }
.btn-primary:active { transform: translateY(1px); }

.btn-primary[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ── Google button ───────────────────────────────────────────────────── */
.btn-google {
  width: 100%;
  padding: 14px;
  background: var(--white);
  color: var(--charcoal);
  border: 1.5px solid rgba(15,61,46,0.20);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-google:hover {
  border-color: var(--forest);
  background: rgba(15,61,46,0.02);
}

/* ── Divider ─────────────────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--muted);
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(15,61,46,0.10);
}

/* ── Amber link ──────────────────────────────────────────────────────── */
.amber-link {
  color: var(--amber);
  font-size: 13px;
  font-weight: 500;
  transition: opacity 0.15s;
  cursor: pointer;
}

.amber-link:hover { opacity: 0.75; }

/* ── Card page layout (login / early-access) ─────────────────────────── */
.card-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  /* Subtle forest vignette at corners */
  background:
    radial-gradient(ellipse 60% 60% at 0% 0%, rgba(15,61,46,0.04) 0%, transparent 60%),
    radial-gradient(ellipse 60% 60% at 100% 100%, rgba(15,61,46,0.04) 0%, transparent 60%),
    var(--cream);
}

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 48px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(15,61,46,0.08);
}

.card-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--forest);
  text-align: center;
  margin-bottom: 6px;
}

.card-subtitle {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 0;
}

/* ── Spinner ─────────────────────────────────────────────────────────── */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(247,244,237,0.3);
  border-top-color: var(--cream);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

/* ── Success state ───────────────────────────────────────────────────── */
.success-state {
  text-align: center;
  padding: 8px 0;
}

.success-icon {
  width: 64px;
  height: 64px;
  background: var(--forest);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.success-icon svg { color: var(--cream); }

.success-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--forest);
  margin-bottom: 8px;
}

.success-body {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
}

/* ── Footer ──────────────────────────────────────────────────────────── */
.footer {
  background: var(--forest);
  padding: 20px 40px;
  text-align: center;
}

.footer p {
  font-size: 12px;
  color: rgba(247,244,237,0.6);
  line-height: 1.8;
}

.footer .amber { color: var(--amber); }

/* ── Mobile ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .nav-inner { padding: 12px 20px; }

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

  .footer { padding: 20px 24px; }
}
