:root {
    --survey-red: #d40000;
    --survey-red-dark: #a80000;
    --survey-ink: #171717;
    --survey-muted: #5d6268;
    --survey-line: #202020;
    --survey-soft: #f5f5f4;
    --survey-paper: #ffffff;
}

* {
    box-sizing: border-box;
}

body.survey-page {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--survey-ink);
    background:
        radial-gradient(circle at 10% 0%, rgba(212, 0, 0, .08), transparent 32rem),
        linear-gradient(180deg, #f3f3f1 0, #e8e8e5 100%);
    font-family: Arial, Helvetica, sans-serif;
}

.survey-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 40px auto;
    overflow: hidden;
    background: var(--survey-paper);
    border: 1px solid #d3d3d0;
    border-top: 7px solid var(--survey-red);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .13);
}

.survey-header {
    position: relative;
    display: grid;
    grid-template-columns: minmax(190px, 270px) 1fr;
    gap: 30px;
    align-items: center;
    padding: 44px 48px 40px;
    border-bottom: 3px solid var(--survey-line);
}

.survey-logo {
    color: var(--survey-red);
    font-size: clamp(48px, 6vw, 64px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -4px;
    text-decoration: none;
}

.survey-logo:hover {
    color: var(--survey-red-dark);
}

.survey-kicker,
.section-eyebrow {
    display: block;
    margin-bottom: 6px;
    color: var(--survey-red-dark);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.survey-header h1 {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: clamp(1.55rem, 2.8vw, 2.15rem);
    font-weight: 600;
    letter-spacing: -.025em;
}

.survey-header p {
    margin: 9px 0 0;
    color: var(--survey-muted);
}

.survey-revision {
    position: absolute;
    top: 18px;
    right: 24px;
    color: #747474;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .05em;
}

.validation-summary,
#LabelMsg {
    margin: 28px 48px 0;
    border-radius: 0;
}

.validation-summary ul {
    margin: 8px 0 0;
}

.survey-card {
    margin: 28px 48px;
    padding: 32px;
    border: 1.5px solid var(--survey-line);
    background: #fff;
    box-shadow: 5px 5px 0 #e2e2df;
}

.company-card {
    margin-top: 38px;
}

.section-heading {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 24px;
}

.section-heading h2 {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    font-size: clamp(1.08rem, 1.8vw, 1.3rem);
    font-weight: 600;
    line-height: 1.25;
}

.section-heading-plain {
    padding-left: 0;
}

.section-number {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    color: #fff;
    background: var(--survey-ink);
    font-size: .76rem;
    font-weight: 700;
}

.question-card {
    margin-top: 22px;
    margin-bottom: 22px;
    padding: 28px;
    border: 1.5px solid var(--survey-line);
    background: #fff;
    box-shadow: 4px 4px 0 #e6e6e3;
}

.question-card + .question-card {
    margin-top: 22px;
}

.question-card .section-number {
    background: var(--survey-red);
}

.ranking-card .section-number {
    background: var(--survey-red);
}

.survey-divider {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 42px 48px 20px;
    color: #333;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.survey-divider::before,
.survey-divider::after {
    height: 2px;
    flex: 1;
    content: "";
    background: var(--survey-line);
}

.survey-divider span {
    min-width: 0;
}

.form-label,
.question-instruction,
.detail-title,
.ranking-item label {
    color: #242424;
    font-size: .9rem;
    font-weight: 600;
}

.question-instruction {
    margin: 0 0 12px;
}

.question-context {
    margin: -15px 0 18px 60px;
    color: var(--survey-muted);
    font-size: .92rem;
}

.required-mark {
    color: var(--survey-red);
    font-weight: 800;
}

.form-control,
.form-select {
    min-height: 46px;
    border: 1.5px solid #777;
    border-radius: 0;
    background-color: #fff;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--survey-red);
    box-shadow: 0 0 0 .2rem rgba(212, 0, 0, .12);
}

textarea.form-control {
    min-height: 92px;
    resize: vertical;
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.choice-grid input {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.choice-grid br {
    display: none;
}

.choice-grid label {
    position: relative;
    display: flex;
    min-height: 48px;
    margin: 0;
    padding: 12px 14px 12px 42px;
    align-items: center;
    border: 1.5px solid #727272;
    background: #fff;
    color: #292929;
    cursor: pointer;
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.25;
    transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}

.choice-grid label::before {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 17px;
    height: 17px;
    border: 2px solid #525252;
    background: #fff;
    content: "";
    transform: translateY(-50%);
}

.evaluation-options label::before {
    border-radius: 50%;
}

.choice-grid input:focus + label {
    outline: 3px solid rgba(212, 0, 0, .18);
    outline-offset: 2px;
}

.choice-grid input:checked + label {
    border-color: var(--survey-red-dark);
    background: #fff1f1;
    color: #7f0000;
    transform: translateY(-1px);
}

.choice-grid.is-invalid label {
    border-color: #dc3545;
}

.choice-grid.is-invalid label::before {
    border-color: #dc3545;
}

.choice-grid input:checked + label::before {
    border-color: var(--survey-red);
    background:
        linear-gradient(135deg, transparent 42%, #fff 42% 55%, transparent 55%),
        var(--survey-red);
    box-shadow: inset 0 0 0 3px #fff;
}

.evaluation-options input:checked + label::before {
    background: var(--survey-red);
    box-shadow: inset 0 0 0 4px #fff;
}

.question-details {
    display: none;
    margin-top: 20px;
    padding: 24px;
    border-left: 5px solid var(--survey-red);
    background: var(--survey-soft);
}

.question-details.is-visible {
    display: block;
}

.detail-title {
    margin: 0 0 12px;
}

.reason-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.reason-options label {
    background: #fff;
}

.other-field {
    display: none;
    margin-top: 18px;
}

.other-field.is-visible {
    display: block;
}

.observation-field {
    margin-top: 22px;
}

.field-error {
    display: block;
    margin-top: 7px;
    color: #dc3545;
    font-size: .82rem;
    font-weight: 600;
}

.inline-validation {
    width: 100%;
    padding: 8px 10px;
    border-left: 3px solid #dc3545;
    background: #fff5f5;
}

.ranking-card {
    background: #fafaf9;
}

.ranking-help {
    margin: -10px 0 22px 60px;
    color: #303030;
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.45;
}

.ranking-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid #5f5f5f;
    border-left: 1px solid #5f5f5f;
}

.ranking-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 160px;
    gap: 12px;
    align-items: center;
    min-height: 78px;
    padding: 14px;
    border-right: 1px solid #5f5f5f;
    border-bottom: 1px solid #5f5f5f;
    background: #fff;
}

.ranking-item label {
    margin: 0;
}

.rank-select {
    min-width: 0;
    min-height: 42px;
    border-width: 1px;
    border-color: #777;
    font-weight: 600;
}

.ranking-error {
    display: block !important;
    width: 100%;
    margin-top: 16px;
    padding: 12px 14px;
    border: 0;
    border-left: 3px solid #dc3545;
    background: #fff5f5;
}

.open-field + .open-field {
    margin-top: 26px;
    padding-top: 26px;
    border-top: 2px solid var(--survey-line);
}

.open-field .form-label {
    max-width: 900px;
    font-size: .98rem;
    line-height: 1.4;
}

.label-note {
    display: block;
    margin-top: 3px;
    color: var(--survey-muted);
    font-size: .78rem;
    font-weight: 400;
}

.submit-panel {
    display: flex;
    margin: 38px 48px 48px;
    padding: 26px 30px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    color: #fff;
    background: var(--survey-ink);
    border-bottom: 5px solid var(--survey-red);
}

.submit-panel strong,
.submit-panel span {
    display: block;
}

.submit-panel span {
    margin-top: 3px;
    color: #c7c7c7;
    font-size: .88rem;
}

.submit-button {
    min-width: 210px;
    padding: 13px 24px;
    border: 0;
    border-radius: 0;
    background: var(--survey-red);
    font-weight: 700;
}

.submit-button:hover,
.submit-button:focus {
    background: var(--survey-red-dark);
}

.success-shell {
    max-width: 920px;
}

.success-card {
    margin: 70px auto 80px;
    padding: 20px 48px;
    max-width: 700px;
    text-align: center;
}

.success-icon {
    display: grid;
    width: 76px;
    height: 76px;
    margin: 0 auto 24px;
    place-items: center;
    color: #fff;
    background: var(--survey-red);
    border: 5px solid #ffdada;
    border-radius: 50%;
    font-size: 2rem;
    font-weight: 800;
}

.success-card h2 {
    margin: 0;
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    font-weight: 600;
    letter-spacing: -.035em;
}

.success-card p {
    max-width: 620px;
    margin: 18px auto 30px;
    color: var(--survey-muted);
    font-size: 1.05rem;
    line-height: 1.65;
}

.success-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.success-actions .btn {
    border-radius: 0;
    font-size: .95rem;
    font-weight: 700;
}

@media (max-width: 900px) {
    .survey-header {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .choice-grid,
    .reason-options,
    .ranking-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .survey-shell {
        width: 100%;
        margin: 0;
        border-right: 0;
        border-left: 0;
    }

    .survey-header {
        padding: 38px 20px 28px;
    }

    .survey-revision {
        top: 12px;
        right: 14px;
    }

    .survey-card,
    .validation-summary,
    #LabelMsg,
    .submit-panel {
        margin-right: 16px;
        margin-left: 16px;
    }

    .survey-card {
        max-width: calc(100% - 32px);
        padding: 24px 18px;
    }

    .company-card .row {
        --bs-gutter-x: 0;
    }

    .question-card {
        padding: 22px 18px;
    }

    .survey-divider {
        margin-right: 16px;
        margin-left: 16px;
        text-align: center;
    }

    .survey-divider::before,
    .survey-divider::after {
        min-width: 18px;
    }

    .choice-grid,
    .reason-options,
    .ranking-grid {
        grid-template-columns: 1fr;
    }

    .ranking-grid {
        border-right: 1px solid #5f5f5f;
    }

    .ranking-item {
        border-right: 0;
    }

    .question-context,
    .ranking-help {
        margin-left: 0;
    }

    .submit-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .submit-button {
        width: 100%;
    }

    .success-card {
        margin: 48px auto 60px;
        padding: 16px 24px;
    }

    .success-actions {
        align-items: stretch;
        flex-direction: column;
    }
}
