.demo-portal {
    --demo-accent: var(--action, var(--bs-primary));
    --demo-accent-soft: color-mix(in srgb, var(--demo-accent) 12%, transparent);
    --demo-support-accent: var(--brand-demo-support-accent, var(--demo-accent));
    --demo-support-accent-soft: color-mix(in srgb, var(--demo-support-accent) 12%, transparent);
    --demo-border: color-mix(in srgb, currentColor 18%, transparent);
}

.accounts-content-wrapper.demo-portal {
    background: var(--demo-canvas, var(--main-background));
}

.accounts-content-wrapper.demo-portal .card {
    border: var(--demo-card-border, none);
    border-radius: var(--demo-card-radius, 20px);
    background: var(--demo-card-surface, var(--surface-base));
    box-shadow: var(--demo-card-shadow, 0 10px 30px rgba(0, 0, 0, .1));
    max-width: 620px;
}

.accounts-content-wrapper.demo-portal .card::before {
    height: var(--demo-brand-rule-height, 4px);
    background: var(--demo-brand-rule, linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%));
}

.accounts-content-wrapper.demo-portal .card::after {
    position: absolute;
    top: 0;
    right: var(--demo-brand-accent-offset, 10%);
    width: var(--demo-brand-accent-width, 0);
    height: var(--demo-brand-rule-height, 4px);
    background: var(--demo-support-accent);
    content: var(--demo-brand-accent-content, none);
}

.demo-portal .demo-card--wide {
    max-width: 680px;
}

.demo-portal .btn {
    border-radius: var(--demo-button-radius, var(--bs-btn-border-radius));
    letter-spacing: normal;
    text-transform: none;
}

.demo-portal .btn-primary {
    box-shadow: var(--demo-primary-button-shadow, none);
    transition: box-shadow 120ms ease, transform 120ms ease;
}

.demo-portal .btn-primary:hover,
.demo-portal .btn-primary:focus-visible,
.demo-portal .btn-primary:active {
    box-shadow: var(--demo-primary-button-hover-shadow, var(--demo-primary-button-shadow, none));
    transform: var(--demo-primary-button-hover-transform, none);
}

.demo-brand-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    min-height: 68px;
    padding: 1.25rem 1.5rem 0.75rem;
    text-align: left;
}

.demo-brand-header--large {
    flex-direction: column;
    gap: 0.75rem;
    min-height: 0;
    padding-top: 1.75rem;
    text-align: center;
}

.demo-brand-logo-frame {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: auto;
    width: var(--demo-logo-frame-width, auto);
    max-width: var(--demo-logo-max-width, 160px);
    height: var(--demo-logo-height, 64px);
}

.demo-brand-header--large .demo-brand-logo-frame {
    width: var(--demo-logo-large-frame-width, auto);
    max-width: var(--demo-logo-large-max-width, min(280px, 85vw));
    height: var(--demo-logo-large-height, 96px);
}

.demo-brand-logo {
    display: block;
    width: var(--demo-logo-image-width, auto);
    height: 100%;
    max-width: var(--demo-logo-max-width, 160px);
    max-height: 100%;
    object-fit: var(--demo-logo-fit, contain);
    object-position: center;
}

.demo-brand-header--large .demo-brand-logo {
    max-width: var(--demo-logo-large-max-width, min(280px, 85vw));
}

.demo-brand-text,
.demo-brand-name {
    color: var(--text-primary, var(--bs-body-color));
    font-weight: 700;
}

.demo-brand-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

.demo-brand-header--large .demo-brand-name {
    overflow: visible;
    margin: 0;
}

.demo-progress {
    margin-bottom: 1.5rem;
}

.demo-step-count {
    margin-bottom: 0.625rem;
    color: var(--text-primary, var(--bs-body-color));
    font-family: var(--demo-meta-font, inherit);
    font-size: 0.875rem;
    font-weight: 700;
}

.demo-progress-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.375rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

.demo-progress-item {
    overflow: hidden;
    padding-top: 0.5rem;
    border-top: 4px solid var(--demo-border);
    color: var(--bs-secondary-color);
    font-family: var(--demo-meta-font, inherit);
    font-size: 0.75rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.demo-progress-item.is-active,
.demo-progress-item.is-complete {
    border-top-color: var(--demo-accent);
    color: var(--text-primary, var(--bs-body-color));
}

.demo-progress-item.is-active {
    font-weight: 800;
}

.demo-delivery-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.demo-delivery-card {
    position: relative;
    display: flex;
    min-height: 132px;
    padding: 1rem;
    border: 2px solid var(--demo-border);
    border-radius: 12px;
    background: var(--surface-base, var(--bs-body-bg));
    cursor: pointer;
    transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

.demo-delivery-card:hover,
.demo-delivery-card:has(input:focus-visible) {
    border-color: var(--demo-support-accent);
    box-shadow: 0 0 0 3px var(--demo-support-accent-soft);
}

.demo-delivery-card:has(input:checked) {
    border-color: var(--demo-support-accent);
    background: var(--demo-support-accent-soft);
}

.demo-delivery-card input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.demo-delivery-card-content {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.demo-delivery-icon {
    color: var(--demo-support-accent);
    font-size: 1.5rem;
    line-height: 1;
}

.demo-delivery-description {
    color: var(--bs-secondary-color);
    font-size: 0.8125rem;
    line-height: 1.35;
}

.demo-spotify-results {
    max-height: 304px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.demo-spotify-option {
    min-height: 58px;
}

.demo-spotify-selected {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.875rem;
    border: 2px solid var(--demo-support-accent);
    border-radius: 12px;
    background: var(--demo-support-accent-soft);
}

.demo-spotify-selected-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--demo-support-accent);
    color: var(--on-primary, #fff);
    font-weight: 800;
}

.demo-spotify-selected-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.demo-spotify-selected-label {
    color: var(--bs-secondary-color);
    font-size: 0.75rem;
}

.demo-spotify-selected-name {
    overflow: hidden;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.demo-consent-note {
    margin-left: 1.5rem;
    color: var(--bs-secondary-color);
    font-size: 0.75rem;
}

.demo-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--demo-accent-soft);
    color: var(--demo-accent);
    font-size: 2rem;
}

/* main.css centers .form-check-input (margin: 0 auto) for table cells, which
   removes Bootstrap's float layout inside .form-check: the box lands flush
   against its label. Restore Bootstrap's own values here. */
.demo-portal .form-check .form-check-input {
    float: left;
    margin-left: -1.5em;
    margin-top: 0.25em;
}

.demo-next-steps {
    padding: 1rem;
    border: 1px solid var(--demo-border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface-base, #fff) 92%, var(--demo-accent) 8%);
    text-align: left;
}

@media (max-width: 575.98px) {
    .demo-brand-header {
        padding-right: 1.25rem;
        padding-left: 1.25rem;
    }

    .demo-brand-logo-frame {
        width: var(--demo-logo-mobile-frame-width, var(--demo-logo-frame-width, auto));
        max-width: var(--demo-logo-mobile-max-width, 128px);
        height: var(--demo-logo-mobile-height, 56px);
    }

    .demo-brand-header--large .demo-brand-logo-frame {
        width: var(--demo-logo-large-mobile-frame-width, var(--demo-logo-large-frame-width, auto));
        max-width: var(--demo-logo-large-mobile-max-width, min(240px, 80vw));
        height: var(--demo-logo-large-mobile-height, 84px);
    }

    .demo-brand-logo {
        max-width: var(--demo-logo-mobile-max-width, 128px);
    }

    .demo-brand-header--large .demo-brand-logo {
        max-width: var(--demo-logo-large-mobile-max-width, min(240px, 80vw));
    }

    .demo-delivery-options {
        grid-template-columns: 1fr;
    }

    .demo-delivery-card {
        min-height: 104px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .demo-delivery-card,
    .demo-portal .btn-primary {
        transition: none;
    }

    .demo-portal .btn-primary:hover,
    .demo-portal .btn-primary:focus-visible,
    .demo-portal .btn-primary:active {
        transform: none;
    }
}
