/* Palette taken from x-system.co.uk. */
:root {
  color-scheme: light;
  --brand: #1976d2;
  --brand-hover: hsl(244, 83%, 56%);
  --gradient-dark: hsl(244, 83%, 56%);
  --gradient-light: hsl(195, 77%, 64%);
  --surface: #ffffff;
  --text: #444444;
  --heading: #1000e8;
  --field: #f5f5f5;
  --border: hsl(0, 0%, 35%);
  --on-brand: #ffffff;
  --error: hsl(11, 90%, 40%);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px max(16px, env(safe-area-inset-right)) 16px max(16px, env(safe-area-inset-left));
  background: linear-gradient(135deg, var(--gradient-dark), var(--gradient-light));
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

main {
  width: 100%;
  max-width: 440px;
  padding: 24px;
  border-radius: 16px;
  background: var(--surface);
}

section:focus {
  outline: none;
}

h1 {
  margin: 0 0 4px;
  color: var(--heading);
  font-size: 1.75rem;
  line-height: 1.2;
}

.intro {
  margin: 0 0 24px;
}

label[for='contact'] {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

/* 16px or larger stops iOS Safari zooming in when the field is focused. */
input[type='text'] {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--field);
  color: inherit;
  font: inherit;
  font-size: 1.0625rem;
}

.consent {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  padding: 4px 0;
  cursor: pointer;
}

.consent input {
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--brand);
}

.note {
  margin: 12px 0 0 36px;
  font-size: 0.9375rem;
  font-weight: 600;
}

.error {
  min-height: 1.5em;
  margin: 12px 0;
  color: var(--error);
  font-weight: 600;
}

button {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: var(--on-brand);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--brand-hover);
}

button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.language {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 16px;
}

.language button {
  width: auto;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--brand);
  background: transparent;
  color: var(--brand);
  font-size: 0.9375rem;
}

.language button:hover {
  background: var(--field);
}

.language button[aria-pressed='true'] {
  background: var(--brand);
  color: var(--on-brand);
}

:focus-visible {
  outline: 3px solid var(--heading);
  outline-offset: 2px;
}
