/* ======================================================
   tickfills.css — shared styles for legal/auth/contact pages
   Matches the design system of index.html
   ====================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300;9..144,400;9..144,500;9..144,600&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #08090C;
  --bg-elev: #0E1014;
  --bg-card: #11141A;
  --bg-card-hi: #161A22;
  --line: #1B1F29;
  --line-hi: #252A37;

  --text: #ECEDEF;
  --text-mid: #9DA3AF;
  --text-dim: #5A606D;

  --mint: #00E676;
  --mint-soft: #00E67612;
  --mint-glow: #00E67630;
  --mint-deep: #00B85F;

  --red: #FF6B6B;
  --amber: #F5C26B;

  --serif: 'Fraunces', 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: overlay;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--mint); color: #06070A; }

/* ============ NAV ============ */
nav {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.nav-logo img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: block;
}
.nav-back {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-mid);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  transition: all .2s ease;
}
.nav-back:hover { color: var(--text); border-color: var(--line-hi); background: var(--bg-card); }

/* ============ FOOTER ============ */
footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
  margin-top: 80px;
  padding: 32px 24px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-dim);
  font-family: var(--mono);
  letter-spacing: 0.02em;
}

/* ============ LEGAL PAGES (privacy, terms, risk, billing) ============ */
.legal-wrap {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}

/* ambient glow header */
.legal-wrap::before {
  content: '';
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 400px;
  background: radial-gradient(ellipse at top, rgba(0, 230, 118, 0.06) 0%, transparent 60%);
  pointer-events: none;
  filter: blur(40px);
  z-index: -1;
}

.legal-eyebrow {
  display: inline-flex;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--mint);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 20px;
  padding: 6px 14px;
  border: 1px solid rgba(0, 230, 118, 0.25);
  border-radius: 999px;
  background: var(--mint-soft);
}

.legal-wrap h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.legal-updated {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  padding-bottom: 32px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.legal-wrap h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-top: 48px;
  margin-bottom: 14px;
  color: var(--text);
}

.legal-wrap h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 19px;
  margin-top: 28px;
  margin-bottom: 10px;
  letter-spacing: -0.015em;
}

.legal-wrap p, .legal-wrap li {
  color: var(--text-mid);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 14px;
}
.legal-wrap p strong, .legal-wrap li strong { color: var(--text); font-weight: 600; }

.legal-wrap ul, .legal-wrap ol {
  margin: 14px 0 18px 4px;
  padding-left: 22px;
}
.legal-wrap li { margin-bottom: 8px; }
.legal-wrap li::marker { color: var(--mint); }

.legal-wrap a {
  color: var(--mint);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.legal-wrap a:hover { border-bottom-color: var(--mint); }

/* tables in legal pages */
.legal-wrap table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 24px;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.legal-wrap th, .legal-wrap td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--text-mid);
}
.legal-wrap th {
  background: var(--bg-elev);
  color: var(--text);
  font-weight: 600;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.legal-wrap tr:last-child td { border-bottom: none; }

/* warning callout for risk page */
.legal-warn {
  margin: 28px 0;
  padding: 20px 24px;
  background: rgba(255, 107, 107, 0.06);
  border: 1px solid rgba(255, 107, 107, 0.25);
  border-left: 3px solid var(--red);
  border-radius: var(--radius-sm);
}
.legal-warn p { color: var(--text); margin-bottom: 0; }
.legal-warn p strong { color: #FF8888; }

/* ============ CARD layout (auth/action pages) ============ */
.card-wrap {
  position: relative;
  z-index: 2;
  min-height: calc(100vh - 80px);
  min-height: calc(100svh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px 80px;
}

/* ambient glow behind card */
.card-wrap::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 230, 118, 0.08) 0%, transparent 60%);
  pointer-events: none;
  filter: blur(40px);
  z-index: -1;
}

.card {
  width: 100%;
  max-width: 460px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
}

.card-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 8px;
}
.card-logo img { width: 32px; height: 32px; border-radius: 8px; }
.card-tagline {
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 32px;
}

.card-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--mint-soft);
  border: 1px solid rgba(0, 230, 118, 0.25);
  display: grid;
  place-items: center;
}
.card-icon.is-error {
  background: rgba(255, 107, 107, 0.08);
  border-color: rgba(255, 107, 107, 0.3);
}

.card h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.025em;
  text-align: center;
  margin-bottom: 10px;
}
.card-sub {
  text-align: center;
  color: var(--text-mid);
  font-size: 14.5px;
  margin-bottom: 28px;
}

/* ============ FORM ELEMENTS ============ */
.field {
  margin-bottom: 16px;
}
.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.field input,
.field textarea {
  width: 100%;
  padding: 13px 16px;
  background: var(--bg-card);
  border: 1px solid var(--line-hi);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  transition: all .2s ease;
}
.field textarea {
  min-height: 120px;
  resize: vertical;
  font-family: var(--sans);
  line-height: 1.5;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--mint);
  background: var(--bg-card-hi);
  box-shadow: 0 0 0 3px var(--mint-soft);
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-dim);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--text);
  color: #06070A;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: all .2s ease;
}
.btn-primary:hover {
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(255,255,255,0.12);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--line-hi);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
}
.btn-secondary:hover {
  border-color: var(--text-dim);
  background: var(--bg-card-hi);
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.error {
  display: none;
  padding: 12px 14px;
  background: rgba(255, 107, 107, 0.08);
  border: 1px solid rgba(255, 107, 107, 0.25);
  border-radius: var(--radius-sm);
  color: var(--red);
  font-size: 13.5px;
  margin-bottom: 16px;
}
.error.is-visible { display: block; }

.success-msg {
  display: none;
  text-align: center;
  padding: 8px 0;
}
.success-msg.is-visible { display: block; }

.card-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--text-mid);
}
.card-footer a {
  color: var(--mint);
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.card-footer a:hover { border-bottom-color: var(--mint); }

/* ============ STATUS / SPINNER ============ */
.spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 20px;
  border: 3px solid var(--line);
  border-top-color: var(--mint);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.status-block { text-align: center; }
.status-block.is-hidden { display: none; }

/* ============ RESPONSIVE ============ */
@media (max-width: 720px) {
  nav { padding: 20px 18px; }
  .nav-logo { font-size: 18px; }
  .nav-back { font-size: 12.5px; padding: 7px 12px; }
  .legal-wrap { padding: 40px 18px 60px; }
  .legal-wrap h1 { font-size: clamp(34px, 9vw, 44px); }
  .legal-wrap h2 { font-size: 22px; margin-top: 36px; }
  .legal-wrap p, .legal-wrap li { font-size: 14.5px; }
  .card-wrap { padding: 24px 18px 60px; }
  .card { padding: 32px 24px; }
  .card h2 { font-size: 24px; }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .spinner { animation: spin 1.6s linear infinite; }
}
