/* CRRI™ — Enterprise Assessment Stylesheet */
/* Stratus Partners | Phase 1 Prototype */
/* Brand-aligned: Cormorant Garant + Outfit, Stratus purple palette */

:root {
    /* Stratus brand palette */
    --purple: #6b21a8;
    --purple-dk: #4c1d95;
    --purple-mid: #7c3aed;
    --purple-lt: #f3e8ff;
    --purple-muted: #ddd6fe;

    /* Neutral tones */
    --navy: #1a1a2e;
    --ink: #1e1e2e;
    --body: #475569;
    --muted: #64748b;
    --border: #e2e8f0;
    --off: #f8fafc;
    --white: #ffffff;

    /* Semantic aliases (used by JS) */
    --color-primary: var(--purple);
    --color-primary-light: var(--purple-mid);
    --color-accent: var(--purple);
    --color-bg: var(--off);
    --color-surface: var(--white);
    --color-border: var(--border);
    --color-text: var(--ink);
    --color-text-muted: var(--muted);

    /* Risk band colours */
    --risk-critical: #c0392b;
    --risk-high: #d35400;
    --risk-moderate: #f39c12;
    --risk-low: #27ae60;

    /* Typography */
    --fh: 'Cormorant Garant', Georgia, serif;
    --fb: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2.5rem;
    --space-2xl: 4rem;

    /* Sizing */
    --container-max: 720px;
    --r: 14px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--fb);
    color: var(--body);
    background: var(--white);
    line-height: 1.65;
    min-height: 100vh;
}

/* Container */
.crri-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--space-xl) 28px;
}

/* ==============================
   HEADER
   ============================== */

.crri-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.crri-logo-link {
    display: inline-block;
    margin-bottom: 20px;
    text-decoration: none;
}

.crri-logo {
    height: 38px;
    width: auto;
    object-fit: contain;
    max-width: 220px;
}

.crri-brand {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--purple);
    margin-bottom: 12px;
}

.crri-header h1 {
    font-family: var(--fh);
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 700;
    color: var(--ink);
    line-height: 1.08;
    letter-spacing: -0.02em;
    margin-bottom: 14px;
}

.crri-header .tm {
    font-size: 0.5em;
    vertical-align: super;
    color: var(--muted);
}

.crri-subtitle {
    font-size: 15px;
    color: var(--muted);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ==============================
   PROGRESS BAR
   ============================== */

.progress-container {
    margin-bottom: var(--space-xl);
}

.progress-track {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--purple), var(--purple-mid));
    border-radius: 2px;
    transition: width 0.4s ease;
}

/* ==============================
   STEPS
   ============================== */

.step {
    display: none;
}

.step.active {
    display: block;
    animation: fadeUp 0.4s ease both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.step h3 {
    font-family: var(--fh);
    font-size: clamp(22px, 2.5vw, 28px);
    font-weight: 700;
    color: var(--ink);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--purple);
}

.step-intro {
    font-size: 13.5px;
    color: var(--muted);
    margin-bottom: var(--space-lg);
    line-height: 1.7;
}

/* ==============================
   FORM GROUPS
   ============================== */

.form-group {
    margin-bottom: var(--space-lg);
}

.form-group > label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Inputs & Selects — matching Stratus contact form */
input[type="text"],
input[type="email"],
input[type="number"],
select {
    width: 100%;
    padding: 13px 16px;
    font-size: 14px;
    font-family: var(--fb);
    color: var(--ink);
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
}

input::placeholder,
select option[disabled] {
    color: #c4c9d4;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 2.75rem;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(107, 33, 168, 0.08);
}

/* ==============================
   VALIDATION ERROR STATE
   ============================== */

.has-error {
    border-color: var(--risk-critical) !important;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1) !important;
}

.radio-group.has-error {
    border: none !important;
    box-shadow: none !important;
    padding: var(--space-sm);
    border-radius: 10px;
    background: rgba(192, 57, 43, 0.04);
}

.field-error {
    display: block;
    font-size: 12.5px;
    color: var(--risk-critical);
    margin-top: var(--space-xs);
    min-height: 1.2em;
}

.radio-error {
    margin-top: 0.35rem;
}

/* ==============================
   RADIO GROUPS — Card-style options
   ============================== */

.radio-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--ink);
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.radio-label:hover {
    border-color: var(--purple-muted);
    background: var(--purple-lt);
}

.radio-label.is-selected {
    border-color: var(--purple);
    background: var(--purple-lt);
    font-weight: 500;
    box-shadow: 0 0 0 1px var(--purple);
}

.radio-label input[type="radio"] {
    accent-color: var(--purple);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ==============================
   NAVIGATION CONTROLS
   ============================== */

.nav-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border);
}

/* ==============================
   BUTTONS — Stratus style
   ============================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 26px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--fb);
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.22s ease;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--purple);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--purple-dk);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(107, 33, 168, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--muted);
    border: 1.5px solid var(--border);
    border-radius: 8px;
}

.btn-secondary:hover {
    border-color: var(--purple);
    color: var(--purple);
    background: var(--purple-lt);
}

.btn-large {
    padding: 15px 28px;
    font-size: 14px;
    border-radius: 8px;
}

/* Hidden Utility */
.hidden {
    display: none !important;
}

/* ==============================
   RESULTS SCREEN
   ============================== */

.results-screen {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.results-screen h2 {
    font-family: var(--fh);
    font-size: clamp(28px, 3.5vw, 40px);
    font-weight: 700;
    color: var(--ink);
    text-align: center;
    letter-spacing: -0.02em;
    line-height: 1.08;
    margin-bottom: var(--space-xl);
}

/* Score Hero — Dark card (matching Stratus dark sections) */
.results-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
    padding: var(--space-2xl) var(--space-xl);
    background: #0B0C10;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.results-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.07;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Ccircle cx='30' cy='30' r='1.5' fill='%236D28D9'/%3E%3C/svg%3E");
    background-size: 60px 60px;
    pointer-events: none;
}

.score-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.score-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: var(--space-sm);
}

.score-value {
    font-family: var(--fh);
    font-size: clamp(56px, 8vw, 80px);
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
}

.score-max {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.35);
    margin-top: var(--space-xs);
}

.risk-band-badge {
    display: inline-block;
    padding: 8px 24px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 50px;
    position: relative;
    z-index: 1;
}

/* Results Sections — Card-style */
.results-section {
    margin-bottom: 20px;
    padding: 28px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--r);
    transition: box-shadow 0.25s ease;
}

.results-section:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.results-section h3 {
    font-family: var(--fb);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--purple);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border);
}

.exposure-figure {
    font-family: var(--fh);
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 700;
    color: var(--risk-high);
    letter-spacing: -0.01em;
}

.benchmark-text {
    font-size: 14px;
    color: var(--body);
    line-height: 1.7;
}

/* Domain Breakdown Bars */
.domain-breakdown {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.domain-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.domain-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.domain-title {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink);
}

.domain-score {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    font-family: var(--font-mono);
}

.domain-bar-track {
    height: 8px;
    background: var(--off);
    border-radius: 4px;
    overflow: hidden;
}

.domain-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--purple), var(--purple-mid));
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Ordered Lists (risks & recs) */
.results-section ol {
    padding-left: 1.25rem;
}

.results-section ol li {
    font-size: 14px;
    color: var(--body);
    line-height: 1.7;
    margin-bottom: var(--space-sm);
}

.results-section ol li::marker {
    color: var(--purple);
    font-weight: 700;
}

/* ==============================
   DOWNLOAD REPORT BUTTON
   ============================== */

.results-actions {
    text-align: center;
    margin-bottom: 20px;
}

.btn-download {
    width: 100%;
    padding: 16px 28px;
    font-size: 15px;
    border-radius: 12px;
    gap: 10px;
    background: var(--ink);
    color: var(--white);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
}

.btn-download::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(107, 33, 168, 0.15) 0%, rgba(124, 58, 237, 0.08) 100%);
    pointer-events: none;
}

.btn-download:hover {
    background: var(--purple-dk);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(107, 33, 168, 0.3);
}

.btn-download svg {
    flex-shrink: 0;
}

/* ==============================
   CTA BLOCK — Stratus purple gradient
   ============================== */

.results-cta {
    text-align: center;
    padding: var(--space-2xl) var(--space-xl);
    background: linear-gradient(135deg, #6D28D9 0%, #4c1d95 100%);
    border-radius: 20px;
    color: #ffffff;
    margin-top: var(--space-xl);
    position: relative;
    overflow: hidden;
}

.results-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.08;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Ccircle cx='30' cy='30' r='1.5' fill='%23ffffff'/%3E%3C/svg%3E");
    background-size: 60px 60px;
    pointer-events: none;
}

.results-cta h3 {
    font-family: var(--fh);
    font-size: clamp(22px, 2.5vw, 30px);
    font-weight: 700;
    color: #ffffff;
    border-bottom: none;
    margin-bottom: 12px;
    padding-bottom: 0;
    letter-spacing: -0.02em;
    text-transform: none;
    position: relative;
    z-index: 1;
}

.results-cta p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
    max-width: 420px;
    margin: 0 auto var(--space-lg);
    line-height: 1.78;
    position: relative;
    z-index: 1;
}

.results-cta .btn-primary {
    background: #ffffff;
    color: var(--purple-dk);
    position: relative;
    z-index: 1;
}

.results-cta .btn-primary:hover {
    background: rgba(255, 255, 255, 0.92);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

/* ==============================
   RESPONSIVE
   ============================== */

@media (max-width: 600px) {
    .crri-container {
        padding: var(--space-lg) var(--space-md);
    }

    .crri-header h1 {
        font-size: clamp(24px, 5vw, 32px);
    }

    .score-value {
        font-size: clamp(44px, 10vw, 60px);
    }

    .results-hero {
        padding: var(--space-xl) var(--space-lg);
    }

    .results-section {
        padding: 20px;
    }

    .results-cta {
        padding: var(--space-xl) var(--space-lg);
    }

    .nav-controls {
        flex-wrap: wrap;
        gap: var(--space-sm);
    }

    .btn {
        flex: 1;
        min-width: 120px;
    }
}
