/* Naturgy palette (D-016); the mockup (F-027) uses navy for the button, grey for the box. Contrast is measured against the background it is used on:
   primary on white 5.39, navy on white 13.9, text on white 17.06, text-secondary on white 5.2.
   The pairs of D-016 that fail are adjusted: success green is never text, the error text is
   --error-text on --error-surface (6.8) and an input border is --input-border (5.2, over 3). */
:root {
  --primary: #4c50ff;
  --navy: #002f4c;
  --background: #fff;
  --surface: #f7f7fb;
  --text: #1a1a2e;
  --text-secondary: #6b6b80;
  --input-border: #6b6b80;
  --error-text: #991b1b;
  --error-surface: #fee2e2;
  --box: #f1f3f5;
  --box-border: #ced4da;
}

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

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

.page { max-inline-size: 26.25rem; min-block-size: 100vh; margin-inline: auto; display: flex; flex-direction: column; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.75rem;
  border-block-end: 2px solid var(--navy);
}

.brand { margin: 0; color: var(--navy); font-size: 1.25rem; }
.brand strong { font-weight: 700; }
.logo { inline-size: 110px; block-size: auto; }

main { flex: 1; padding: 1.5rem 1.25rem; }

.site-footer { padding: 1rem 1.25rem; background: var(--box); color: var(--text); font-size: 0.8125rem; text-align: center; }
.site-footer p { margin: 0; }

.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.greeting { margin-block-end: 0; font-weight: 600; }

.box { margin-block: 1.25rem; padding: 1.25rem; background: var(--box); border: 1px solid var(--box-border); border-radius: 0.375rem; }
.box .field label, .card h2 { text-align: center; }
.box .button { inline-size: 100%; }

.card h2 { margin-block: 0 0.75rem; font-size: 1.125rem; color: var(--navy); }
.card p { text-align: center; }

.small { color: var(--text); font-size: 0.8125rem; }

.language { display: flex; align-items: center; gap: 0.5rem; margin-block-start: 1.5rem; font-size: 0.8125rem; }
.language label { margin: 0; font-weight: 400; }
.language select { min-height: 44px; font: inherit; }
.small-button { padding-block: 0.25rem; font-size: 0.8125rem; }

h1 { margin-block: 0 1.5rem; color: var(--navy); font-size: 1.5rem; line-height: 1.25; }

.field { margin-block-end: 1.25rem; }

label { display: block; margin-block-end: 0.5rem; font-weight: 600; }

input[type="text"] {
  inline-size: 100%;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--input-border);
  border-radius: 0.375rem;
  background: var(--background);
  color: var(--text);
  font: inherit;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-inline-size: 44px;
  padding: 0.5rem 1.5rem;
  border: 2px solid var(--navy);
  border-radius: 0.375rem;
  background: var(--navy);
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

.button:hover { background: var(--primary); border-color: var(--primary); }

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

.amount { color: var(--navy); font-size: 1.5rem; }

.notice, .error {
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  background: var(--error-surface);
  color: var(--error-text);
}

.error { margin-block: 0.5rem 0; padding: 0.5rem 0.75rem; }

.notice ul { margin: 0; padding: 0; list-style: none; }

.notice a { color: inherit; font-weight: 600; text-decoration: underline; }

.icon {
  display: inline-block;
  inline-size: 1.25em;
  block-size: 1.25em;
  margin-inline-end: 0.25rem;
  border-radius: 50%;
  background: var(--error-text);
  color: var(--error-surface);
  font-weight: 700;
  line-height: 1.25em;
  text-align: center;
}

code { color: var(--text-secondary); }
