/*
 * SEHER Confidential Survey: shared brand theme.
 * Loaded after each page's own styles, so these rules win.
 * Colours come from public/assets/logo.jpg (navy stripes, orange badge).
 */

:root {
    --brand-navy: #1c2b4f;
    --brand-navy-700: #24375f;
    --brand-navy-900: #111c36;
    --brand-orange: #f47f20;
    --brand-orange-600: #e06d0f;
    --brand-orange-50: #fff4ea;
    --brand-bg: #f5f6fa;
    --brand-surface: #ffffff;
    --brand-line: #e3e7ef;
    --brand-ink: #1a2440;
    --brand-muted: #667085;
    --brand-radius: 14px;
    --brand-shadow: 0 1px 2px rgba(17, 28, 54, .04), 0 8px 24px rgba(17, 28, 54, .06);
    --page: #f5f6fa;
    --ink: #1a2440;
    --muted: #667085;
    --line: #e3e7ef;
    --accent: #f47f20;
    --brand-font: "Inter", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;

    --bs-body-font-family: var(--brand-font);
    --bs-body-color: var(--brand-ink);
    --bs-link-color: var(--brand-navy-700);
    --bs-link-color-rgb: 36, 55, 95;
    --bs-link-hover-color: var(--brand-orange-600);
    --bs-link-hover-color-rgb: 224, 109, 15;
    --bs-primary: var(--brand-navy);
    --bs-primary-rgb: 28, 43, 79;
}

body {
    background: var(--brand-bg);
    color: var(--brand-ink);
    font-family: var(--brand-font);
    -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(244, 127, 32, .22); }

/* ---------- Logo ---------- */

.brand-logo {
    display: block;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(17, 28, 54, .12);
    background: #fff;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
}

.brand-lockup .brand-logo { width: 46px; }

.brand-lockup-name {
    font-weight: 800;
    letter-spacing: .14em;
    font-size: 15px;
    line-height: 1.1;
}

.brand-lockup-sub {
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    opacity: .72;
    margin-top: 3px;
}

.brand-rule {
    height: 4px;
    background: linear-gradient(90deg, var(--brand-orange) 0 30%, var(--brand-navy) 30% 100%);
}

/* ---------- Buttons ---------- */

.btn {
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: .01em;
}

.btn-dark,
.btn-primary {
    --bs-btn-bg: var(--brand-navy);
    --bs-btn-border-color: var(--brand-navy);
    --bs-btn-hover-bg: var(--brand-navy-900);
    --bs-btn-hover-border-color: var(--brand-navy-900);
    --bs-btn-active-bg: var(--brand-navy-900);
    --bs-btn-active-border-color: var(--brand-navy-900);
    --bs-btn-disabled-bg: var(--brand-navy);
    --bs-btn-disabled-border-color: var(--brand-navy);
    --bs-btn-focus-shadow-rgb: 28, 43, 79;
}

.btn-brand,
.btn-create,
.btn-update {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--brand-orange);
    --bs-btn-border-color: var(--brand-orange);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--brand-orange-600);
    --bs-btn-hover-border-color: var(--brand-orange-600);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--brand-orange-600);
    --bs-btn-active-border-color: var(--brand-orange-600);
    --bs-btn-focus-shadow-rgb: 244, 127, 32;
    box-shadow: 0 6px 16px rgba(244, 127, 32, .28);
}

.btn-outline-primary,
.btn-outline-dark {
    --bs-btn-color: var(--brand-navy);
    --bs-btn-border-color: #c7cfdd;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--brand-navy);
    --bs-btn-hover-border-color: var(--brand-navy);
    --bs-btn-active-bg: var(--brand-navy-900);
    --bs-btn-active-border-color: var(--brand-navy-900);
}

.btn-outline-secondary {
    --bs-btn-color: #475467;
    --bs-btn-border-color: #d0d5dd;
    --bs-btn-hover-color: var(--brand-navy);
    --bs-btn-hover-bg: #f2f4f8;
    --bs-btn-hover-border-color: #c0c7d4;
    --bs-btn-active-color: var(--brand-navy);
    --bs-btn-active-bg: #e8ebf2;
}

/* ---------- Forms ---------- */

.form-control,
.form-select {
    border-radius: 10px;
    border-color: #d0d5dd;
}

.form-control:focus,
.form-select:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    border-color: var(--brand-orange) !important;
    box-shadow: 0 0 0 .22rem rgba(244, 127, 32, .18) !important;
    outline: none;
}

.form-check-input:checked {
    background-color: var(--brand-navy);
    border-color: var(--brand-navy);
}

.form-check-input:focus {
    border-color: var(--brand-orange);
    box-shadow: 0 0 0 .22rem rgba(244, 127, 32, .18);
}

/* ---------- Cards, tables, alerts ---------- */

.card,
.card-custom,
.stat-card,
.survey-card {
    border: 1px solid var(--brand-line) !important;
    border-radius: var(--brand-radius) !important;
    box-shadow: var(--brand-shadow) !important;
}

.card-header {
    background: #fbfcfe;
    border-bottom: 1px solid var(--brand-line);
}

.table > thead th,
.table th {
    color: #475467;
    font-size: 12px;
    letter-spacing: .06em;
    text-transform: uppercase;
    background: #f8f9fc;
}

.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #fbf7f2; }

.alert { border-radius: 12px; }

.progress-bar,
.progress .progress-bar { background-color: var(--brand-orange); }

.text-primary { color: var(--brand-navy) !important; }
.bg-primary { background-color: var(--brand-navy) !important; }

/* ================================================================
   ADMIN SHELL (sidebar + topbar)
   ================================================================ */

.sidebar {
    background: linear-gradient(180deg, var(--brand-navy) 0%, var(--brand-navy-900) 100%) !important;
    box-shadow: 4px 0 24px rgba(17, 28, 54, .12);
    display: flex;
    flex-direction: column;
}

.sidebar::before {
    content: "";
    display: block;
    height: 4px;
    background: var(--brand-orange);
}

.sidebar-brand {
    padding: 26px 22px 22px !important;
    border-bottom: 1px solid rgba(255, 255, 255, .08) !important;
}

.sidebar-brand .brand-logo {
    width: 92px;
    margin: 0 auto 14px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .28);
}

.sidebar-brand-text {
    text-align: center;
    color: #fff;
    font-weight: 800;
    letter-spacing: .18em;
    font-size: 16px;
}

.sidebar-brand-text small {
    display: block;
    margin-top: 4px;
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .6);
}

.sidebar-label {
    padding: 0 14px 8px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .42);
}

.sidebar-menu { padding: 22px 14px !important; flex: 1; }

.sidebar-menu a {
    display: flex !important;
    align-items: center;
    gap: 11px;
    color: rgba(255, 255, 255, .74) !important;
    border-radius: 10px !important;
    font-weight: 500;
    transition: background .15s ease, color .15s ease;
}

.sidebar-menu a svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }

.sidebar-menu a:hover {
    background: rgba(255, 255, 255, .07) !important;
    color: #fff !important;
}

.sidebar-menu a.active {
    background: rgba(244, 127, 32, .16) !important;
    color: #fff !important;
    box-shadow: inset 3px 0 0 var(--brand-orange);
}

.sidebar-footer {
    padding: 16px 22px 22px;
    font-size: 11.5px;
    line-height: 1.5;
    color: rgba(255, 255, 255, .5);
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, .9) !important;
    backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--brand-line) !important;
    padding: 14px 30px !important;
}

.topbar-title {
    font-weight: 700;
    color: var(--brand-navy);
}

.topbar-context {
    color: var(--brand-muted);
    font-size: 13px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #344054;
    font-size: 14px;
}

.topbar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-orange-50);
    color: var(--brand-orange-600);
    font-weight: 700;
    font-size: 13px;
    border: 1px solid rgba(244, 127, 32, .3);
}

.page-title {
    color: var(--brand-navy);
    font-weight: 800 !important;
    letter-spacing: -.02em;
}

.page-description { color: var(--brand-muted) !important; }

.stat-number { color: var(--brand-navy); font-weight: 800; }

.status-active { background: #e7f6ee !important; color: #157347 !important; }
.status-draft { background: #fff4ea !important; color: #b45309 !important; }
.status-closed { background: #eef1f6 !important; color: #475467 !important; }

.confidential-box {
    background: var(--brand-orange-50) !important;
    border: 1px solid rgba(244, 127, 32, .25) !important;
    border-radius: 12px !important;
}

/* Survey builder (admin show page) */
.builder-nav a:hover { color: var(--brand-orange-600) !important; }

.section-header .section-code,
.survey-header .section-code {
    background: var(--brand-orange) !important;
    color: #fff !important;
}

/* ================================================================
   STANDALONE ADMIN PAGES (report, response, scoring)
   ================================================================ */

.app-bar {
    background: #fff;
    border-bottom: 1px solid var(--brand-line);
    box-shadow: 0 1px 0 rgba(17, 28, 54, .02);
}

.app-bar-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 12px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.app-bar .brand-lockup { color: var(--brand-navy); }

.app-bar-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.report-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(120deg, var(--brand-navy-900) 0%, var(--brand-navy) 55%, var(--brand-navy-700) 100%) !important;
    box-shadow: 0 18px 40px rgba(17, 28, 54, .18) !important;
}

.report-hero::after {
    content: "";
    position: absolute;
    right: -80px;
    top: -80px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ffb06b, var(--brand-orange) 60%, var(--brand-orange-600));
    opacity: .22;
    pointer-events: none;
}

.report-hero > * { position: relative; z-index: 1; }

.report-hero .eyebrow { color: #ffc28f !important; }

@media (max-width: 767px) {
    .app-bar-inner { padding: 10px 16px; }
    .app-bar .brand-lockup-sub { display: none; }
}

@media print {
    .app-bar { display: none !important; }
}

/* ================================================================
   RESPONDENT SURVEY
   ================================================================ */

.respondent-page {
    background:
        radial-gradient(1200px 500px at 50% -200px, rgba(28, 43, 79, .10), transparent 70%),
        var(--brand-bg);
    min-height: 100vh;
}

.survey-wrapper { max-width: 880px !important; }

.survey-header {
    position: relative;
    overflow: hidden;
    padding: 0 !important;
    border-radius: 20px !important;
    background: var(--brand-surface) !important;
    border: 1px solid var(--brand-line);
    box-shadow: var(--brand-shadow) !important;
}

.survey-hero-band {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 28px 32px;
    color: #fff;
    background:
        repeating-linear-gradient(180deg, rgba(255, 255, 255, .045) 0 12px, transparent 12px 24px),
        linear-gradient(120deg, var(--brand-navy-900), var(--brand-navy) 65%, var(--brand-navy-700));
    border-bottom: 4px solid var(--brand-orange);
}

.survey-hero-band .brand-logo {
    width: 96px;
    flex-shrink: 0;
    border-radius: 8px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .3);
}

.survey-hero-band .brand {
    color: #ffc28f !important;
    margin-bottom: 6px !important;
    letter-spacing: .16em !important;
}

.survey-hero-band .survey-title {
    color: #fff;
    margin-bottom: 0 !important;
}

.survey-header .survey-description {
    padding: 22px 32px 26px;
    color: #475467 !important;
}

.trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 32px 26px;
}

.trust-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #f2f4f8;
    color: var(--brand-navy);
    font-size: 12.5px;
    font-weight: 600;
}

.trust-chip svg { width: 14px; height: 14px; color: var(--brand-orange); }

.confidential-notice {
    background: var(--brand-orange-50) !important;
    border: 1px solid rgba(244, 127, 32, .28) !important;
    border-left: 4px solid var(--brand-orange) !important;
    border-radius: 14px !important;
    padding: 20px 22px !important;
}

.confidential-title { color: var(--brand-navy); }

.progress-card,
.section-step-card,
.question-card,
.submit-card {
    border: 1px solid var(--brand-line) !important;
    border-radius: var(--brand-radius) !important;
    box-shadow: var(--brand-shadow) !important;
}

.section-step-meta { color: var(--brand-orange-600) !important; letter-spacing: .04em; }
.section-step-name { color: var(--brand-navy) !important; }
.section-progress-track { background: #eceff5 !important; height: 6px !important; }
.section-progress-fill { background: linear-gradient(90deg, var(--brand-orange), #ff9d4d) !important; }

.section-header {
    background: linear-gradient(120deg, var(--brand-navy-900), var(--brand-navy)) !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 26px rgba(17, 28, 54, .16);
}

.section-code {
    background: var(--brand-orange) !important;
    color: #fff !important;
}

.section-description { color: rgba(255, 255, 255, .78) !important; }

.question-card { transition: border-color .15s ease, box-shadow .15s ease; }
.question-card:focus-within {
    border-color: rgba(244, 127, 32, .55) !important;
    box-shadow: 0 0 0 4px rgba(244, 127, 32, .08), var(--brand-shadow) !important;
}

.question-number {
    background: #eef1f7 !important;
    color: var(--brand-navy);
}

.question-title { color: var(--brand-ink); }

.option {
    border-radius: 10px !important;
    border-color: #e3e7ef !important;
    background: #fff;
}

.option:hover {
    background: #fbf7f2 !important;
    border-color: rgba(244, 127, 32, .45) !important;
}

.option:has(input:checked) {
    background: var(--brand-orange-50) !important;
    border-color: var(--brand-orange) !important;
    box-shadow: 0 0 0 1px var(--brand-orange) inset;
    font-weight: 600;
    color: var(--brand-navy);
}

.option input,
.identity-choice input[type="radio"] { accent-color: var(--brand-orange); }

.section-nav-button,
.submit-btn {
    border-radius: 10px !important;
    border: 1px solid var(--brand-navy) !important;
    background: var(--brand-navy) !important;
    color: #fff !important;
    transition: background .15s ease, transform .15s ease;
}

.section-nav-button:hover,
.submit-btn:hover {
    background: var(--brand-navy-900) !important;
}

.section-nav-button:not(.secondary):last-child,
.submit-btn {
    background: var(--brand-orange) !important;
    border-color: var(--brand-orange) !important;
    box-shadow: 0 8px 18px rgba(244, 127, 32, .28);
}

.section-nav-button:not(.secondary):last-child:hover,
.submit-btn:hover {
    background: var(--brand-orange-600) !important;
    border-color: var(--brand-orange-600) !important;
}

.section-nav-button.secondary {
    background: #fff !important;
    color: var(--brand-navy) !important;
    border-color: #d0d5dd !important;
}

.section-nav-button.secondary:hover { background: #f2f4f8 !important; }

.survey-footer {
    color: #98a2b3 !important;
}

.survey-footer .brand-logo {
    width: 38px;
    margin: 0 auto 10px;
    opacity: .9;
}

@media (max-width: 768px) {
    .survey-hero-band { padding: 22px 20px; gap: 16px; }
    .survey-hero-band .brand-logo { width: 68px; }
    .survey-header .survey-description { padding: 18px 20px 20px; }
    .trust-row { padding: 0 20px 20px; }
    .section-navigation { background: rgba(245, 246, 250, .96) !important; }
}

/* ================================================================
   CENTRED CARD PAGES (sign in, thank you, invalid link)
   ================================================================ */

.center-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    background:
        radial-gradient(900px 420px at 50% -120px, rgba(28, 43, 79, .14), transparent 70%),
        var(--brand-bg);
}

.center-card {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border: 1px solid var(--brand-line);
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(17, 28, 54, .12);
    overflow: hidden;
}

.center-card-head {
    padding: 30px 32px 22px;
    text-align: center;
    background:
        repeating-linear-gradient(180deg, rgba(255, 255, 255, .045) 0 12px, transparent 12px 24px),
        linear-gradient(140deg, var(--brand-navy-900), var(--brand-navy));
    border-bottom: 4px solid var(--brand-orange);
    color: #fff;
}

.center-card-head .brand-logo {
    width: 104px;
    margin: 0 auto 14px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .32);
}

.center-card-head h1 {
    font-size: 22px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -.01em;
}

.center-card-head p {
    margin: 6px 0 0;
    font-size: 13.5px;
    color: rgba(255, 255, 255, .72);
}

.center-card-body { padding: 28px 32px 30px; }

.center-card-foot {
    padding: 14px 32px 18px;
    text-align: center;
    font-size: 12px;
    color: #98a2b3;
    border-top: 1px solid var(--brand-line);
    background: #fbfcfe;
}

/* Identity choice (first section of the survey) */
.identity-card {
    border: 1px solid var(--brand-line) !important;
    border-left: 4px solid var(--brand-orange) !important;
    border-radius: var(--brand-radius) !important;
    box-shadow: var(--brand-shadow);
    padding: 22px 24px !important;
}

.identity-card h2 { color: var(--brand-navy); }
.identity-card .hint { color: var(--brand-muted) !important; }

.identity-option {
    border-color: var(--brand-line) !important;
    border-radius: 10px !important;
    transition: border-color .15s ease, background .15s ease;
}

.identity-option:hover { border-color: rgba(244, 127, 32, .45) !important; background: #fbf7f2; }

.identity-option:has(input:checked) {
    border-color: var(--brand-orange) !important;
    background: var(--brand-orange-50) !important;
    box-shadow: 0 0 0 1px var(--brand-orange) inset;
}

.identity-option input { accent-color: var(--brand-orange); }

/* Status icon on thank-you / invalid link pages */
.status-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-icon svg { width: 30px; height: 30px; }
.status-icon.success { background: #e7f6ee; color: #157347; }
.status-icon.warning { background: var(--brand-orange-50); color: var(--brand-orange-600); }

.privacy-note {
    background: #f6f8fb;
    border: 1px solid var(--brand-line);
    border-radius: 12px;
    padding: 16px 18px;
    font-size: 14px;
    line-height: 1.6;
    color: #475467;
    text-align: left;
}

.privacy-note strong { display: block; color: var(--brand-navy); margin-bottom: 4px; }

/* Reason box shown after Disagree / Strongly Disagree */
.disagree-reason-wrap {
    margin-top: 14px;
    padding: 16px 18px;
    border-radius: 12px;
    background: var(--brand-orange-50);
    border: 1px solid rgba(244, 127, 32, .3);
    animation: reason-in .18s ease-out;
}

.disagree-reason-wrap label { color: var(--brand-navy); }

.disagree-reason-hint {
    font-size: 13px;
    line-height: 1.55;
    color: #5b6476;
    margin-bottom: 10px;
}

.disagree-reason-wrap textarea { background: #fff; min-height: 90px; }

@keyframes reason-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

/* Keep anchored sections clear of the sticky admin top bar */
.main-content [id] { scroll-margin-top: 84px; }
