:root {
  --navy: #07192e;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #16a34a;
  --ink: #0f1f35;
  --muted: #536070;
  --line: #e2ecf8;
  --surface: #ffffff;
  --surface-soft: #f4f7fc;
  --shadow: 0 18px 50px rgba(7, 25, 46, 0.12);
  --r-xl: 28px;
  --r-sm: 10px;
}

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

body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface-soft);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

p { margin-top: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }

.container {
  width: min(560px, calc(100% - 44px));
  margin: 0 auto;
}

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 14px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover { transform: translateY(-2px); }

.button.primary {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.3);
}

.button.primary:hover {
  background: var(--blue-dark);
  box-shadow: 0 16px 40px rgba(37, 99, 235, 0.4);
}

.access-form {
  display: grid;
  gap: 16px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
}

.form-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.access-form .form-2col input {
  width: 100%;
}

.form-field {
  display: grid;
  gap: 6px;
}

label {
  font-size: 0.87rem;
  font-weight: 700;
  color: var(--navy);
}

input, textarea {
  width: 100%;
  padding: 12px 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cdd8eb;
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color 150ms, box-shadow 150ms;
}

textarea { resize: vertical; }

input:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.form-button {
  width: 100%;
  border: 0;
  margin-top: 4px;
}

.form-status {
  min-height: 22px;
  margin: 0;
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
}

.form-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.form-error {
  margin: 0;
  color: #b91c1c;
  font-size: 0.87rem;
  font-weight: 600;
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: #b91c1c;
  box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.1);
}

.download-page-inner {
  display: grid;
  gap: 20px;
  text-align: center;
}

.download-page-btn {
  width: 100%;
  justify-content: center;
}

.download-page-btn.is-disabled {
  opacity: 0.55;
  pointer-events: none;
  cursor: not-allowed;
  transform: none;
}

.download-page-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.download-page-hint code {
  font-size: 0.85em;
}

.download-page-back {
  margin: 0;
  font-size: 0.95rem;
}

.download-page-back a {
  color: var(--blue);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-page {
  padding: clamp(48px, 8vh, 80px) 0;
}

.legal-content {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 44px);
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.legal-content h1 {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--navy);
}

.legal-updated {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.95rem;
}

.legal-content h2 {
  margin: 26px 0 10px;
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  line-height: 1.3;
  color: var(--navy);
}

.legal-content p {
  margin: 0 0 14px;
  color: var(--ink);
}

.legal-content ul {
  margin: 0 0 16px;
  padding-left: 20px;
}

.legal-content li {
  margin: 0 0 8px;
  color: var(--ink);
}

.legal-home-link {
  margin: 28px 0 0;
  font-weight: 600;
}

.legal-home-link a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 640px) {
  .form-2col { grid-template-columns: 1fr; }
  .access-form { padding: 24px; }
}
