/* Brand tokens extracted from tsgcorp.com: dark #0a1222, red #e52629,
   white color-blocking, Outfit headings / Inter body. */
:root {
  color-scheme: light;
  --bg-dark: #0a1222;
  --surface: #ffffff;
  --surface-soft: #f4f5f7;
  --text: #0a1222;
  --muted: #56607a;
  --border: #d5d8de;
  --red: #e52629;
  --red-strong: #c31e21;
  --red-soft: #fdefef;
  --error: #b91c1c;
  --error-soft: #fef2f2;
  --success: #047857;
  --radius: 14px;
  --shadow: 0 24px 60px rgba(2, 6, 18, 0.45);
  --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Outfit', 'Inter', ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at top right, rgba(229, 38, 41, 0.14), transparent 42%), var(--bg-dark);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
}

img {
  display: block;
  max-width: 100%;
}

.container {
  width: 100%;
  max-width: 680px;
  margin-inline: auto;
  padding-inline: 20px;
}

/* ---------- Header (white bar — color-blocked against the dark page) ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 4px solid var(--red);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  border-radius: 8px;
}

.brand-logo {
  height: 28px;
  width: auto;
}

.brand-text {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.lang-toggle {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.lang-btn {
  border: none;
  padding: 9px 16px;
  min-width: 3rem;
  font: inherit;
  font-weight: 600;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.lang-btn:hover {
  color: var(--red);
}

.lang-btn[aria-pressed="true"] {
  background: var(--bg-dark);
  color: #ffffff;
}

/* ---------- Card ---------- */

main.container {
  flex: 1;
  padding-block: 40px 56px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px;
}

h1,
h2 {
  font-family: var(--font-heading);
  color: var(--text);
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  line-height: 1.15;
  font-weight: 700;
}

.lead {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.75;
}

/* ---------- Form ---------- */

.field {
  margin-bottom: 20px;
  min-inline-size: 0;
}

fieldset.field {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 18px 16px;
}

fieldset.field legend {
  font-weight: 700;
  padding: 0 8px;
}

.field > label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

.required-mark {
  color: var(--red);
}

.optional-mark {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.9rem;
}

.field input[type="text"],
.field input[type="email"] {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  font: inherit;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  transition: border-color 160ms ease;
}

.field input:hover {
  border-color: var(--muted);
}

.field input[aria-invalid="true"] {
  border-color: var(--error);
}

.checkbox-row,
.radio-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.checkbox-label,
.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  cursor: pointer;
  font-weight: 500;
  transition: border-color 160ms ease, background 160ms ease;
}

.checkbox-label:has(input:checked),
.radio-label:has(input:checked) {
  border-color: var(--red);
  background: var(--red-soft);
}

.checkbox-label input,
.radio-label input {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  accent-color: var(--red);
  cursor: pointer;
}

fieldset[data-invalid="true"] {
  border-color: var(--error);
}

/* ---------- Errors ---------- */

.field-error {
  margin: 10px 0 0;
  color: var(--error);
  font-size: 0.95rem;
}

.form-error {
  margin: 0 0 20px;
  padding: 12px 16px;
  color: var(--error);
  background: var(--error-soft);
  border: 1px solid var(--error);
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
}

/* ---------- Buttons ---------- */

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 22px;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.btn-primary {
  width: 100%;
  border: none;
  background: var(--red);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--red-strong);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  margin-top: 8px;
  border: 1px solid var(--bg-dark);
  background: transparent;
  color: var(--bg-dark);
}

.btn-secondary:hover {
  border-color: var(--red);
  color: var(--red);
}

/* ---------- Focus visibility ---------- */

a:focus-visible,
button:focus-visible,
input:focus-visible,
.success-panel:focus-visible {
  outline: 3px solid var(--bg-dark);
  outline-offset: 2px;
}

/* ---------- Success / status panels ---------- */

.success-panel,
.status-card {
  text-align: center;
}

.success-panel {
  animation: fade-in 240ms ease;
}

.success-panel h2 {
  margin: 12px 0 8px;
  font-size: 1.4rem;
}

.success-panel p,
.status-card .lead {
  color: var(--muted);
  margin-bottom: 8px;
}

.success-icon {
  color: var(--success);
}

.neutral-icon {
  color: var(--muted);
}

.success-icon svg,
.neutral-icon svg {
  margin-inline: auto;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Footer (on dark page background) ---------- */

.site-footer {
  padding: 22px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
}

.site-footer p {
  margin: 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.95rem;
}

.footer-social {
  display: inline-flex;
  gap: 8px;
}

.social-link {
  display: inline-flex;
  padding: 8px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.65);
  transition: color 160ms ease;
}

.social-link:hover {
  color: #ffffff;
}

.social-link:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
}

/* ---------- Responsive ---------- */

@media (max-width: 560px) {
  main.container {
    padding-block: 24px 40px;
  }

  .card {
    padding: 24px 18px;
  }

  .checkbox-row,
  .radio-row {
    grid-template-columns: 1fr;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
