/* QIC Guest Wi-Fi portal
   Styled to sit alongside the centre websites: tinted header band, coloured hero,
   rounded fields and buttons, soft information panel.
   Every colour, font and radius below can be overridden per centre in centres/<slug>.json -> theme. */
:root {
  --primary: #2f6f5e;          /* buttons, checkboxes, links in panel */
  --button-text: #ffffff;
  --heading: #1d1d1f;          /* hero heading */
  --accent: #2f6f5e;           /* section headings */
  --text: #2b2b2e;
  --muted: #6b6b72;
  --bg: #ffffff;               /* page body */
  --header-bg: #ffffff;
  --header-border: #ececec;
  --hero-bg: #f3f5f2;
  --hero-text: #2b2b2e;
  --panel: #f5f5f5;            /* privacy and terms panel */
  --field-bg: #ffffff;
  --border: #dcdcdf;
  --error: #c62828;
  --radius: 10px;              /* fields, panel, banner */
  --button-radius: 999px;      /* 999px = pill, 8px = rounded rectangle */
  --heading-transform: none;   /* e.g. uppercase */
  --font-heading: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --font-body: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 var(--font-body);
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 600px; }

/* Header */
.site-header { background: var(--header-bg); border-bottom: 1px solid var(--header-border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 72px; }
.logo { display: block; max-height: 48px; max-width: 180px; width: auto; }
.header-badge {
  display: inline-flex; align-items: center; gap: 0.4rem; margin-left: auto;
  font-weight: 600; font-size: 0.875rem; color: var(--accent);
}
.header-badge svg { width: 18px; height: 18px; fill: currentColor; }

/* Hero */
.hero { background: var(--hero-bg); color: var(--hero-text); }
.hero-inner { padding-top: 2.25rem; padding-bottom: 2.25rem; display: grid; gap: 1.5rem; align-items: center; }
h1 {
  font-family: var(--font-heading); color: var(--heading); text-transform: var(--heading-transform);
  font-size: clamp(1.75rem, 6vw, 2.75rem); line-height: 1.1; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 0.75rem;
}
.welcome-text { font-size: 1.1rem; margin: 0; max-width: 34rem; }
.banner { width: 100%; height: auto; max-height: 320px; object-fit: cover; border-radius: var(--radius); display: block; }

/* Content */
.content { padding: 2rem 0 3rem; }
.section-heading {
  font-family: var(--font-heading); color: var(--accent); font-size: 1.5rem; font-weight: 600; margin: 0 0 1.25rem;
}
.fields { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1rem; }
.field { grid-column: 1 / -1; }
.field.field-half { grid-column: auto; }
.field label { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 0.35rem; }
.field .req { font-weight: 400; color: var(--muted); }
.field input, .field select {
  width: 100%; min-height: 50px; padding: 0.7rem 0.9rem; font: 16px var(--font-body); color: var(--text);
  background: var(--field-bg); border: 1px solid var(--border); border-radius: var(--radius);
  -webkit-appearance: none; appearance: none; transition: border-color .15s, box-shadow .15s;
}
.field select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23555' d='M1.4 0 6 4.6 10.6 0 12 1.4l-6 6-6-6z'/></svg>");
  background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem;
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}
.field [aria-invalid="true"] { border-color: var(--error); }
.error { color: var(--error); font-size: 0.8rem; min-height: 1.1em; margin: 0.25rem 0 0.6rem; }
.global-error { text-align: center; }

/* Checkboxes */
.check { display: flex; gap: 0.75rem; align-items: flex-start; font-size: 0.875rem; line-height: 1.5; margin: 0.5rem 0 1rem; }
.check input {
  flex: none; width: 22px; height: 22px; margin: 0; border: 1.5px solid var(--border); border-radius: 6px;
  background: var(--field-bg); -webkit-appearance: none; appearance: none; cursor: pointer; display: grid; place-content: center;
}
.check input::after { content: ""; width: 11px; height: 6px; border: solid var(--button-text); border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.check input:checked { background: var(--primary); border-color: var(--primary); }
.check input:checked::after { opacity: 1; }
.check input:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent); outline-offset: 2px; }

/* Privacy and terms panel */
.panel { background: var(--panel); border-radius: var(--radius); padding: 1.25rem 1.25rem 0.5rem; margin: 0.5rem 0 1rem; }
.panel:not(:has(> :not([hidden]))) { display: none; }
.notice { font-size: 0.8rem; line-height: 1.55; color: var(--text); }
.notice + .notice { border-top: 1px solid var(--border); padding-top: 1rem; margin-top: 0.25rem; }
.notice .notice-title, .notice h2 { font-family: var(--font-heading); font-size: 1rem; font-weight: 600; color: var(--text); margin: 0 0 0.5rem; }
.notice p { margin: 0 0 0.6rem; }
.notice a, .accept-statement a, .check a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.terms-full { font-size: 0.8rem; margin: 0 0 0.75rem; }
.terms-full summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.terms-full > div { max-height: 45vh; overflow-y: auto; background: var(--field-bg); border-radius: calc(var(--radius) - 2px); padding: 0.9rem; margin-top: 0.6rem; }

.accept-statement { font-size: 0.85rem; color: var(--muted); margin: 0.25rem 0 0.75rem; }

/* Button */
.btn {
  display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; padding: 0.8rem 2rem;
  border: 0; border-radius: var(--button-radius); background: var(--primary); color: var(--button-text);
  font: 600 1rem var(--font-body); cursor: pointer; transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(0.92); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: wait; }

/* Footer */
.site-footer { background: var(--header-bg); border-top: 1px solid var(--header-border); font-size: 0.75rem; color: var(--muted); padding: 1rem 0; }

/* Connecting overlay */
.modal { position: fixed; inset: 0; background: color-mix(in srgb, var(--bg) 94%, transparent); display: flex; align-items: center; justify-content: center; z-index: 10; }
.modal-content { text-align: center; font-weight: 600; }
.spinner { width: 44px; height: 44px; margin: 0 auto 1rem; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Small phones: stack half-width fields */
@media (max-width: 420px) { .field.field-half { grid-column: 1 / -1; } }

/* Desktop: hero splits into copy and image, button sits at natural width */
@media (min-width: 760px) {
  .hero-inner { grid-template-columns: 1.1fr 1fr; padding-top: 3.5rem; padding-bottom: 3.5rem; }
  .hero-inner:not(:has(.banner:not([hidden]))) { grid-template-columns: 1fr; }
  .btn { width: auto; min-width: 220px; }
  .content { padding-top: 3rem; }
}
