/* IABR v1.4.0 complete public, applicant and administration colour modes. */
html[data-theme="light"]{
  color-scheme:light;
  --mode-canvas:var(--theme-body,#fff);
  --mode-surface:#fff;
  --mode-surface-soft:#f4f6f8;
  --mode-surface-muted:#f7f9fb;
  --mode-input:#fafbfc;
  --mode-text:var(--theme-text,#10233f);
  --mode-heading:#071e3d;
  --mode-muted:#637083;
  --mode-border:#dfe5eb;
  --mode-link:#225a95;
  --mode-shadow:0 22px 70px rgba(7,30,61,.12);
}
html[data-theme="dark"]{
  color-scheme:dark;
  --mode-canvas:#061223;
  --mode-surface:#0d2037;
  --mode-surface-soft:#091a2e;
  --mode-surface-muted:#10253e;
  --mode-input:#07182b;
  --mode-text:#e8eef6;
  --mode-heading:#f3f6fa;
  --mode-muted:#9fb0c5;
  --mode-border:#2b4059;
  --mode-link:#8fc6ff;
  --mode-shadow:0 22px 70px rgba(0,0,0,.32);
}

html[data-theme] body,
html[data-theme] body.public-shell,
html[data-theme] body.app-shell{background:var(--mode-canvas)!important;color:var(--mode-text)!important;transition:background-color .2s,color .2s}
html[data-theme] h1,html[data-theme] h2,html[data-theme] h3,html[data-theme] h4,
html[data-theme] .hero-link,html[data-theme] .trust-row strong,
html[data-theme] .field label,html[data-theme] .field>span{color:var(--mode-heading)}
html[data-theme] p,html[data-theme] .form-note,html[data-theme] .panel-header p,
html[data-theme] .data-table small,html[data-theme] .timeline-item p,
html[data-theme] .evidence-card p{color:var(--mode-muted)}

/* Shared controls */
html[data-theme] .language-control{background:var(--mode-surface)!important;border-color:var(--mode-border)!important;color:var(--mode-text)!important}
html[data-theme] .theme-toggle{border-color:var(--mode-border)!important}
html[data-theme="light"] .theme-toggle{background:#eef2f6!important}
html[data-theme="dark"] .theme-toggle{background:#173758!important}
html[data-theme] .field input,html[data-theme] .field select,html[data-theme] .field textarea,
html[data-theme] .filters input,html[data-theme] .filters select,
html[data-theme] .block-fields input,html[data-theme] .block-fields textarea,
html[data-theme] .faq-row input,
html[data-theme] .faq-row select,html[data-theme] .faq-row textarea,
html[data-theme] .studio-panel input,html[data-theme] .studio-panel select,
html[data-theme] .studio-panel textarea,html[data-theme] .check-item select{
  background:var(--mode-input)!important;border-color:var(--mode-border)!important;color:var(--mode-text)!important
}
html[data-theme] input::placeholder,html[data-theme] textarea::placeholder{color:var(--mode-muted)!important;opacity:.8}
html[data-theme] .button-outline{background:var(--mode-surface)!important;border-color:var(--mode-border)!important;color:var(--mode-heading)!important}

/* Public website */
html[data-theme] .site-header{background:color-mix(in srgb,var(--mode-surface) 94%,transparent)!important;border-color:var(--mode-border)!important}
html[data-theme] .main-nav{color:var(--mode-text)!important}
html[data-theme] .brand:not(.brand-dark) strong{color:var(--mode-heading)!important}
html[data-theme="light"] .hero{background:linear-gradient(111deg,#fbf8f2,#fff 54%,#f8f2e8)!important}
html[data-theme="dark"] .hero{background:linear-gradient(125deg,#08172a,#10243b)!important}
html[data-theme] .hero h1,html[data-theme] .section h2,html[data-theme] .page-hero h1,
html[data-theme] .auth-card h1,html[data-theme] .record-content h1,
html[data-theme] .journey-copy h2{color:var(--mode-heading)!important}
html[data-theme] .hero-copy>p,html[data-theme] .page-hero p,
html[data-theme] .section-heading p,html[data-theme] .journey-copy p,
html[data-theme] .record-content .lead{color:var(--mode-muted)!important}
html[data-theme] .search-panel,html[data-theme] .auth-card,
html[data-theme] .category-card,html[data-theme] .step,
html[data-theme] .record-facts div,html[data-theme] .verify-result,
html[data-theme] .float-card{background:var(--mode-surface)!important;border-color:var(--mode-border)!important;color:var(--mode-text)!important;box-shadow:var(--mode-shadow)}
html[data-theme] .search-field{background:var(--mode-input)!important;border-color:var(--mode-border)!important}
html[data-theme] .search-field input{color:var(--mode-text)!important}
html[data-theme] .categories-section{background:var(--mode-surface-soft)!important}
html[data-theme] .metrics-section,html[data-theme] .metric{border-color:var(--mode-border)!important}
html[data-theme] .metric strong,html[data-theme] .category-card strong,
html[data-theme] .step h3,html[data-theme] .search-title strong,
html[data-theme] .verify-shortcut{color:var(--mode-heading)!important}
html[data-theme] .metric small,html[data-theme] .category-card small,
html[data-theme] .step p,html[data-theme] .search-title small{color:var(--mode-muted)!important}
html[data-theme] .page-hero,html[data-theme] .auth-page,html[data-theme] .public-record{background:var(--mode-surface-soft)!important}
html[data-theme="dark"] .page-hero,html[data-theme="dark"] .auth-page,
html[data-theme="dark"] .public-record{background:linear-gradient(125deg,#08172a,#10243b)!important}
html[data-theme] .cms-page,html[data-theme] .cms-content{background:var(--mode-canvas)!important;color:var(--mode-text)!important}
html[data-theme] .cms-richtext,html[data-theme] .cms-search,
html[data-theme] .image-text{color:var(--mode-text)!important}
html[data-theme] .pagination a,html[data-theme] .pagination span{background:var(--mode-surface);border-color:var(--mode-border);color:var(--mode-text)}
html[data-theme] .chatbot-window{background:var(--mode-surface)!important;border-color:var(--mode-border)!important;color:var(--mode-text)!important}
html[data-theme] .chatbot-messages,html[data-theme] .chatbot-actions,
html[data-theme] .chatbot-window form,html[data-theme] .chatbot-privacy{background:var(--mode-surface-soft)!important;border-color:var(--mode-border)!important}
html[data-theme] .chatbot-window input{background:var(--mode-input)!important;border-color:var(--mode-border)!important;color:var(--mode-text)!important}
@media(max-width:900px){html[data-theme] .main-nav{background:var(--mode-surface)!important;color:var(--mode-text)!important}}

/* Administration and applicant portal */
html[data-theme] .dashboard-main,html[data-theme] .dashboard-content{background:var(--mode-canvas)!important;color:var(--mode-text)!important}
html[data-theme] .dashboard-topbar{background:var(--mode-surface)!important;border-color:var(--mode-border)!important}
html[data-theme] .dashboard-topbar h1,html[data-theme] .panel h2,
html[data-theme] .panel h3,html[data-theme] .application-header h2,
html[data-theme] .stat-card strong,html[data-theme] .data-table strong,
html[data-theme] .empty-panel h3{color:var(--mode-heading)!important}
html[data-theme] .panel,html[data-theme] .panel-body,html[data-theme] .stat-card,
html[data-theme] .setting-card,html[data-theme] .modal-card,html[data-theme] .table-wrap,
html[data-theme] .faq-row,
html[data-theme] .builder-block,html[data-theme] .evidence-card,
html[data-theme] .key-values div,html[data-theme] .check-item{
  background:var(--mode-surface)!important;border-color:var(--mode-border)!important;color:var(--mode-text)!important
}
html[data-theme] .panel-header,html[data-theme] .data-table th,
html[data-theme] .builder-block header,html[data-theme] .block-toolbar{
  background:var(--mode-surface-muted)!important;border-color:var(--mode-border)!important;color:var(--mode-text)!important
}
html[data-theme] .data-table td,html[data-theme] .faq-row,html[data-theme] .timeline-item:after{border-color:var(--mode-border)!important}
html[data-theme] .data-table a{color:var(--mode-link)!important}
html[data-theme] .data-table tr:hover td{background:var(--mode-surface-muted)!important}
html[data-theme] .block-toolbar button,html[data-theme] .evidence-actions a,
html[data-theme] .evidence-actions button,html[data-theme] .modal-close{
  background:var(--mode-surface)!important;border-color:var(--mode-border)!important;color:var(--mode-text)!important
}
html[data-theme] .action-bar{background:color-mix(in srgb,var(--mode-surface) 96%,transparent)!important;border-color:var(--mode-border)!important}
html[data-theme] .tabs a{background:var(--mode-surface)!important;border-color:var(--mode-border)!important;color:var(--mode-muted)!important}
html[data-theme] .tabs a.active{background:var(--saffron)!important;border-color:var(--saffron)!important;color:#fff!important}
html[data-theme] .file-drop,html[data-theme] .background-preview,
html[data-theme] .import-errors{background:var(--mode-surface-soft)!important;border-color:var(--mode-border)!important;color:var(--mode-text)!important}
html[data-theme] .file-drop strong{color:var(--mode-heading)!important}
html[data-theme] .badge,html[data-theme] .status-pill{border:1px solid color-mix(in srgb,currentColor 25%,transparent)}
html[data-theme] .conversation-message{background:var(--mode-surface-muted)!important;color:var(--mode-text)!important}
html[data-theme] .conversation-message.visitor{background:color-mix(in srgb,#225a95 34%,var(--mode-surface))!important}

/* Certificate Studio controls follow the application mode; artwork stays print-accurate. */
html[data-theme] .studio-shell,html[data-theme] .studio-stage-wrap{background:var(--mode-surface-soft)!important;color:var(--mode-text)!important}
html[data-theme] .studio-panel{background:var(--mode-surface)!important;border-color:var(--mode-border)!important;color:var(--mode-text)!important}
html[data-theme] .studio-panel h2{color:var(--mode-heading)!important}
html[data-theme] .studio-panel h3,html[data-theme] .studio-panel label,
html[data-theme] .studio-note,html[data-theme] .studio-empty{color:var(--mode-muted)!important}
html[data-theme] .studio-field-button,html[data-theme] .studio-toolbar button,
html[data-theme] .preset-grid button{background:var(--mode-surface)!important;border-color:var(--mode-border)!important;color:var(--mode-text)!important}
html[data-theme] .studio-save{background:var(--mode-surface)!important}
html[data-theme] .certificate-stage{color-scheme:light}

@media(prefers-reduced-motion:reduce){html[data-theme] body{transition:none}}
