/* ==========================================================================
   eu.opineom.com — EU research panel
   Design language follows the main Opineom app (Plus Jakarta Sans, soft cards,
   light/dark via [data-theme]) with the EU palette as the accent.
   ========================================================================== */

:root {
    /* EU institutional palette */
    --eu-blue:        #003399;
    --eu-blue-dark:   #00256b;
    --eu-blue-light:  #0b49c6;
    --eu-gold:        #ffcc00;

    --bg:             #f4f6fb;
    --bg-elevated:    #ffffff;
    --bg-sunken:      #eef1f8;
    --surface-alt:    #f8fafc;

    --text:           #10162b;
    --text-muted:     #5b6478;
    --text-faint:     #8a93a6;

    --border:         #dfe4ee;
    --border-strong:  #c3cbdb;

    --accent:         var(--eu-blue);
    --accent-contrast:#ffffff;
    --accent-soft:    #e8eefc;

    --danger:         #c0332c;
    --danger-soft:    #fdeceb;
    --success:        #14804a;
    --success-soft:   #e3f5ec;

    --radius-sm:      8px;
    --radius:         14px;
    --radius-lg:      20px;

    --shadow-sm:      0 1px 2px rgba(16, 22, 43, .06);
    --shadow:         0 2px 8px rgba(16, 22, 43, .06), 0 12px 32px rgba(16, 22, 43, .06);

    --maxw:           760px;
    --font:           'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

:root[data-theme="dark"] {
    --bg:             #0c1020;
    --bg-elevated:    #151b30;
    --bg-sunken:      #101527;
    --surface-alt:    #1b2238;

    --text:           #eef1f8;
    --text-muted:     #a3accb;
    --text-faint:     #7a84a3;

    --border:         #262e49;
    --border-strong:  #36406090;

    --accent:         #6f95f5;
    --accent-contrast:#0c1020;
    --accent-soft:    #1c2748;

    --danger:         #f08a83;
    --danger-soft:    #341b1c;
    --success:        #59d39b;
    --success-soft:   #12291f;

    --shadow-sm:      0 1px 2px rgba(0, 0, 0, .4);
    --shadow:         0 2px 8px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--eu-blue-light); }
:root[data-theme="dark"] a:hover { color: #9db6fb; }

h1, h2, h3 { line-height: 1.25; letter-spacing: -.015em; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; left: 50%; top: -100px; transform: translateX(-50%);
    background: var(--accent); color: #fff; padding: 10px 18px;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm); z-index: 100;
    font-weight: 600; text-decoration: none; transition: top .15s ease;
}
.skip-link:focus { top: 0; color: #fff; }

:where(a, button, input, select, textarea):focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ==========================================================================
   EU banner
   ========================================================================== */

.eu-banner {
    background: var(--eu-blue);
    color: #fff;
    font-size: 13px;
    border-bottom: 3px solid var(--eu-gold);
}
.eu-banner-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 9px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.eu-emblem { border-radius: 2px; display: block; flex: 0 0 auto; }
.eu-banner-text { font-weight: 600; letter-spacing: .01em; }
.eu-banner-sep { opacity: .5; }
.eu-banner-meta { color: rgba(255, 255, 255, .8); font-size: 12.5px; }

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
}
@media (min-width: 800px) {
    .site-header { padding: 14px calc(50% - var(--maxw) / 2); }
    .eu-banner-inner { padding-left: 0; padding-right: 0; }
}

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; }
.brand-mark {
    width: 36px; height: 36px; border-radius: 10px; flex: 0 0 auto;
    background: var(--eu-blue); color: var(--eu-gold);
    display: grid; place-items: center;
    font-weight: 700; font-size: 15px; letter-spacing: -.02em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -.02em; }
.brand-sub { font-size: 11.5px; color: var(--text-muted); }

.header-tools { display: flex; align-items: center; gap: 8px; }

.icon-btn {
    width: 36px; height: 36px; border-radius: 9px; cursor: pointer;
    border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text-muted);
    display: grid; place-items: center; transition: background .15s ease, color .15s ease;
}
.icon-btn:hover { background: var(--surface-alt); color: var(--text); }

.theme-icon-moon { display: none; }
:root[data-theme="dark"] .theme-icon-sun { display: none; }
:root[data-theme="dark"] .theme-icon-moon { display: block; }

.lang-nav { display: flex; gap: 2px; background: var(--bg-sunken); padding: 3px; border-radius: 10px; }
.lang-link {
    display: flex; align-items: center; gap: 4px;
    padding: 5px 8px; border-radius: 7px; font-size: 12px; font-weight: 600;
    color: var(--text-muted); text-decoration: none;
}
.lang-link:hover { background: var(--bg-elevated); color: var(--text); }
.lang-link.is-active { background: var(--bg-elevated); color: var(--accent); box-shadow: var(--shadow-sm); }
.lang-code { letter-spacing: .03em; }
@media (max-width: 520px) { .lang-code { display: none; } }

/* ==========================================================================
   Page shell
   ========================================================================== */

.page {
    flex: 1 0 auto;
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 28px 16px 64px;
}

.progress { margin-bottom: 20px; }
.progress-track {
    height: 6px; border-radius: 99px; background: var(--bg-sunken); overflow: hidden;
}
.progress-fill {
    height: 100%; border-radius: 99px;
    background: linear-gradient(90deg, var(--eu-blue), var(--eu-blue-light));
    transition: width .4s cubic-bezier(.22, .61, .36, 1);
}
:root[data-theme="dark"] .progress-fill { background: linear-gradient(90deg, #4a73e0, #7ba0ff); }
.progress-text { margin: 8px 0 0; font-size: 12.5px; color: var(--text-muted); font-weight: 500; }

.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 32px;
}
@media (max-width: 560px) { .card { padding: 22px 18px; border-radius: var(--radius); } }

.card--hero { border-top: 4px solid var(--eu-gold); }
.card--terminal { text-align: center; }
.card--terminal .lead, .card--terminal .muted { margin-left: auto; margin-right: auto; max-width: 52ch; }

.eyebrow {
    margin: 0 0 8px;
    font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
    color: var(--accent);
}
.card-title { margin: 0 0 12px; font-size: 27px; font-weight: 700; }
@media (max-width: 560px) { .card-title { font-size: 23px; } }

.lead { margin: 0 0 24px; font-size: 16.5px; color: var(--text-muted); }
.muted { color: var(--text-muted); font-size: 14.5px; }

/* Intro panels */
.panel-grid { display: grid; gap: 16px; margin-bottom: 24px; }
@media (min-width: 640px) { .panel-grid { grid-template-columns: 1fr 1fr; } }

.panel {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.panel-title { margin: 0 0 12px; font-size: 14px; font-weight: 700; letter-spacing: -.01em; }

.steps-list, .check-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.steps-list { counter-reset: s; }
.steps-list li, .check-list li {
    position: relative; padding-left: 30px; font-size: 14.5px; color: var(--text-muted);
}
.steps-list li { counter-increment: s; }
.steps-list li::before {
    content: counter(s);
    position: absolute; left: 0; top: 1px;
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--accent-soft); color: var(--accent);
    font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
.check-list li::before {
    content: '';
    position: absolute; left: 3px; top: 8px;
    width: 12px; height: 7px;
    border-left: 2px solid var(--success); border-bottom: 2px solid var(--success);
    transform: rotate(-45deg);
}

.notice {
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 26px;
    font-size: 14.5px;
}
.notice p { margin: 0; color: var(--text-muted); }
.notice-title { margin: 0 0 6px; font-size: 14px; font-weight: 700; }
.notice--privacy {
    background: var(--accent-soft);
    border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.notice--privacy .notice-title { color: var(--accent); }

.alert {
    border-radius: var(--radius-sm);
    padding: 13px 16px;
    margin-bottom: 20px;
    font-size: 14.5px;
    font-weight: 500;
}
.alert--error { background: var(--danger-soft); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }

.terminal-icon {
    width: 52px; height: 52px; border-radius: 50%;
    display: grid; place-items: center; margin: 0 auto 18px;
}
.terminal-icon--good { background: var(--success-soft); color: var(--success); }
.terminal-icon--neutral { background: var(--bg-sunken); color: var(--text-muted); }

.ref-chip {
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 17px; font-weight: 600; letter-spacing: .06em;
    background: var(--bg-sunken); border: 1px dashed var(--border-strong);
    padding: 10px 18px; border-radius: var(--radius-sm);
    margin: 0 0 22px;
}

/* ==========================================================================
   Questions
   ========================================================================== */

.form { margin: 0; }

.q-section { margin-bottom: 36px; }
.q-section + .q-section { padding-top: 32px; border-top: 1px solid var(--border); }
.q-section-count {
    margin: 0 0 4px;
    font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--text-faint);
}
.q-section-title { margin: 0 0 6px; font-size: 19px; font-weight: 700; }
.q-section-intro { margin: 0 0 22px; font-size: 14.5px; color: var(--text-muted); }

.q {
    border: 0; padding: 0; margin: 0 0 28px; min-width: 0;
}
.q--error {
    border-left: 3px solid var(--danger);
    padding-left: 16px;
    margin-left: -19px;
}
.q-label {
    padding: 0; margin: 0 0 4px;
    font-size: 15.5px; font-weight: 600; line-height: 1.45;
    display: block;
}
.q-req { color: var(--danger); margin-left: 3px; }
.q-opt { color: var(--text-faint); font-weight: 400; font-size: 13.5px; }
.q-help { margin: 0 0 12px; font-size: 13.5px; color: var(--text-muted); }
.q-label + .q-field, .q-label + .q-options, .q-label + .q-scale { margin-top: 12px; }

.q-field { margin-bottom: 4px; }
.q-field--other { margin-top: 10px; }
.q-other-label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 5px; }

.q-input, .q-select, .q-textarea {
    width: 100%;
    font: inherit;
    font-size: 15.5px;
    color: var(--text);
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 11px 13px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.q-textarea { resize: vertical; min-height: 96px; line-height: 1.6; }
.q-select {
    appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%235b6478' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}
.q-input:focus, .q-select:focus, .q-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
    outline: none;
}
.q--error .q-input, .q--error .q-select, .q--error .q-textarea { border-color: var(--danger); }

.char-count { margin: 6px 0 0; font-size: 12px; color: var(--text-faint); text-align: right; }

.q-error { margin: 8px 0 0; font-size: 13.5px; color: var(--danger); font-weight: 500; }

/* Radio / checkbox options */
.q-options { display: grid; gap: 8px; }
@media (min-width: 620px) {
    .q-options--multi { grid-template-columns: 1fr 1fr; }
}

.opt {
    display: flex; align-items: flex-start; gap: 11px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    cursor: pointer;
    font-size: 15px;
    transition: border-color .12s ease, background .12s ease;
}
.opt:hover { border-color: var(--border-strong); background: var(--surface-alt); }
.opt input { position: absolute; opacity: 0; width: 0; height: 0; }

.opt-mark {
    flex: 0 0 auto;
    width: 19px; height: 19px; margin-top: 2px;
    border: 2px solid var(--border-strong);
    border-radius: 50%;
    position: relative;
    transition: border-color .12s ease, background .12s ease;
}
.opt-mark--box { border-radius: 5px; }

.opt input:checked ~ .opt-mark { border-color: var(--accent); background: var(--accent); }
.opt input:checked ~ .opt-mark::after {
    content: '';
    position: absolute; left: 50%; top: 50%;
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--accent-contrast);
    transform: translate(-50%, -50%);
}
.opt input:checked ~ .opt-mark--box::after {
    width: 9px; height: 5px; border-radius: 0;
    background: none;
    border-left: 2px solid var(--accent-contrast);
    border-bottom: 2px solid var(--accent-contrast);
    transform: translate(-50%, -65%) rotate(-45deg);
}
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.opt:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.opt-text { flex: 1; }

/* Likert scale */
.q-scale {
    display: grid;
    gap: 8px;
    align-items: center;
    grid-template-columns: 1fr;
}
@media (min-width: 620px) {
    .q-scale { grid-template-columns: auto 1fr auto; gap: 14px; }
}
.q-scale-end { font-size: 13px; color: var(--text-muted); }
.q-scale-end--max { text-align: right; }
@media (max-width: 619px) { .q-scale-end--max { text-align: left; } }

.q-scale-points { display: grid; grid-auto-flow: column; gap: 6px; }
.scale-point { cursor: pointer; }
.scale-point input { position: absolute; opacity: 0; width: 0; height: 0; }
.scale-dot {
    display: grid; place-items: center;
    height: 46px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    font-size: 14.5px; font-weight: 600; color: var(--text-muted);
    transition: all .12s ease;
}
.scale-point:hover .scale-dot { border-color: var(--border-strong); background: var(--surface-alt); }
.scale-point input:checked ~ .scale-dot {
    background: var(--accent); border-color: var(--accent); color: var(--accent-contrast);
}
.scale-point input:focus-visible ~ .scale-dot { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Consent checkbox */
.consent {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface-alt);
    cursor: pointer;
    font-size: 14.5px;
    margin: 0 0 22px;
}
.consent input { position: absolute; opacity: 0; width: 0; height: 0; }
.consent:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.consent:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.consent--error { border-color: var(--danger); background: var(--danger-soft); }
.consent-text { flex: 1; line-height: 1.55; }

/* Buttons */
.form-actions { margin-top: 28px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: inherit; font-weight: 600; font-size: 15px;
    padding: 12px 22px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, transform .06s ease;
}
.btn:active { transform: translateY(1px); }
.btn-lg { padding: 14px 28px; font-size: 16px; width: 100%; }
@media (min-width: 560px) { .btn-lg { width: auto; min-width: 240px; } }

.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { background: var(--eu-blue-light); color: var(--accent-contrast); }
:root[data-theme="dark"] .btn-primary:hover { background: #8aa9f7; }
.btn-primary.is-busy { opacity: .6; cursor: progress; }

.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--surface-alt); color: var(--text); }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    flex: 0 0 auto;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    margin-top: auto;
}
.footer-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 36px 16px 44px;
    display: grid;
    gap: 32px;
}

.footer-title {
    margin: 0 0 12px;
    font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--text-faint);
}

.footer-eu { display: grid; gap: 18px; }
@media (min-width: 620px) { .footer-eu { grid-template-columns: auto 1fr; gap: 22px; } }
.footer-eu-emblem .eu-emblem { border-radius: 3px; box-shadow: var(--shadow-sm); }

.meta-list { margin: 0 0 14px; display: grid; gap: 7px; }
.meta-row { display: grid; gap: 2px; font-size: 13.5px; }
@media (min-width: 560px) { .meta-row { grid-template-columns: 170px 1fr; gap: 12px; } }
.meta-row dt { color: var(--text-faint); font-weight: 500; }
.meta-row dd { margin: 0; color: var(--text-muted); }

.disclaimer {
    margin: 0;
    font-size: 12.5px; line-height: 1.65; color: var(--text-faint);
    border-left: 3px solid var(--eu-gold);
    padding-left: 13px;
}

.footer-legal { border-top: 1px solid var(--border); padding-top: 28px; }
.footer-legal-body { margin: 0 0 14px; font-size: 13.5px; color: var(--text-muted); line-height: 1.7; }

.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 16px; }
.footer-links a { font-size: 13.5px; color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent); text-decoration: underline; }

.footer-copy { margin: 0; font-size: 12.5px; color: var(--text-faint); }

/* ==========================================================================
   Privacy notice page
   ========================================================================== */

.prose { max-width: 68ch; }
.prose h2 {
    margin: 34px 0 10px;
    font-size: 19px; font-weight: 700;
    scroll-margin-top: 24px;
}
.prose h2:first-of-type { margin-top: 0; }
.prose h3 { margin: 22px 0 6px; font-size: 15.5px; font-weight: 700; }
.prose p, .prose li { color: var(--text-muted); font-size: 15px; }
.prose ul { padding-left: 20px; display: grid; gap: 6px; }
.prose table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 14px; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { color: var(--text); font-weight: 600; width: 34%; }
.prose td { color: var(--text-muted); }

.toc {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 30px;
}
.toc h2 { margin: 0 0 10px !important; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
.toc ol { margin: 0; padding-left: 18px; display: grid; gap: 5px; }
.toc a { font-size: 14px; }

/* ==========================================================================
   Admin
   ========================================================================== */

.admin-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; background: var(--bg-elevated); }
.admin-table th, .admin-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.admin-table th { background: var(--surface-alt); font-weight: 600; font-size: 12px; letter-spacing: .03em; text-transform: uppercase; color: var(--text-faint); position: sticky; top: 0; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table td.wrap { white-space: normal; max-width: 320px; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; }
.pill--completed { background: var(--success-soft); color: var(--success); }
.pill--qualified { background: var(--accent-soft); color: var(--accent); }
.pill--disqualified { background: var(--bg-sunken); color: var(--text-muted); }
.pill--screening { background: var(--bg-sunken); color: var(--text-faint); }
.pill--flag { background: #fef3c7; color: #92400e; }
:root[data-theme="dark"] .pill--flag { background: #3a2c0c; color: #fbbf24; }

.stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 26px; }
.stat {
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 18px;
}
.stat-value { font-size: 26px; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--text-faint); margin-top: 4px; text-transform: uppercase; letter-spacing: .05em; }

@media print {
    .eu-banner, .site-header, .footer-links, .btn { display: none !important; }
    body { background: #fff; }
    .card { box-shadow: none; border: 0; padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
