/* Survey layout with ad slots */
.survey-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem 2rem;
    gap: 1.5rem;
}

/* Survey container */
.survey-wrap {
    max-width: 580px;
    width: 100%;
}

.survey-card {
    padding: 2.5rem;
}

/* Inner content fades on step change, glass card stays stable */
.survey-step-inner {
    animation: fadeIn 0.25s ease both;
}

.survey-card__title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
}

.survey-card__subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.75rem;
}

/* Step indicator */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.step-indicator__current {
    color: var(--accent);
    font-weight: 700;
}

/* Survey navigation */
.survey-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    gap: 1rem;
}

.survey-nav .btn {
    min-width: 130px;
}

/* Form help text */
.form-help {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

/* ==========================================
   Radio Cards — custom select replacement
   ========================================== */
.radio-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.6rem;
}

.radio-card {
    position: relative;
}

.radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.radio-card label {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.85rem 1rem;
    min-height: 52px;
    background: rgba(255, 255, 255, 0.5);
    border: 1.5px solid rgba(99, 102, 241, 0.08);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    line-height: 1.3;
}

.radio-card label:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(99, 102, 241, 0.2);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08);
}

.radio-card input[type="radio"]:checked + label {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.08));
    border-color: var(--accent);
    color: var(--accent-dark);
    font-weight: 600;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1), 0 4px 12px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.radio-card input[type="radio"]:focus-visible + label {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* City cards — tighter grid for 16 items */
.radio-cards--cities {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.5rem;
}

.radio-cards--cities .radio-card label {
    padding: 0.7rem 0.75rem;
    font-size: 0.85rem;
    min-height: 44px;
}

/* ==========================================
   Checkbox Cards
   ========================================== */
.checkbox-card {
    position: relative;
    margin-bottom: 0.6rem;
}

.checkbox-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.checkbox-card label {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.5);
    border: 1.5px solid rgba(99, 102, 241, 0.08);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.checkbox-card__check {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border: 2px solid rgba(99, 102, 241, 0.2);
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
    background: rgba(255, 255, 255, 0.6);
}

.checkbox-card__check::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 6px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.checkbox-card label:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(99, 102, 241, 0.2);
    color: var(--text-primary);
}

.checkbox-card input[type="checkbox"]:checked + label {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.08));
    border-color: var(--accent);
    color: var(--accent-dark);
    font-weight: 600;
}

.checkbox-card input[type="checkbox"]:checked + label .checkbox-card__check {
    background: linear-gradient(135deg, var(--accent), #a855f7);
    border-color: var(--accent);
}

.checkbox-card input[type="checkbox"]:checked + label .checkbox-card__check::after {
    transform: rotate(45deg) scale(1);
}

/* ==========================================
   Ad Slots
   ========================================== */
.ad-slot {
    width: 100%;
    max-width: 728px;
}

.ad-slot__inner {
    position: relative;
    background: rgba(255, 255, 255, 0.35);
    border: 1.5px dashed rgba(99, 102, 241, 0.15);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ad-slot__label {
    position: absolute;
    top: 6px;
    left: 10px;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 500;
}

.ad-slot__placeholder {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Hide placeholder text when real ad is injected */
.ad-slot__inner:has(iframe),
.ad-slot__inner:has(ins) {
    border-style: solid;
    border-color: transparent;
}

.ad-slot__inner:has(iframe) .ad-slot__placeholder,
.ad-slot__inner:has(iframe) .ad-slot__label,
.ad-slot__inner:has(ins) .ad-slot__placeholder,
.ad-slot__inner:has(ins) .ad-slot__label {
    display: none;
}

/* ==========================================
   HTMX transitions — minimal to avoid backdrop-filter flicker
   ========================================== */
#survey-container {
    min-height: 200px;
}

/* Number input */
input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 640px) {
    .survey-layout {
        padding: 1rem 0.5rem;
    }

    .survey-card {
        padding: 1.5rem;
    }

    .survey-card__title {
        font-size: 1.25rem;
    }

    .radio-cards {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .ad-slot__inner {
        min-height: 60px;
    }
}
