/* ============================================
   DEMO PAGE
   Premium form, custom inputs/checkboxes, sidebar.
   Form logic preserved exactly; styling only.
   ============================================ */

.demo-grid {
    display: grid;
    gap: 2.4rem;
    grid-template-columns: 1fr;
    max-width: 1100px;
    margin: 0 auto;
}

@media (min-width: 992px) {
    .demo-grid {
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
        align-items: start;
    }
}

/* ===== Form card ===== */
.demo-form-card {
    background: #ffffff;
    border: 1px solid var(--story-line);
    border-radius: 20px;
    box-shadow: var(--story-elev, 0 24px 80px -32px rgba(2, 48, 77, 0.28));
    padding: 2.4rem;
}

@media (max-width: 575.98px) {
    .demo-form-card { padding: 1.6rem; }
}

.demo-form-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--story-primary);
    text-align: center;
    margin: 0 0 1.4rem;
    letter-spacing: -0.015em;
}

.demo-form { display: block; }

.demo-validation-summary {
    color: #b3261e;
    margin: 0 0 1rem;
    font-size: 0.92rem;
}

.demo-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.demo-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

@media (min-width: 576px) {
    .demo-row { grid-template-columns: 1fr 1fr; gap: 1.1rem; }
}

.demo-field {
    display: block;
    margin-bottom: 1.1rem;
    border: none;
    padding: 0;
}

.demo-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--story-primary);
    margin: 0 0 0.4rem;
    letter-spacing: -0.005em;
}

.demo-required { color: #b3261e; font-weight: 700; }

.demo-input {
    display: block;
    width: 100%;
    border: 1px solid var(--story-line);
    border-radius: 12px;
    padding: 0.8rem 0.95rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--story-ink);
    background: #ffffff;
    line-height: 1.4;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

    .demo-input::placeholder { color: var(--story-mute); opacity: 0.7; }

    .demo-input:hover:not(:focus) { border-color: rgba(4, 101, 165, 0.4); }

    .demo-input:focus {
        outline: none;
        border-color: var(--story-accent);
        box-shadow: 0 0 0 3px rgba(4, 101, 165, 0.18);
    }

    .demo-input.input-validation-error {
        border-color: #b3261e;
        box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.12);
    }

.demo-select {
    background-image:
        linear-gradient(45deg, transparent 50%, var(--story-mute) 50%),
        linear-gradient(135deg, var(--story-mute) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 2.4rem;
    cursor: pointer;
}

.demo-textarea {
    min-height: 6rem;
    resize: vertical;
    font-family: inherit;
}

.demo-error {
    display: block;
    color: #b3261e;
    font-size: 0.85rem;
    margin-top: 0.35rem;
}

/* ===== Custom checkboxes ===== */
.demo-checkbox-grid {
    display: grid;
    gap: 0.55rem;
    grid-template-columns: 1fr;
    margin-top: 0.4rem;
}

@media (min-width: 576px) {
    .demo-checkbox-grid { grid-template-columns: 1fr 1fr; }
}

.demo-check {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.55rem;
    cursor: pointer;
    line-height: 1.45;
    padding: 0.4rem 0.55rem 0.4rem 0.5rem;
    border-radius: 10px;
    transition: background-color 0.2s ease;
}

    .demo-check:hover { background: rgba(4, 101, 165, 0.06); }

.demo-check-input {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--story-line);
    border-radius: 5px;
    background: #ffffff;
    cursor: pointer;
    position: relative;
    flex: 0 0 auto;
    margin-top: 2px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

    .demo-check-input:hover { border-color: var(--story-accent); }

    .demo-check-input:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px rgba(4, 101, 165, 0.22);
    }

    .demo-check-input:checked {
        background: var(--story-accent);
        border-color: var(--story-accent);
    }

        .demo-check-input:checked::after {
            content: "";
            position: absolute;
            top: 2px;
            left: 5px;
            width: 4px;
            height: 8px;
            border: solid #ffffff;
            border-width: 0 2px 2px 0;
            transform: rotate(45deg);
        }

.demo-check-label {
    color: var(--story-ink);
    font-size: 0.95rem;
}

.demo-submit-row {
    margin-top: 0.6rem;
    text-align: center;
}

    .demo-submit-row .story-cta { width: 100%; justify-content: center; }

@media (min-width: 576px) {
    .demo-submit-row .story-cta { width: auto; }
}

/* ===== Sidebar ===== */
.demo-info-sidebar {
    background: var(--story-soft);
    border: 1px solid var(--story-line);
    border-radius: 20px;
    padding: 1.8rem;
}

.demo-sidebar-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--story-primary);
    margin: 0 0 1rem;
    letter-spacing: -0.012em;
}

.demo-expectations {
    list-style: none;
    margin: 0;
    padding: 0;
}

    .demo-expectations li {
        display: flex;
        align-items: flex-start;
        gap: 0.8rem;
        padding: 0.6rem 0 0.6rem 0.6rem;
        border-left: 3px solid var(--story-accent);
        margin-bottom: 0.7rem;
        line-height: 1.5;
        color: var(--story-ink);
        font-size: 0.95rem;
    }

        .demo-expectations li:last-child { margin-bottom: 0; }

.demo-expect-icon {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    color: var(--story-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .demo-expect-icon svg { width: 100%; height: 100%; }
