/* =====================================================================
   ADEPA HOSTEL – shared styles for the registration form and dashboard
   Colours sampled from adepa-logo.png. Every text/background pair used
   below meets WCAG AA (4.5:1 for text, 3:1 for borders and focus rings):
     brown on cream ........ 12.96:1    white on ochre ........ 4.97:1
     brown-soft on cream ...  8.05:1    white on ochre-dark ... 6.84:1
     error on cream ........  6.70:1    white on danger ....... 8.15:1
     success on cream ......  5.83:1    input border on cream . 4.05:1
   Fonts: the phone's built-in sans-serif, so nothing extra downloads.
   ===================================================================== */
:root {
  color-scheme: light;
  --cream: #FCF3E1;        /* logo background */
  --surface: #FFFBF2;      /* cards */
  --brown: #362813;        /* logo dark brown: text, headings */
  --brown-soft: #5B4631;   /* secondary text */
  --ochre: #A65E0F;        /* logo burnt orange: buttons, focus */
  --ochre-dark: #874C0B;   /* button hover, links */
  --ochre-tint: #F6E3C2;   /* soft highlight */
  --line: #E3D2B2;         /* decorative dividers only */
  --input-border: #8C7355; /* form field borders */
  --error: #A3260E;
  --error-bg: #FBE4DC;
  --error-text-on-bg: #7A1C0A;
  --success: #2E6B34;
  --danger: #9B1C1C;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--brown);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
}
img { max-width: 100%; }
a { color: var(--ochre-dark); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.45rem; letter-spacing: .01em; }
h2 { font-size: 1.15rem; }
p { margin: 0 0 .75rem; }

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

.wrap { max-width: 640px; margin: 0 auto; padding: 16px 16px 48px; }
.wrap-wide { max-width: 1200px; margin: 0 auto; padding: 16px 16px 48px; }

.brand { text-align: center; padding: 12px 0 8px; }
.brand img { width: 112px; height: auto; display: block; margin: 0 auto 10px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin-bottom: 16px;
}

.notice {
  background: var(--ochre-tint);
  border-left: 5px solid var(--ochre);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: .95rem;
  margin-bottom: 18px;
}
.notice p:last-child { margin-bottom: 0; }

/* ---------- Form fields ---------- */
.field { margin-bottom: 22px; }
.field > label, .field > .label {
  display: block;
  font-weight: 650;
  margin-bottom: 4px;
}
.hint { display: block; color: var(--brown-soft); font-size: .92rem; margin-bottom: 8px; }

input[type=text], input[type=tel], input[type=email], input[type=password],
input[type=search], select {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  font: inherit;
  font-size: 17px;             /* 16px+ stops iPhones zooming in */
  color: var(--brown);
  background: #fff;
  border: 2px solid var(--input-border);
  border-radius: 10px;
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--brown) 50%), linear-gradient(135deg, var(--brown) 50%, transparent 50%); background-position: calc(100% - 22px) 22px, calc(100% - 16px) 22px; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
input:focus, select:focus { border-color: var(--ochre); }
.invalid input, .invalid select, .invalid .photo-box { border-color: var(--error); }

.error {
  display: none;
  color: var(--error);
  font-weight: 600;
  font-size: .95rem;
  margin-top: 6px;
}
.invalid .error { display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px;
  padding: 12px 20px;
  font: inherit; font-weight: 700; font-size: 17px;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary { background: var(--ochre); color: #fff; }
.btn-primary:hover { background: var(--ochre-dark); }
.btn-secondary { background: var(--surface); color: var(--brown); border-color: var(--brown); }
.btn-secondary:hover { background: var(--ochre-tint); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-small { min-height: 44px; padding: 8px 14px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled=true] { opacity: .55; cursor: not-allowed; }

/* ---------- Photo pickers ---------- */
.photo-box {
  border: 2px dashed var(--input-border);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
}
.photo-preview {
  display: none;
  margin: 0 auto 12px;
  border-radius: 8px;
  background: var(--cream);
}
.photo-preview.show { display: block; }
.photo-preview.id { max-height: 220px; max-width: 100%; }
.photo-preview.passport { height: 200px; width: auto; }
.photo-meta { text-align: center; color: var(--brown-soft); font-size: .9rem; margin-bottom: 10px; min-height: 1.2em; }
.photo-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Consent ---------- */
.consent { display: flex; gap: 12px; align-items: flex-start; }
.consent input { width: 28px; height: 28px; flex: 0 0 28px; margin: 2px 0 0; accent-color: var(--ochre); }
.consent label { font-weight: 500; }

/* ---------- Progress ---------- */
.progress { display: none; margin-top: 14px; }
.progress.show { display: block; }
.bar { height: 14px; border-radius: 7px; background: var(--ochre-tint); overflow: hidden; border: 1px solid var(--input-border); }
.bar > span { display: block; height: 100%; width: 0; background: var(--ochre); transition: width .2s; }
.progress-text { margin-top: 6px; font-size: .95rem; }

.form-error {
  display: none;
  background: var(--error-bg);
  color: var(--error-text-on-bg);
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 600;
  margin-bottom: 14px;
}
.form-error.show { display: block; }

/* ---------- Confirmation ---------- */
.done { text-align: center; }
.done svg { width: 64px; height: 64px; color: var(--success); }
.ref {
  display: inline-block;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 1.9rem; font-weight: 700; letter-spacing: .06em;
  background: var(--ochre-tint);
  border: 2px solid var(--ochre);
  border-radius: 10px;
  padding: 8px 16px;
  margin: 8px 0 14px;
}
dl.summary { text-align: left; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 14px; }
dl.summary dt { color: var(--brown-soft); }
dl.summary dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.hidden { display: none !important; }
.muted { color: var(--brown-soft); }
.small { font-size: .9rem; }
.center { text-align: center; }
footer.site { text-align: center; color: var(--brown-soft); font-size: .85rem; margin-top: 24px; }
