/* Shared by the client and staff pages. Calm, high contrast, large tap targets, one column, no motion. */

:root {
  color-scheme: light;
  --text: #111418;
  --muted: #3b4249;
  --bg: #ffffff;
  --surface: #f2f4f7;
  --line: #c4cad1;
  --border: #5c6670;
  --primary: #0b3a66;
  --primary-hover: #082c4e;
  --on-primary: #ffffff;
  --focus: #0a58ca;
  --error: #a3001b;
  --ok: #0b6b2f;
  --danger: #8f0016;
  --draft-bg: #fff3c4;
  --draft-border: #7a5c00;
  --radius: 0.375rem;
  --tap: 3rem;
}

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

[hidden] {
  display: none !important;
}

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

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

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 1.5rem 0 0.75rem;
}

h1 {
  font-size: 1.75rem;
}

h2 {
  font-size: 1.3rem;
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 0.875rem;
}

a {
  color: var(--primary);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--primary-hover);
}

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

h1:focus,
h2:focus,
[tabindex="-1"]:focus {
  outline: none;
}

/* Header and footer */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
}

.firm-name {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.lang-switch {
  display: flex;
  gap: 0.5rem;
}

.lang-switch button,
.lang-switch a {
  min-height: 2.75rem;
  min-width: 2.75rem;
  padding: 0.375rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.lang-switch button[aria-pressed="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
}

main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0.5rem 1rem 3rem;
}

.site-footer {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1rem 1rem 2.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0.625rem 1.25rem;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--on-primary);
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

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

.button.secondary {
  background: var(--bg);
  color: var(--primary);
}

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

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

.button:disabled,
.button[aria-busy="true"] {
  background: #9aa3ad;
  border-color: #9aa3ad;
  color: #ffffff;
  cursor: not-allowed;
}

.link-button {
  min-height: 2.75rem;
  padding: 0.25rem 0;
  border: 0;
  background: none;
  color: var(--primary);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 1rem 0;
}

/* Forms */

.field {
  margin: 0 0 1.25rem;
}

.field.compact {
  margin: 0.5rem 0 0.75rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

input[type="email"],
input[type="text"],
input[type="password"],
input[type="search"],
select,
textarea {
  display: block;
  width: 100%;
  min-height: var(--tap);
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 1.125rem;
}

textarea {
  resize: vertical;
}

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

.button + .hint {
  margin-top: 1rem;
}

.hint {
  color: var(--muted);
  font-size: 1rem;
  margin: 0 0 0.5rem;
}

.error {
  color: var(--error);
  font-weight: 600;
  margin: 0.5rem 0 0;
}

.error:empty {
  display: none;
}

.error p {
  margin: 0 0 0.25rem;
}

.success {
  color: var(--ok);
  font-weight: 700;
}

.status:empty {
  display: none;
}

.notice {
  background: var(--surface);
  border-left: 4px solid var(--primary);
  padding: 0.75rem 1rem;
  margin: 0 0 1rem;
}

.notice p:last-child {
  margin-bottom: 0;
}

.draft {
  background: var(--draft-bg);
  border: 2px solid var(--draft-border);
  border-radius: var(--radius);
  padding: 0.625rem 0.875rem;
  font-weight: 700;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.25rem 1rem 1rem;
  margin: 1.25rem 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Client pages: sign-in, upload, consent, confirmation. */

.card .button,
#view-form .button,
#view-consent .button,
#view-withdrawn .button,
#view-ended .button {
  width: 100%;
}

.who {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0.75rem 1rem 0.25rem;
  margin: 1rem 0;
}

.who-address {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.file-input:focus-visible + label {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.file-button {
  margin-bottom: 0.5rem;
}

.file-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
}

.file-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.file-row .button {
  width: auto;
}

.file-name {
  font-weight: 600;
  overflow-wrap: anywhere;
  margin-bottom: 0.25rem;
}

.file-row progress {
  display: block;
  width: 100%;
  height: 1rem;
  accent-color: var(--primary);
  margin: 0.5rem 0;
}

.file-status {
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.status-sent {
  color: var(--ok);
}

.status-failed {
  color: var(--error);
}

.consent-text p {
  margin-bottom: 1rem;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 1.5rem 0;
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
}

.check-row input {
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0.125rem 0 0;
  accent-color: var(--primary);
}

.check-row label {
  margin: 0;
}

#send-summary {
  font-size: 1.2rem;
}
