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

:root {
  --bg-dark: #020308;
  --bg-mid: #040713;
  --bg-card: rgba(15, 23, 42, 0.95);
  --text: #f9fafb;
  --text-muted: rgba(249, 250, 251, 0.85);
  --text-soft: rgba(249, 250, 251, 0.75);
  --border: rgba(148, 163, 184, 0.4);
  --border-strong: rgba(148, 163, 184, 0.7);
  --accent: #38bdf8;
  --accent-badge: #7dd3fc;
  --success: #22c55e;
  --success-light: #4ade80;
  --error: #fca5a5;
  --error-border: rgba(248, 113, 113, 0.7);
  --focus-ring: rgba(56, 189, 248, 0.8);
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 0.75rem;
  --space-lg: 1rem;
  --space-xl: 1.25rem;
  --radius: 0.65rem;
  --radius-lg: 1.25rem;
  --touch-min: 44px;
  --content-max: 640px;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1b365d 0, var(--bg-mid) 55%, var(--bg-dark) 100%);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.skip-link {
  position: absolute;
  top: -4rem;
  left: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.875rem;
  text-decoration: none;
  border-radius: var(--radius);
  z-index: 100;
  transition: top 0.2s ease;
  border: 1px solid var(--border);
}

.skip-link:focus {
  top: var(--space-md);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hero {
  padding: clamp(1.5rem, 4vw, 2.25rem) var(--space-lg) var(--space-lg);
  padding-top: max(clamp(1.5rem, 4vw, 2.25rem), env(safe-area-inset-top));
  text-align: center;
}

.hero-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-content h1 {
  font-size: clamp(1.35rem, 4vw, 2.25rem);
  margin: 0 0 0.3rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .hero-content h1 {
    white-space: normal;
    font-size: clamp(1.25rem, 4.5vw, 1.75rem);
  }
}

@media (max-width: 360px) {
  .hero-content h1 { font-size: 1.15rem; }
}

.hero-badge {
  margin: 0 0 0.2rem;
  font-size: clamp(0.85rem, 2vw, 1.2rem);
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--accent-badge);
  text-transform: uppercase;
}

.hero-subtitle {
  margin: 0;
  font-size: clamp(0.8rem, 1.6vw, 1rem);
  color: var(--text-muted);
  font-weight: 400;
  max-width: 26em;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.35;
}

@media (max-width: 360px) {
  .hero-subtitle { font-size: 0.75rem; }
}

.hero-logos {
  margin-bottom: var(--space-lg);
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-logo-pill {
  width: clamp(56px, 14vw, 72px);
  height: clamp(56px, 14vw, 72px);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-radius: 50%;
  overflow: hidden;
  border: none;
  box-shadow: none;
}

.hero-logo-img {
  display: block;
  width: clamp(48px, 12vw, 64px);
  height: clamp(48px, 12vw, 64px);
  object-fit: contain;
  mix-blend-mode: lighten;
}

.main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 0 var(--space-lg) clamp(1.5rem, 4vw, 2.5rem);
  padding-bottom: max(clamp(1.5rem, 4vw, 2.5rem), env(safe-area-inset-bottom));
}

.card {
  width: 100%;
  max-width: var(--content-max);
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 2rem) clamp(1.1rem, 2.5vw, 1.75rem);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border);
}

.card-title {
  margin: 0 0 var(--space-xs);
  font-size: clamp(1.15rem, 2.5vw, 1.4rem);
  font-weight: 600;
}

.card-subtitle {
  margin: 0 0 1.25rem;
  font-size: clamp(0.8rem, 1.4vw, 0.9rem);
  color: #e5e7eb;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem 1.15rem;
}

@media (min-width: 600px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.25rem;
  }
}

.field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.field--full {
  grid-column: 1 / -1;
}

label,
.field-label {
  font-size: clamp(0.78rem, 1.4vw, 0.82rem);
  font-weight: 500;
  margin-bottom: var(--space-xs);
  color: #e5e7eb;
}

.field-label {
  margin-bottom: 0.3rem;
}

input,
select {
  padding: 0.55rem 0.75rem;
  min-height: var(--touch-min);
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background-color: rgba(15, 23, 42, 0.9);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  input, select { transition: none; }
}

input::placeholder {
  color: rgba(148, 163, 184, 0.85);
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--focus-ring);
  background-color: rgba(15, 23, 42, 1);
}

input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  padding-right: 1.75rem;
}

.error {
  margin-top: var(--space-xs);
  font-size: 0.72rem;
  color: var(--error);
  min-height: 1em;
}

.role-options {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
}

.role-option {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.role-option input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--success);
  flex-shrink: 0;
  cursor: pointer;
}

.role-option span {
  white-space: nowrap;
}

.role-option:hover {
  color: var(--text);
}

.role-option:focus-within span {
  color: var(--text);
}

.children-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

@media (min-width: 480px) {
  .children-row {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  }
}

.children-row.children-row--with-email {
  grid-template-columns: 1fr;
}

@media (min-width: 560px) {
  .children-row.children-row--with-email {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 2fr);
  }
}

.children-row:last-child {
  margin-bottom: 0;
}

.children-row label {
  font-size: 0.78rem;
}

.notice {
  margin-top: 1.25rem;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(56, 189, 248, 0.1), rgba(96, 165, 250, 0.05)), rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.35);
  font-size: clamp(0.78rem, 1.4vw, 0.82rem);
  color: #e0f2fe;
  line-height: 1.4;
}

.btn {
  margin-top: 1.25rem;
  width: 100%;
  min-height: var(--touch-min);
  padding: 0.8rem 1.25rem;
  border-radius: 999px;
  border: none;
  font-family: inherit;
  font-size: clamp(0.85rem, 1.4vw, 0.9rem);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  color: #0b1120;
  background: linear-gradient(135deg, var(--success), var(--success-light));
  box-shadow: 0 12px 32px rgba(34, 197, 94, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 14px 40px rgba(34, 197, 94, 0.5);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  box-shadow: none;
  transform: none;
}

.form-message {
  margin-top: 1.25rem;
  font-size: 0.85rem;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius);
  display: none;
  line-height: 1.4;
}

.form-message--success {
  display: block;
  background: rgba(22, 163, 74, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.7);
  color: #bbf7d0;
}

.form-message--error {
  display: block;
  background: rgba(185, 28, 28, 0.18);
  border: 1px solid var(--error-border);
  color: #fecaca;
}

.footer {
  padding: var(--space-lg) var(--space-xl);
  padding-bottom: max(var(--space-lg), env(safe-area-inset-bottom));
  text-align: center;
  font-size: clamp(0.7rem, 1.2vw, 0.75rem);
  color: var(--text-soft);
  line-height: 1.4;
}

@media print {
  body { background: #fff; color: #111; }
  .skip-link, .btn, .notice { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ccc; background: #fff; }
  .main { padding: 0; }
}
