*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --ink:          #0f0e0d;
  --paper:        #f5f1ea;
  --cream:        #ede8df;
  --white:        #fdfcf9;
  --accent:       #1d7a50;
  --accent-light: #3db87a;
  --accent-rgb:   29, 122, 80;
  --muted:        #7a7060;
  --border:       #d6cfc3;
  --green:        #2a7a4b;
  --green-bg:     rgba(42,122,75,0.08);
  --blue:         #1a5a8a;
  --blue-bg:      rgba(26,90,138,0.08);
  --red:          #b03030;
}
html { scroll-behavior: smooth; }
body {
  font-family: 'Instrument Sans', sans-serif;
  background: var(--paper);
  color: var(--ink);
  overflow-x: hidden;
}

@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem 2.5rem;
  background: rgba(245,241,234,0.9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-logo { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.nav-logo-text { font-family: 'DM Serif Display', serif; font-size: 1.2rem; color: var(--ink); letter-spacing: -0.01em; }
.nav-logo-text span { color: var(--accent); }
.nav-links { display: flex; gap: 2rem; align-items: center; list-style: none; }
.nav-links a { font-size: 0.875rem; font-weight: 500; color: var(--muted); text-decoration: none; transition: color 0.2s; }
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  background: var(--accent); color: var(--white) !important;
  padding: 0.5rem 1.25rem; border-radius: 4px;
  font-weight: 600 !important; transition: background 0.2s !important;
}
.nav-cta:hover { background: rgba(var(--accent-rgb),0.85) !important; }
.nav-toggle { display: none; background: none; border: 1.5px solid var(--border); cursor: pointer; padding: 0.4rem 0.5rem; border-radius: 4px; color: var(--ink); }

/* ── FOOTER ── */
footer {
  background: var(--ink); color: rgba(245,241,234,0.45);
  padding: 2rem 2.5rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 2rem;
  font-size: 0.8rem;
}
footer a { color: rgba(245,241,234,0.45); text-decoration: none; }
footer a:hover { color: var(--paper); }
.footer-logo { font-family: 'DM Serif Display', serif; font-size: 1rem; color: var(--paper); }
.footer-logo span { color: var(--accent-light); }
.footer-cols { display: flex; gap: 3rem; }
.footer-col-head { font-family: 'DM Mono', monospace; font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(245,241,234,0.35); margin-bottom: 0.75rem; }
.footer-cols a { display: block; color: rgba(245,241,234,0.45); text-decoration: none; font-size: 0.82rem; margin-bottom: 0.35rem; }
.footer-cols a:hover { color: var(--paper); }

/* ── BUTTONS ── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--accent); color: var(--white);
  padding: 0.85rem 2rem; border-radius: 4px;
  font-weight: 600; font-size: 0.95rem; text-decoration: none;
  border: none; cursor: pointer; transition: background 0.2s, transform 0.15s;
}
.btn-primary:hover { background: #b8400a; transform: translateY(-1px); }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: transparent; color: var(--ink);
  padding: 0.85rem 2rem; border-radius: 4px;
  font-weight: 500; font-size: 0.95rem; text-decoration: none;
  border: 1.5px solid var(--border); cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.btn-secondary:hover { border-color: var(--ink); background: var(--cream); }

/* ── SIGNUP MODAL ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15,14,13,0.65); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-card {
  background: var(--white); border-radius: 10px;
  width: 100%; max-width: 420px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
}
.modal-top {
  background: var(--ink); padding: 1.5rem 1.75rem 1.25rem;
  position: relative;
}
.modal-logo { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1rem; }
.modal-logo-text { font-family: 'DM Serif Display', serif; font-size: 0.95rem; color: var(--paper); }
.modal-logo-text span { color: var(--accent-light); }
.modal-title { font-family: 'DM Serif Display', serif; font-size: 1.55rem; color: var(--paper); letter-spacing: -0.02em; line-height: 1.1; }
.modal-sub { font-family: 'DM Mono', monospace; font-size: 0.62rem; color: rgba(245,241,234,0.42); margin-top: 0.4rem; letter-spacing: 0.04em; }
.modal-close {
  position: absolute; top: 1rem; right: 1rem; width: 28px; height: 28px; border-radius: 4px;
  background: rgba(245,241,234,0.1); border: 1px solid rgba(245,241,234,0.15);
  color: rgba(245,241,234,0.6); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background 0.2s;
}
.modal-close:hover { background: rgba(245,241,234,0.2); color: var(--paper); }
.modal-body { padding: 1.75rem; }
.modal-field { margin-bottom: 1rem; }
.modal-label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--ink); margin-bottom: 0.4rem; }
.modal-label span { color: var(--accent); }
.modal-input {
  width: 100%; font-family: 'Instrument Sans', sans-serif; font-size: 0.9rem;
  color: var(--ink); background: var(--paper); border: 1.5px solid var(--border); border-radius: 5px;
  padding: 0.7rem 0.9rem; outline: none; transition: border-color 0.2s, box-shadow 0.2s; appearance: none;
}
.modal-input::placeholder { color: rgba(122,112,96,0.45); }
.modal-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.1); background: var(--white); }
.modal-input.error { border-color: var(--red); }
.modal-field-err { font-size: 0.72rem; color: var(--red); margin-top: 0.25rem; display: none; }
.modal-field-err.visible { display: block; }
.modal-submit {
  width: 100%; margin-top: 0.25rem;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  background: var(--accent); color: var(--white);
  font-family: 'Instrument Sans', sans-serif; font-size: 0.92rem; font-weight: 600;
  padding: 0.9rem 1.5rem; border-radius: 5px; border: none; cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.modal-submit:hover:not(:disabled) { background: #b8400a; transform: translateY(-1px); }
.modal-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.modal-terms { font-size: 0.7rem; color: var(--muted); text-align: center; margin-top: 0.9rem; line-height: 1.55; }
.modal-terms a { color: var(--muted); text-decoration: underline; }
.modal-form-wrap.hidden { display: none; }
.modal-success { display: none; padding: 2.25rem 1.75rem; text-align: center; }
.modal-success.visible { display: block; }
.modal-success-icon {
  width: 62px; height: 62px; border-radius: 50%; background: var(--green-bg);
  border: 1.5px solid rgba(42,122,75,0.25); display: flex; align-items: center;
  justify-content: center; font-size: 1.7rem; margin: 0 auto 1.25rem;
}
.modal-success-title { font-family: 'DM Serif Display', serif; font-size: 1.4rem; color: var(--ink); margin-bottom: 0.6rem; letter-spacing: -0.01em; }
.modal-success-sub { font-size: 0.85rem; color: var(--muted); line-height: 1.65; max-width: 290px; margin: 0 auto; }
.modal-success-sub strong { color: var(--ink); }

/* ── FORMS ── */
.form-group { margin-bottom: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--ink); margin-bottom: 0.35rem; }
label span { color: var(--accent); }
.form-input, .form-textarea { width: 100%; font-family: 'Instrument Sans', sans-serif; font-size: 0.88rem; color: var(--ink); background: var(--paper); border: 1.5px solid var(--border); border-radius: 4px; padding: 0.65rem 0.9rem; outline: none; transition: border-color 0.2s, box-shadow 0.2s; appearance: none; }
.form-input:focus, .form-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.1); background: var(--white); }
.form-input.error, .form-textarea.error { border-color: var(--red); }
.form-textarea { resize: vertical; min-height: 110px; line-height: 1.6; }
.field-error { font-size: 0.72rem; color: var(--red); margin-top: 0.25rem; display: none; }
.field-error.visible { display: block; }
.form-submit { width: 100%; display: flex; align-items: center; justify-content: center; gap: 0.5rem; background: var(--accent); color: var(--white); font-family: 'Instrument Sans', sans-serif; font-size: 0.9rem; font-weight: 600; padding: 0.85rem; border-radius: 4px; border: none; cursor: pointer; transition: background 0.2s; margin-top: 0.25rem; }
.form-submit:hover:not(:disabled) { background: rgba(var(--accent-rgb),0.8); }
.form-submit:disabled { opacity: 0.65; cursor: not-allowed; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; display: none; }
.form-submit.loading .spinner { display: block; }
.form-submit.loading .btn-text { display: none; }
.form-success { display: none; text-align: center; padding: 2rem 1rem; }
.form-success.visible { display: block; }
.form-fields.hidden { display: none; }
.success-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--green-bg); border: 1.5px solid rgba(42,122,75,0.25); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; margin: 0 auto 1rem; }
.success-title { font-family: 'DM Serif Display', serif; font-size: 1.3rem; color: var(--ink); margin-bottom: 0.5rem; }
.success-sub { font-size: 0.83rem; color: var(--muted); }
.form-error-banner { background: rgba(176,48,48,0.07); border: 1px solid rgba(176,48,48,0.2); border-radius: 4px; padding: 0.7rem 1rem; font-size: 0.82rem; color: var(--red); margin-bottom: 1rem; display: none; }
.form-error-banner.visible { display: block; }

/* ── CAPTCHA ── */
.captcha-group { display: flex; align-items: center; gap: 0.85rem; margin-bottom: 0.5rem; }
.captcha-question { font-family: 'DM Mono', monospace; font-size: 0.82rem; color: var(--ink); background: rgba(var(--accent-rgb),0.06); border: 1.5px solid var(--border); border-radius: 4px; padding: 0.55rem 0.85rem; white-space: nowrap; }
.captcha-question.loading { color: var(--muted); }
.captcha-input { width: 75px; font-family: 'DM Mono', monospace; font-size: 0.88rem; text-align: center; color: var(--ink); background: var(--paper); border: 1.5px solid var(--border); border-radius: 4px; padding: 0.55rem 0.5rem; outline: none; transition: border-color 0.2s; }
.captcha-input:focus { border-color: var(--accent); }
.captcha-input.error { border-color: var(--red); }
.captcha-refresh { background: none; border: none; cursor: pointer; color: var(--muted); padding: 0.35rem; border-radius: 4px; transition: color 0.15s; font-size: 1rem; line-height: 1; }
.captcha-refresh:hover { color: var(--accent); }
.captcha-field-error { font-size: 0.72rem; color: var(--red); margin-top: 0.2rem; display: none; }
.captcha-field-error.visible { display: block; }

/* ── RESPONSIVE NAV ── */
@media (max-width: 768px) {
  nav { padding: 1rem 1.25rem; }
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column;
    background: rgba(245,241,234,0.98); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border); padding: 0.5rem 0; z-index: 200;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 0.9rem 1.5rem; color: var(--ink); border-bottom: 1px solid var(--border); }
  .nav-links li:last-child a { border-bottom: none; }
  .nav-cta { background: none !important; color: var(--accent) !important; }
  footer {
    grid-template-columns: 1fr;
    padding: 1.5rem 1.25rem;
  }
  .footer-cols { flex-wrap: wrap; gap: 2rem; }
}
