:root {
    --survey-primary: #7a1f2b;
    --survey-primary-dark: #5c141d;
    --survey-primary-soft: #f3dde0;
    --survey-accent: #d98a3d;
    --survey-bg: #f8f3f2;
    --survey-ink: #33262a;
}

body.survey-bg {
    background: linear-gradient(160deg, var(--survey-bg) 0%, #efdfe0 100%);
    min-height: 100vh;
    color: var(--survey-ink);
}

.survey-card {
    border-radius: 1rem;
    overflow: hidden;
}

.survey-card-header {
    background: #fff;
    border-bottom: 1px solid #efe0e1;
    padding: 1rem 1.25rem;
}

.survey-title {
    color: var(--survey-primary-dark);
    font-weight: 700;
}

.brand-emoji {
    font-size: 2.5rem;
    line-height: 1;
}

.uid-badge {
    background: var(--survey-primary);
    color: #fff;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.btn-survey {
    background: var(--survey-primary);
    border-color: var(--survey-primary);
    color: #fff;
}

.btn-survey:hover,
.btn-survey:focus {
    background: var(--survey-primary-dark);
    border-color: var(--survey-primary-dark);
    color: #fff;
}

.btn-primary {
    background: var(--survey-primary);
    border-color: var(--survey-primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--survey-primary-dark);
    border-color: var(--survey-primary-dark);
}

.section-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--survey-primary-dark);
    background: #f3e0e2;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}

.question-heading h5 {
    line-height: 1.4;
    color: var(--survey-ink);
}

.option-box {
    padding: 0.85rem 1rem;
    border: 1px solid #ecdcdd;
    border-radius: 0.65rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.option-box:hover {
    border-color: var(--survey-primary);
    background: #fdf6f6;
}

.option-box:has(input:checked) {
    border-color: var(--survey-primary);
    background: #fbeced;
    box-shadow: 0 0 0 1px var(--survey-primary) inset;
}

.question-step-badge {
    background: #f3e0e2;
    color: var(--survey-primary-dark);
    font-weight: 600;
}

.enumerator-note {
    background: #fdf3e7 !important;
    color: #8a591c;
    font-size: 0.9rem;
    line-height: 1.45;
}

.enumerator-icon {
    margin-right: 0.35rem;
}

.other-text-input {
    max-width: 28rem;
    border-color: #e3cccd;
}

.progress {
    background-color: #ecdcdd;
    height: 10px;
    border-radius: 999px;
}

.progress-bar {
    background-color: var(--survey-primary);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.table thead th {
    font-size: 0.9rem;
}

/* Grouped fields (chips) */
.group-field {
    padding: 0.85rem 1rem;
    border: 1px solid #ecdcdd;
    border-radius: 0.75rem;
    background: #fff;
}

.group-field-label {
    font-weight: 600;
    color: var(--survey-ink);
}

.group-field-hint {
    font-style: italic;
}

.chip-option {
    position: relative;
    cursor: pointer;
    margin: 0;
}

.chip-option .chip-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.chip-option span {
    display: inline-block;
    padding: 0.45rem 0.85rem;
    border: 1px solid #e3cccd;
    border-radius: 999px;
    background: #f8f3f2;
    font-size: 0.9rem;
    transition: all 0.15s ease;
    user-select: none;
}

.chip-option:hover span {
    border-color: var(--survey-primary);
    color: var(--survey-primary-dark);
}

.chip-option .chip-input:checked + span {
    background: var(--survey-primary);
    border-color: var(--survey-primary);
    color: #fff;
}

.chip-option .chip-input:focus-visible + span {
    outline: 2px solid var(--survey-accent);
    outline-offset: 2px;
}

/* Matrix tables */
.matrix-table td,
.matrix-table th {
    vertical-align: middle;
}

.matrix-table .js-matrix-input {
    width: 1.15rem;
    height: 1.15rem;
    cursor: pointer;
}

.matrix-table tbody tr:hover {
    background: #fdf6f6;
}

.scale-legend {
    display: flex;
    align-items: center;
}

.number-input-group {
    max-width: 30rem;
}

.input-group-text {
    background: #f3e0e2;
    border-color: #e3cccd;
    color: var(--survey-primary-dark);
    font-weight: 600;
}

/* Landing & consent pages */
.survey-card {
    border-radius: 20px;
    background: #ffffff;
}

.brand-mark {
    display: inline-block;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--survey-primary);
    background: var(--survey-primary-soft);
    padding: .35rem .75rem;
    border-radius: 999px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: .75rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .75rem;
    border: 1px solid #ecd7d9;
    border-radius: 12px;
    background: #fdf6f6;
}

.info-icon {
    font-size: 1.4rem;
}

.terms-box {
    background: #fdf6f6;
    border: 1px solid #ecd7d9;
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
    line-height: 1.7;
}
