/* Sector theme for the public registration pages (entry, wizard, confirmation,
   registration closed, maintenance). Loaded after the page stylesheets and after
   site_home/css/sector.css, which provides the sector colours and patterns.
   Visual layer only: no layout or behaviour of the registration workflow changes.
   This file is identical on every CDE platform. */
@font-face {
  font-family: "NotoKufiArabic";
  src: url("../../site_home/fonts/NotoKufiArabic-VariableFont_wght.c9847eca7d55.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --cde-mint: #07E5BB;
  --cde-mint-soft: rgba(7, 229, 187, .14);
  --cde-navy: #0D1B2A;
  /* Patterns resolved from this file: a relative url() inside a custom property
     defined in site_home/css/sector.css resolves against registration/css/ in
     Chrome, which points to a missing registration/img/. */
  --reg-pat-light: url("../../site_home/img/bg-light.5c78a112610f.svg");
  --reg-pat-dark: url("../../site_home/img/bg-dark.ad15c60fab74.svg");
  /* entry.css */
  --main-green: var(--primary);
  --dark-green: var(--deep);
  --light-bg: var(--cream);
  --border-color: color-mix(in srgb, var(--accent) 28%, #fff);
  --text-dark: var(--ink);
  /* survey.css */
  --brand-1: var(--primary);
  --brand-2: var(--accent);
  --brand-dark: var(--deep);
  --text: var(--ink);
  --bg: var(--cream);
  --border: color-mix(in srgb, var(--accent) 30%, #fff);
  --ring: 0 0 0 3px var(--cde-mint-soft);
  /* status-pages.css */
  --dark: var(--deep);
}

body, body * { font-family: "NotoKufiArabic", "Segoe UI", Tahoma, sans-serif; }
body i[class^="bi"], body i[class*=" bi-"] { font-family: bootstrap-icons !important; }
body {
  background-color: var(--cream) !important;
  background-image: var(--reg-pat-light) !important;
  background-size: 220px 220px !important;
  color: var(--ink);
}

/* ---------- Entry page (registered/choice.html) ---------- */
.header-box, .status-brand {
  position: relative; overflow: hidden;
  background-color: var(--deep) !important;
  background-image: var(--reg-pat-dark), linear-gradient(135deg, var(--deep), var(--secondary)) !important;
  background-size: 140px 140px, auto !important;
  border-bottom: 4px solid var(--cde-mint);
}
.header-box::after, .status-brand::after {
  content: ""; position: absolute; width: 190px; height: 190px; inset-block-start: -70px; inset-inline-start: -50px;
  background: url("../../site_home/img/ring-dots.8965dfd9be47.svg") no-repeat center / contain; opacity: .35; pointer-events: none;
}
.header-logo img, .status-brand img { background: #fff; border-radius: 16px; padding: 6px; position: relative; z-index: 1; }
.header-content, .status-brand > * { position: relative; z-index: 1; }
.steps-indicator li.current { border-color: var(--primary); }
.steps-indicator li.current .num { background: var(--primary); color: #fff; }
.steps-indicator .num { background: var(--sand); }
.choice-card:hover { border-color: var(--accent); }
.choice-card input[type="radio"] { accent-color: var(--primary); }
.choice-card.is-selected, .choice-card:has(input:checked) {
  border-color: var(--primary); background: color-mix(in srgb, var(--sand) 45%, #fff);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.choice-card .selected-badge { background: var(--primary); }
.template-note { background: color-mix(in srgb, var(--sand) 40%, #fff); border-color: var(--accent); }
.template-note a { color: var(--primary-dark); border-color: var(--primary); }
.template-note a:hover, .template-note a:focus-visible { background: var(--primary); color: #fff; }
.form-box, .draft-panel { background-image: linear-gradient(#fff, #fff); box-shadow: 0 10px 26px rgba(13, 27, 42, .06); }
.form-group input:focus { border-color: var(--cde-mint); box-shadow: 0 0 0 3px var(--cde-mint-soft); }
.btn { background: var(--primary); color: #fff; }
.btn:hover { background: var(--primary-dark); color: #fff; }
.btn-outline { background: #fff; border-color: var(--deep); color: var(--deep); }
.btn-outline:hover { background: var(--sand); color: var(--deep); }

/* ---------- Wizard (survey/index.html) ---------- */
.sidebar {
  background-color: var(--deep) !important;
  background-image: var(--reg-pat-dark), linear-gradient(180deg, var(--deep), var(--cde-navy)) !important;
  background-size: 140px 140px, auto !important;
  border-top: 4px solid var(--cde-mint);
}
.brand img { background: #fff; border-radius: 10px; padding: 3px; filter: none; }
.link:hover, .link.active {
  border-color: var(--cde-mint); background: rgba(7, 229, 187, .12); box-shadow: none;
}
.topbar {
  background-color: var(--deep) !important;
  background-image: var(--reg-pat-dark), linear-gradient(90deg, var(--deep), var(--secondary)) !important;
  background-size: 120px 120px, auto !important;
  color: #fff !important; border-bottom: 3px solid var(--cde-mint);
}
.topbar .topbar-title { color: #fff; }
.card { box-shadow: 0 10px 26px rgba(13, 27, 42, .08), 0 4px 10px rgba(0, 0, 0, .04); }
.badge { background: var(--primary-soft); color: var(--primary-dark); border-color: color-mix(in srgb, var(--primary) 35%, #fff); }
.wizard-progress i, .section-progress > i { background: linear-gradient(90deg, var(--cde-mint), var(--accent), var(--primary)); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); filter: none; color: #fff; }
.btn-secondary { border-color: var(--deep); color: var(--deep); }
.choice:has(input:checked) { background: color-mix(in srgb, var(--sand) 45%, #fff); }
.template-callout { background: color-mix(in srgb, var(--sand) 40%, #fff); border-color: var(--accent); }
.template-callout a, .final-consent a { color: var(--primary-dark); }
.section-head .t, .q-item legend, .q-item .q-title { color: var(--deep); }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background-color: var(--primary); color: #fff; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }

/* ---------- Closed / maintenance pages ---------- */
.status-card { border-color: color-mix(in srgb, var(--accent) 30%, #fff); }
.status-card--closed { border-top-color: var(--primary); }
.status-card--maintenance { border-top-color: var(--secondary); }
.status-icon { background: var(--sand); color: var(--primary-dark); box-shadow: 0 0 0 5px var(--cde-mint-soft); }
.status-card h1 { color: var(--deep); }

/* ---------- Confirmation page (confirmation.html, inline colours) ---------- */
.card.mb-4 { border-top: 5px solid var(--primary) !important; box-shadow: 0 20px 40px rgba(13, 27, 42, .08) !important; }
h2[style*="314d49"] { color: var(--deep) !important; }
span[style*="07E5BB"] { color: var(--primary) !important; }
a.btn-login { background-color: var(--primary) !important; border: 0; border-radius: 999px; }
a.btn-login:hover { background-color: var(--primary-dark) !important; }
a[style*="07E5BB"] { color: var(--secondary) !important; }

/* ======================================================================
   Dark theme (shared CDE choice, see site_home/js/cde-theme.js).
   Surfaces derive from the sector's deep colour; markup is unchanged.
   ====================================================================== */
html[data-theme="dark"] {
  --d-bg: color-mix(in srgb, var(--deep) 62%, #04080d);
  --d-surface: color-mix(in srgb, var(--deep) 58%, #1b2632);
  --d-surface-2: color-mix(in srgb, var(--deep) 50%, #243140);
  --d-line: rgba(255, 255, 255, .10);
  --d-text: #DCE5EC;
  --d-heading: #F2F6F8;
  --d-muted: #A9B6C1;
  --light-bg: var(--d-bg); --bg: var(--d-bg); --card: var(--d-surface);
  --text-dark: var(--d-text); --text: var(--d-text); --muted: var(--d-muted);
  --border-color: var(--d-line); --border: var(--d-line);
  color-scheme: dark;
}
html[data-theme="dark"] body { background-color: var(--d-bg) !important; color: var(--d-text); }
html[data-theme="dark"] body { background-image: var(--reg-pat-dark) !important; background-size: 160px 160px !important; }
/* surfaces */
html[data-theme="dark"] .steps-indicator li, html[data-theme="dark"] .choice-card, html[data-theme="dark"] .form-box,
html[data-theme="dark"] .draft-panel, html[data-theme="dark"] .draft-actions .box, html[data-theme="dark"] .card,
html[data-theme="dark"] .section-head, html[data-theme="dark"] .q-item, html[data-theme="dark"] .choice,
html[data-theme="dark"] .footer, html[data-theme="dark"] .status-card, html[data-theme="dark"] .consent-check,
html[data-theme="dark"] .reg-toast, html[data-theme="dark"] .reg-modal, html[data-theme="dark"] .card.mb-4,
html[data-theme="dark"] .head {
  background-color: var(--d-surface) !important; color: var(--d-text); border-color: var(--d-line) !important;
}
html[data-theme="dark"] .form-box, html[data-theme="dark"] .draft-panel { background-image: none !important; }
/* text */
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3,
html[data-theme="dark"] .question-title, html[data-theme="dark"] .form-title, html[data-theme="dark"] .choice-card h3,
html[data-theme="dark"] .head h2, html[data-theme="dark"] .section-head .t, html[data-theme="dark"] .q-item legend,
html[data-theme="dark"] .q-item .q-title, html[data-theme="dark"] .status-card h1, html[data-theme="dark"] .draft-panel h2,
html[data-theme="dark"] .draft-actions h3, html[data-theme="dark"] .final-consent p, html[data-theme="dark"] h2[style] { color: var(--d-heading) !important; }
html[data-theme="dark"] label, html[data-theme="dark"] .form-group label, html[data-theme="dark"] .form-label { color: var(--d-text) !important; }
html[data-theme="dark"] .choice-card p, html[data-theme="dark"] .help, html[data-theme="dark"] .q-item .help,
html[data-theme="dark"] .privacy-note, html[data-theme="dark"] .status-note, html[data-theme="dark"] .section-kpi,
html[data-theme="dark"] .draft-panel dt, html[data-theme="dark"] .draft-actions p { color: var(--d-muted) !important; }
html[data-theme="dark"] .steps-indicator li { color: var(--d-muted); }
html[data-theme="dark"] .steps-indicator li.current { color: var(--d-heading); }
html[data-theme="dark"] .steps-indicator .num { background: var(--d-surface-2); color: var(--d-heading); }
/* fields */
html[data-theme="dark"] input[type="text"], html[data-theme="dark"] input[type="email"], html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="file"], html[data-theme="dark"] input[type="number"], html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] select, html[data-theme="dark"] textarea,
html[data-theme="dark"] .form-group input[type="text"], html[data-theme="dark"] .form-group input[type="email"],
html[data-theme="dark"] .select2-container--default .select2-selection--single {
  background-color: var(--d-surface-2) !important; color: var(--d-text) !important; border-color: rgba(255, 255, 255, .16) !important;
}
html[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered { color: var(--d-text) !important; }
html[data-theme="dark"] .select2-dropdown, html[data-theme="dark"] .select2-results__option { background: var(--d-surface); color: var(--d-text); }
html[data-theme="dark"] ::placeholder { color: rgba(220, 229, 236, .45); }
html[data-theme="dark"] .wizard-progress, html[data-theme="dark"] .section-progress { background: var(--d-surface-2) !important; border-color: var(--d-line) !important; }
/* tinted boxes */
html[data-theme="dark"] .choice-card.is-selected, html[data-theme="dark"] .choice-card:has(input:checked),
html[data-theme="dark"] .choice:has(input:checked), html[data-theme="dark"] .template-note, html[data-theme="dark"] .template-callout {
  background: color-mix(in srgb, var(--primary) 16%, var(--d-surface)) !important;
}
html[data-theme="dark"] .q-item.has-error { background: rgba(220, 38, 38, .10) !important; }
html[data-theme="dark"] .status-message, html[data-theme="dark"] .reg-inline-alert--warning { background: rgba(245, 158, 11, .12) !important; color: #FCD9A0 !important; border-color: rgba(245, 158, 11, .35) !important; }
html[data-theme="dark"] .status-icon { background: var(--d-surface-2); color: var(--d-heading); }
html[data-theme="dark"] .reg-file-note { background: rgba(22, 163, 74, .14); color: #A7F3C0; border-color: rgba(22, 163, 74, .3); }
/* outline buttons */
html[data-theme="dark"] .btn-outline, html[data-theme="dark"] .btn-secondary, html[data-theme="dark"] .status-btn--outline,
html[data-theme="dark"] .reg-btn--secondary, html[data-theme="dark"] .reg-btn--danger, html[data-theme="dark"] .btn-ghost {
  background: transparent !important; color: var(--d-text) !important; border-color: rgba(255, 255, 255, .3) !important;
}
html[data-theme="dark"] .template-note a { background: transparent; color: var(--d-heading); }
html[data-theme="dark"] .topbar #menu-toggle { background: var(--d-surface); color: var(--d-heading); }
/* confirmation page (Bootstrap) */
html[data-theme="dark"] .container-fluid, html[data-theme="dark"] .container { background: transparent; }
html[data-theme="dark"] label[style] { color: var(--d-text) !important; }

/* Floating theme switch (pages without a header button) */
.cde-theme-float {
  position: fixed; z-index: 2000; inset-block-end: 18px; inset-inline-start: 18px; width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center; cursor: pointer; border: 1px solid rgba(13, 27, 42, .15);
  background: #fff; color: var(--deep); box-shadow: 0 8px 22px rgba(13, 27, 42, .18); transition: transform .2s ease;
}
.cde-theme-float:hover { transform: translateY(-2px); }
html[data-theme="dark"] .cde-theme-float { background: var(--d-surface); color: var(--d-heading); border-color: var(--d-line); box-shadow: 0 8px 22px rgba(0, 0, 0, .4); }
