/* ================================================================
   ISH Beta-Gate · Styles
   ================================================================ */

:root {
  --ink: #00364a;
  --ink-deep: #002535;
  --teal: #00aaa2;
  --teal-glow: rgba(0, 170, 162, 0.4);
  --lila: #7888fe;
  --cream: #f5f1ea;
  --paper: #fbf8f3;
  --white: #ffffff;
  --line: rgba(245, 241, 234, 0.12);
  --line-strong: rgba(245, 241, 234, 0.25);
  --text-dim: rgba(245, 241, 234, 0.55);
  --text-mid: rgba(245, 241, 234, 0.75);
  --error: #ff7a7a;
}

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

html, body {
  min-height: 100%;
  background: var(--ink);
  color: var(--cream);
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body { overflow-x: hidden; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Ambient background */
.ambient { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.ambient::before, .ambient::after { content: ''; position: absolute; filter: blur(80px); }
.ambient::before {
  top: -20%; left: -10%; width: 70%; height: 90%;
  background: radial-gradient(circle, rgba(0, 170, 162, 0.18) 0%, transparent 60%);
  animation: float1 20s ease-in-out infinite;
}
.ambient::after {
  bottom: -20%; right: -10%; width: 60%; height: 80%;
  background: radial-gradient(circle, rgba(120, 136, 254, 0.12) 0%, transparent 60%);
  animation: float2 25s ease-in-out infinite;
}
@keyframes float1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 30px) scale(1.05); }
}
@keyframes float2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, -40px) scale(1.08); }
}

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  opacity: 0.04; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Top bar */
.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  padding: 28px 48px;
  display: flex; justify-content: space-between; align-items: center;
  z-index: 10;
}

.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Rubik', sans-serif; font-weight: 500; font-size: 18px;
  letter-spacing: -0.01em; color: var(--cream);
}
.logo:hover { text-decoration: none; opacity: 0.8; }

.logo-mark {
  width: 28px; height: 28px; border-radius: 6px; background: var(--teal);
  display: flex; align-items: center; justify-content: center; color: var(--ink);
  font-family: 'Rubik', sans-serif; font-weight: 600; font-size: 14px;
}

.meta {
  display: flex; align-items: center; gap: 12px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim);
}

.meta-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--teal);
  box-shadow: 0 0 12px var(--teal-glow); animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Stage / Steps */
.stage {
  position: relative; z-index: 5;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 120px 24px 100px;
}

.step {
  width: 100%; max-width: 560px;
  position: absolute;
  opacity: 0; pointer-events: none;
}
.step.active {
  opacity: 1; pointer-events: auto;
  position: relative;
}

.step-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--teal); margin-bottom: 24px;
  display: flex; align-items: center; gap: 12px;
}
.step-num::before {
  content: ''; width: 24px; height: 1px; background: var(--teal);
}

h1 {
  font-family: 'Rubik', sans-serif; font-weight: 700;
  font-size: clamp(34px, 5vw, 56px); line-height: 1.1;
  letter-spacing: -0.025em; margin-bottom: 20px;
}
h1 em {
  font-style: normal; font-weight: 500; color: var(--teal);
}

.lede {
  font-size: 16px; line-height: 1.6; color: var(--text-mid);
  margin-bottom: 40px; max-width: 440px;
}
.lede strong { color: var(--cream); font-weight: 500; }

/* Forms */
.field { margin-bottom: 24px; }

.field-label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 10px;
}

.field input[type="email"] {
  width: 100%; background: transparent; border: none;
  border-bottom: 1px solid var(--line-strong);
  color: var(--cream);
  font-family: 'Inter', sans-serif; font-size: 20px; font-weight: 400;
  padding: 12px 0; outline: none;
  transition: border-color 0.3s ease;
}
.field input[type="email"]:focus { border-bottom-color: var(--teal); }
.field input[type="email"]::placeholder { color: var(--text-dim); }
.field input[type="email"].error { border-bottom-color: var(--error); }

/* Consents */
.consents {
  margin: 32px 0 32px;
  display: flex; flex-direction: column; gap: 14px;
}
.consent {
  display: flex; align-items: flex-start; gap: 12px;
  cursor: pointer; user-select: none; padding: 4px 0;
}
.consent input {
  position: absolute; opacity: 0; pointer-events: none;
}
.consent-box {
  flex-shrink: 0; width: 18px; height: 18px;
  border: 1px solid var(--line-strong); border-radius: 4px;
  margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
}
.consent input:checked + .consent-box {
  background: var(--teal); border-color: var(--teal);
}
.consent input:focus-visible + .consent-box {
  box-shadow: 0 0 0 3px rgba(0, 170, 162, 0.3);
}
.consent-box svg {
  opacity: 0; transform: scale(0.5); transition: all 0.2s ease;
}
.consent input:checked + .consent-box svg {
  opacity: 1; transform: scale(1);
}
.consent-text {
  font-size: 13px; line-height: 1.5; color: var(--text-mid);
}
.consent-text strong { color: var(--cream); font-weight: 500; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--cream); color: var(--ink); border: none;
  padding: 16px 28px;
  font-family: 'Inter', sans-serif;
  font-size: 14px; font-weight: 500; letter-spacing: 0.01em;
  border-radius: 100px; cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative; overflow: hidden;
  text-decoration: none;
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: var(--teal); border-radius: inherit;
  transform: translateX(-101%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}
.btn:hover:not(:disabled)::after { transform: translateX(0); }
.btn > * { position: relative; z-index: 1; }
.btn:hover:not(:disabled) { color: var(--ink); text-decoration: none; }
.btn:hover:not(:disabled) .btn-arrow { transform: translateX(4px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.loading .btn-label::after {
  content: '...';
  animation: dots 1.4s steps(4) infinite;
}
@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}
.btn-arrow { transition: transform 0.3s ease; }

.btn-ghost {
  background: transparent; color: var(--text-mid);
  font-size: 13px; padding: 12px 0;
}
.btn-ghost::after { display: none; }
.btn-ghost:hover { color: var(--cream); text-decoration: none; }

.btn-row {
  display: flex; align-items: center; gap: 24px; margin-top: 8px;
}

/* Code input */
.code-fields {
  display: flex; gap: 10px;
  margin: 8px 0 16px;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.code-fields input {
  width: 56px; height: 68px;
  background: rgba(245, 241, 234, 0.04);
  border: 1px solid var(--line-strong); border-radius: 12px;
  color: var(--cream);
  font-family: 'Rubik', sans-serif;
  font-size: 28px; font-weight: 500;
  text-align: center; outline: none;
  transition: all 0.2s ease; caret-color: var(--teal);
}
.code-fields input:focus {
  border-color: var(--teal);
  background: rgba(0, 170, 162, 0.08);
  box-shadow: 0 0 0 4px rgba(0, 170, 162, 0.12);
}
.code-fields input.filled {
  border-color: var(--teal);
  background: rgba(0, 170, 162, 0.06);
}
.code-fields input.error {
  border-color: var(--error); animation: shake 0.4s;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.code-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--text-dim);
  margin-top: 8px; letter-spacing: 0.04em;
}
.code-meta a {
  color: var(--teal);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.code-meta a:hover {
  border-bottom-color: var(--teal); text-decoration: none;
}

/* Form status */
.form-status {
  min-height: 24px; margin: 4px 0 20px;
  font-size: 13px; line-height: 1.5;
}
.form-status.error { color: var(--error); }
.form-status.success { color: var(--teal); }

.legal-note {
  margin-top: 20px;
  font-size: 12px; color: var(--text-dim); line-height: 1.5;
}
.legal-note a {
  color: var(--text-mid);
  border-bottom: 1px dotted var(--text-mid);
}
.legal-note a:hover { text-decoration: none; color: var(--cream); }

/* Success */
.success-mark {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--teal);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 32px; position: relative;
}
.success-mark::before {
  content: ''; position: absolute; inset: -8px;
  border: 1px solid var(--teal); border-radius: 50%;
  opacity: 0.3; animation: ring 2s ease-out infinite;
}
@keyframes ring {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.4); opacity: 0; }
}

.success-detail {
  display: flex; flex-direction: column; gap: 8px;
  margin: 32px 0; padding: 20px 24px;
  background: rgba(245, 241, 234, 0.04);
  border: 1px solid var(--line); border-radius: 12px;
}
.success-detail-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; gap: 16px;
}
.success-detail-row .label {
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; flex-shrink: 0;
}
.success-detail-row .value {
  color: var(--cream); font-weight: 500;
  text-align: right; word-break: break-word;
}

/* Tool grid */
.tool-grid {
  display: grid; grid-template-columns: 1fr;
  gap: 8px; margin: 32px 0;
}
.tool-card {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 24px;
  background: rgba(245, 241, 234, 0.04);
  border: 1px solid var(--line); border-radius: 12px;
  color: var(--cream); text-decoration: none;
  transition: all 0.25s ease;
  font-size: 15px; font-weight: 500;
}
.tool-card:hover {
  background: rgba(0, 170, 162, 0.08);
  border-color: var(--teal);
  text-decoration: none; transform: translateX(4px);
}
.tool-card:hover .tool-card-arrow {
  color: var(--teal); transform: translateX(4px);
}
.tool-card-name { color: var(--cream); }
.tool-card-arrow {
  color: var(--text-dim); font-size: 20px;
  transition: all 0.25s ease;
}

/* Step indicator */
.step-indicator {
  position: fixed; bottom: 40px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 10;
}
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--line-strong);
  transition: all 0.3s ease;
}
.dot.active {
  background: var(--teal);
  width: 24px; border-radius: 3px;
}

/* Legal */
.legal {
  position: fixed; bottom: 28px; left: 48px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.06em;
  color: var(--text-dim); z-index: 10;
}
.legal a {
  color: var(--text-dim);
  border-bottom: 1px dotted var(--text-dim);
}
.legal a:hover { text-decoration: none; color: var(--cream); }

/* Responsive */
@media (max-width: 640px) {
  .topbar { padding: 20px 24px; }
  .meta { font-size: 10px; }
  .stage { padding: 100px 20px 100px; }
  .code-fields input { width: 48px; height: 60px; font-size: 28px; }
  .legal { left: 24px; bottom: 24px; }
  .step-indicator { bottom: 24px; }
  h1 { font-size: clamp(28px, 8vw, 40px); }
}

@media (max-width: 380px) {
  .code-fields { gap: 6px; }
  .code-fields input { width: 42px; height: 54px; font-size: 24px; }
}
