:root {
    --amsive-purple: #7C0080;
    --amsive-purple-dark: #5D0060;
    --amsive-purple-soft: #F8EEF8;
    --amsive-charcoal: #262626;
    --amsive-ink: #343038;
    --amsive-muted: #6F6872;
    --amsive-line: #E7E1E8;
    --amsive-canvas: #F6F4F7;
    --amsive-white: #FFFFFF;
    --shadow-sm: 0 1px 2px rgba(38, 38, 38, .05), 0 8px 24px rgba(38, 38, 38, .06);
    --shadow-md: 0 18px 50px rgba(38, 38, 38, .10);
}

* { box-sizing: border-box; }
html { min-height: 100%; }

body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background: var(--amsive-canvas);
    color: var(--amsive-ink);
    font-family: "Segoe UI", Inter, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--amsive-purple); }
a:hover, a:focus { color: var(--amsive-purple-dark); }

.site-header {
    position: relative;
    z-index: 10;
    background: #fff;
    border-bottom: 3px solid var(--amsive-purple);
    box-shadow: 0 5px 24px rgba(38,38,38,.06);
}

.site-header__inner,
.site-footer__inner,
.site-main {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.site-header__inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: var(--amsive-charcoal);
    text-decoration: none;
}

.brand-lockup:hover, .brand-lockup:focus { color: var(--amsive-charcoal); text-decoration: none; }

.brand-logo { display: block; width: 148px; height: auto; }
.brand-divider { width: 1px; height: 30px; background: #D8D1D9; }

.brand-product {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #6F6872;
}

.internal-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: 1px solid #DDD6DE;
    border-radius: 999px;
    color: #5B555D;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.internal-badge__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amsive-purple); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.admin-link {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 7px 12px;
    border-radius: 8px;
    background: var(--amsive-purple-soft);
    color: var(--amsive-purple);
    font-size: 13px;
    font-weight: 750;
    text-decoration: none;
}
.admin-link:hover, .admin-link:focus { background: #F0DDF1; color: var(--amsive-purple-dark); text-decoration: none; }
.site-main { padding: 48px 0 56px; }

.site-footer {
    background: #fff;
    border-top: 1px solid var(--amsive-line);
    color: var(--amsive-muted);
}

.site-footer__inner {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    font-size: 13px;
}

.site-footer p { margin: 0; }
.generic-login {
    max-width: 900px;
    margin: 36px auto 72px;
    display: grid;
    grid-template-columns: .9fr 1.1fr;
    overflow: hidden;
    border: 1px solid var(--amsive-line);
    border-radius: 22px;
    background: #fff;
    box-shadow: var(--shadow-md);
}
.generic-login__intro { padding: 46px 42px; background: var(--amsive-charcoal); color: #fff; }
.generic-login__intro h1 { margin: 8px 0 14px; color: #fff; font-size: 34px; line-height: 1.12; }
.generic-login__intro p:last-child { margin: 0; color: #D7D2D8; }
.generic-login__form { padding: 38px; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.generic-login__submit { width: 100%; margin-top: 4px; }
.login-option h2 { margin: 0 0 6px; color: var(--amsive-charcoal); font-size: 20px; }
.login-option > p { margin: 0 0 16px; color: var(--amsive-muted); font-size: 14px; }
.login-option--admin { padding: 18px; border: 1px solid var(--amsive-line); border-radius: 12px; background: var(--amsive-purple-soft); }
.login-divider { display: flex; align-items: center; gap: 12px; color: var(--amsive-muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--amsive-line); }
.admin-login-button { display: block; padding: 11px 16px; border: 1px solid var(--amsive-purple); border-radius: 9px; color: var(--amsive-purple); font-weight: 750; text-align: center; text-decoration: none; }
.admin-login-button:hover, .admin-login-button:focus { background: var(--amsive-purple); color: #fff; text-decoration: none; }
.login-message { padding: 11px 13px; border: 1px solid #E7B9C0; border-radius: 9px; background: #FFF4F5; color: #8D1428; font-weight: 650; }
.login-message--success { border-color: #B9DDC5; background: #F1FBF4; color: #246B3B; }
.field-error { display: block; margin-top: 6px; color: #A21A32; font-size: 13px; font-weight: 650; }
.verification-code { font-size: 24px !important; font-weight: 750; letter-spacing: .28em; text-align: center; }
.login-secondary-action { display: block; margin-top: 12px; color: var(--amsive-purple); font-size: 13px; font-weight: 700; text-align: center; }
.assessment-shell { width: 100%; }

.assessment-hero {
    position: relative;
    overflow: hidden;
    padding: 46px 48px;
    border-radius: 24px;
    background: var(--amsive-charcoal);
    color: #fff;
    box-shadow: var(--shadow-md);
}

.assessment-hero::after {
    content: "";
    position: absolute;
    width: 360px;
    height: 360px;
    right: -150px;
    top: -190px;
    border: 60px solid rgba(124,0,128,.72);
    border-radius: 50%;
}

.eyebrow {
    position: relative;
    z-index: 1;
    margin: 0 0 12px;
    color: #E9A7EB;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.assessment-hero h1 {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0;
    color: #fff;
    font-size: clamp(34px, 5vw, 56px);
    line-height: 1.04;
    letter-spacing: -.035em;
    font-weight: 750;
}

.assessment-hero__copy {
    position: relative;
    z-index: 1;
    max-width: 670px;
    margin: 18px 0 0;
    color: rgba(255,255,255,.72);
    font-size: 17px;
}

.assessment-meta {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.assessment-meta span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 11px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 8px;
    color: rgba(255,255,255,.82);
    font-size: 13px;
}

.assessment-meta span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #D55BD8; }

.participant-card, .instruction-card, .progress-card {
    margin-top: 24px;
    border: 1px solid var(--amsive-line);
    border-radius: 16px;
    background: var(--amsive-white);
    box-shadow: var(--shadow-sm);
}

.participant-card { padding: 28px 30px 30px; }
.section-kicker { margin: 0 0 4px; color: var(--amsive-purple); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.participant-card h2 { margin: 0 0 22px; color: var(--amsive-charcoal); font-size: 24px; line-height: 1.25; font-weight: 700; }
.participant-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.field-group label { display: block; margin-bottom: 7px; color: var(--amsive-charcoal); font-size: 13px; font-weight: 700; }

input[type="text"], input[type="password"] {
    width: 100%;
    max-width: none;
    min-height: 46px;
    padding: 10px 13px;
    border: 1px solid #CFC7D0;
    border-radius: 9px;
    background: #fff;
    color: var(--amsive-charcoal);
    box-shadow: inset 0 1px 2px rgba(38,38,38,.03);
    transition: border-color .18s ease, box-shadow .18s ease;
}

input[type="text"]:focus, input[type="password"]:focus {
    outline: none;
    border-color: var(--amsive-purple);
    box-shadow: 0 0 0 3px rgba(124,0,128,.12);
}

.validation-row { margin-top: 10px; color: #A21A32; font-size: 13px; }
.validation-row span { display: block; margin-top: 3px; }

.instruction-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    align-items: start;
    padding: 22px 24px;
    border-left: 4px solid var(--amsive-purple);
}

.instruction-number { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--amsive-purple-soft); color: var(--amsive-purple); font-weight: 800; }
.instruction-card h2 { margin: 0 0 4px; font-size: 17px; color: var(--amsive-charcoal); }
.instruction-card p { margin: 0; color: var(--amsive-muted); font-size: 14px; }
.progress-card { padding: 18px 20px; }
.progress-card__top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: 13px; font-weight: 700; }
.progress-card__top span:last-child { color: var(--amsive-purple); }
.progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: #EDE8EE; }
.progress-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--amsive-purple), #B635BA); transition: width .25s ease; }

.assessment-table {
    width: 100%;
    margin: 24px 0 0 !important;
    border-collapse: separate;
    border-spacing: 0 12px;
}

.assessment-table > tbody > tr:first-child > td { padding: 0 14px 4px; color: var(--amsive-muted); font-size: 11px; font-weight: 800; letter-spacing: .11em; text-align: center; text-transform: uppercase; }
.assessment-table > tbody > tr:first-child > td:nth-child(2) { text-align: left; }

.assessment-table > tbody > tr:not(:first-child) > td {
    padding: 22px 14px;
    background: var(--amsive-white);
    border-top: 1px solid var(--amsive-line);
    border-bottom: 1px solid var(--amsive-line);
    vertical-align: middle;
}

.assessment-table > tbody > tr:not(:first-child) > td:first-child { width: 62px; border-left: 1px solid var(--amsive-line); border-radius: 14px 0 0 14px; color: var(--amsive-purple); font-size: 18px; font-weight: 800; text-align: center; }
.assessment-table > tbody > tr:not(:first-child) > td:nth-child(2) { width: auto; }
.assessment-table > tbody > tr:not(:first-child) > td:nth-child(3), .assessment-table > tbody > tr:not(:first-child) > td:nth-child(4) { width: 86px; text-align: center; }
.assessment-table > tbody > tr:not(:first-child) > td:last-child { width: 160px; border-right: 1px solid var(--amsive-line); border-radius: 0 14px 14px 0; color: #A21A32; font-size: 12px; }
.assessment-table > tbody > tr:not(:first-child):hover > td { border-color: #DCCCDD; background: #FEFCFE; }
.assessment-table p { margin: 0; line-height: 2.08; color: #504A52; }
.assessment-table table { margin: 0 auto; border-collapse: collapse; }
.assessment-table table td { height: 32px; padding: 0; border: 0; }
.assessment-table input[type="radio"] { width: 19px; height: 19px; margin: 0; accent-color: var(--amsive-purple); cursor: pointer; }

.assessment-actions { display: flex; justify-content: flex-end; align-items: center; gap: 16px; margin-top: 24px; padding: 22px 24px; border: 1px solid var(--amsive-line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.assessment-actions__note { margin: 0 auto 0 0; color: var(--amsive-muted); font-size: 13px; }

.assessment-submit, input[type="submit"], .btn-primary {
    min-height: 46px;
    padding: 11px 22px;
    border: 1px solid var(--amsive-purple) !important;
    border-radius: 9px;
    background: var(--amsive-purple) !important;
    color: #fff !important;
    font-weight: 750;
    line-height: 1.2;
    box-shadow: 0 7px 18px rgba(124,0,128,.22);
    transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.assessment-submit:hover, .assessment-submit:focus, input[type="submit"]:hover, input[type="submit"]:focus { background: var(--amsive-purple-dark) !important; transform: translateY(-1px); box-shadow: 0 10px 24px rgba(124,0,128,.28); }
.form-horizontal, .content-card { padding: 30px; border: 1px solid var(--amsive-line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.text-danger { color: #A21A32; }

.completion-page {
    min-height: calc(100vh - 79px);
    display: grid;
    place-items: center;
    width: min(720px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0;
}

.completion-card {
    width: 100%;
    padding: 54px 48px;
    border: 1px solid var(--amsive-line);
    border-radius: 24px;
    background: #fff;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.completion-icon {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    margin: 0 auto 22px;
    border-radius: 50%;
    background: var(--amsive-purple-soft);
    color: var(--amsive-purple);
    font-size: 30px;
    font-weight: 800;
}
.completion-icon--locked { background: #F7E9EC; color: #A21A32; }
.admin-access-page { min-height: auto; padding: 32px 0; }
.access-actions { margin-top: 24px !important; }

.completion-card h1 { margin: 5px 0 14px; color: var(--amsive-charcoal); font-size: clamp(30px, 5vw, 42px); line-height: 1.1; letter-spacing: -.03em; }
.completion-card > p:last-child { max-width: 560px; margin: 0 auto; color: var(--amsive-muted); }

.results-page { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 48px 0 56px; }
.admin-shell { width: 100%; }
.results-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.results-heading h1 { margin: 4px 0 8px; color: var(--amsive-charcoal); font-size: clamp(30px, 4vw, 44px); letter-spacing: -.03em; }
.results-heading p:last-child { margin: 0; color: var(--amsive-muted); }
.text-link { padding: 10px 14px; border: 1px solid #D7CCD8; border-radius: 9px; background: #fff; font-size: 13px; font-weight: 750; text-decoration: none; white-space: nowrap; }
.text-link:hover, .text-link:focus { border-color: var(--amsive-purple); text-decoration: none; }

.admin-identity {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 12px 14px;
    border: 1px solid var(--amsive-line);
    border-radius: 10px;
    background: #fff;
    color: var(--amsive-charcoal);
    font-size: 13px;
    white-space: nowrap;
}
.admin-identity__label { color: var(--amsive-muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

.score-legend {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}
.score-legend > div {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 10px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--amsive-line);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}
.score-legend strong { color: var(--amsive-charcoal); font-size: 14px; }
.score-legend small { grid-column: 2; color: var(--amsive-muted); font-size: 11px; }
.score-badge { grid-row: 1 / 3; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: #fff; font-weight: 800; }
.score-badge--d { background: #7C0080; }
.score-badge--i { background: #AA3D81; }
.score-badge--s { background: #4E6573; }
.score-badge--c { background: #262626; }

.filter-card {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    padding: 22px;
    border: 1px solid var(--amsive-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.filter-field { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.filter-field label { grid-column: 1 / -1; color: var(--amsive-charcoal); font-size: 13px; font-weight: 700; }
.filter-field input[type="submit"] { min-height: 46px; padding: 10px 16px; }
.results-table-card { margin-top: 22px; overflow-x: auto; border: 1px solid var(--amsive-line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.results-table { width: 100%; min-width: 820px; border-collapse: collapse; }
.results-table th { padding: 14px 16px; background: var(--amsive-charcoal); color: #fff; font-size: 12px; letter-spacing: .05em; text-align: left; text-transform: uppercase; }
.results-table td { padding: 14px 16px; border-bottom: 1px solid var(--amsive-line); color: #514B53; font-size: 14px; }
.results-table tr:nth-child(even) td { background: #FBF9FB; }
.results-table tr:hover td { background: var(--amsive-purple-soft); }
.results-pager td { padding: 14px; background: #fff !important; }
.results-pager a, .results-pager span { display: inline-grid; min-width: 30px; height: 30px; place-items: center; margin: 0 2px; border-radius: 7px; }
.results-pager span { background: var(--amsive-purple); color: #fff; }

@media (max-width: 820px) {
    .generic-login { grid-template-columns: 1fr; margin-top: 12px; }
    .generic-login__intro, .generic-login__form { padding: 30px 26px; }
    .site-header__inner, .site-footer__inner, .site-main { width: min(100% - 28px, 1180px); }
    .site-main { padding: 28px 0 40px; }
    .assessment-hero { padding: 34px 28px; border-radius: 18px; }
    .participant-grid { grid-template-columns: 1fr; }
    .assessment-table { display: block; overflow-x: auto; padding-bottom: 8px; }
    .assessment-table > tbody > tr:not(:first-child) > td:nth-child(2) { min-width: 280px; }
    .assessment-table > tbody > tr:not(:first-child) > td:last-child { min-width: 150px; }
    .results-page { width: min(100% - 28px, 1240px); padding-top: 30px; }
    .filter-card { grid-template-columns: 1fr; }
    .score-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .brand-divider, .brand-product { display: none; }
    .internal-badge { padding: 6px 9px; }
    .site-footer__inner { min-height: 100px; flex-direction: column; justify-content: center; align-items: flex-start; gap: 4px; }
    .assessment-hero { padding: 30px 22px; }
    .assessment-hero__copy { font-size: 15px; }
    .participant-card { padding: 24px 20px; }
    .instruction-card { padding: 18px; }
    .assessment-actions { align-items: stretch; flex-direction: column; }
    .assessment-actions__note { margin: 0; }
    .header-actions { gap: 6px; }
    .admin-link { padding: 7px 9px; font-size: 12px; }
    .results-heading { align-items: flex-start; flex-direction: column; }
    .admin-identity { align-items: flex-start; width: 100%; }
    .score-legend { grid-template-columns: 1fr; }
}

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