/* Centered auth / onboarding gate (login, register, setup-destination, …) */
html, body.auth-gate-page {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

body.auth-gate-page {
    box-sizing: border-box;
}

.auth-gate-shell {
    width: 100%;
}

.auth-gate-card {
    text-align: left;
    box-sizing: border-box;
}

.auth-gate-logo {
    display: flex;
    justify-content: center;
    margin: 0 0 1rem;
}

.auth-gate-logo__img {
    height: 2.5rem;
    width: auto;
    display: block;
}

.auth-gate-card .form-field {
    margin-bottom: 0;
    width: 100%;
}

.auth-gate-card .form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #111;
    margin-bottom: 0.375rem;
}

.auth-gate-card .form-input,
.auth-gate-card .neo-input,
.auth-gate-card input[type="email"],
.auth-gate-card input[type="password"],
.auth-gate-card input[type="text"],
.auth-gate-card input[type="url"] {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    background: #fff;
}

.auth-gate-card .form-input:focus,
.auth-gate-card .neo-input:focus,
.auth-gate-card input:focus {
    outline: none;
    border-color: var(--neo-focus, #1D38BE);
}

.auth-gate-card .neo-btn,
.auth-gate-card .neo-btn.w-full {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.auth-gate-card .neo-btn-top {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

.auth-gate-card .account-choice-card {
    border-radius: 0.75rem;
    transition: transform var(--neo-duration-fast, 0.15s) var(--neo-ease, ease),
        box-shadow var(--neo-duration-fast, 0.15s) var(--neo-ease, ease),
        background-color var(--neo-duration-fast, 0.15s) var(--neo-ease, ease),
        border-color var(--neo-duration-fast, 0.15s) var(--neo-ease, ease);
}

.auth-gate-card .account-choice-card:hover {
    transform: translateY(-1px);
}

.auth-gate-card .account-choice-card:has(:checked) {
    transform: translateY(-1px);
}

.auth-gate-card .account-choice-card__lead-icon {
    transition: transform 0.22s var(--neo-ease, ease), background-color 0.22s ease, color 0.22s ease;
}

.auth-gate-card .account-choice-card:has(:checked) .account-choice-card__lead-icon {
    transform: scale(1.06);
}

.auth-gate-card details,
.auth-gate-card .account-dest-more {
    border-radius: 0.75rem;
}

/* Collapsible panels (Direct Link field, More list) */
.setup-reveal {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    margin-top: 0;
    transition:
        grid-template-rows 0.32s var(--neo-ease, cubic-bezier(0.22, 1, 0.36, 1)),
        opacity 0.24s ease,
        margin-top 0.32s var(--neo-ease, cubic-bezier(0.22, 1, 0.36, 1));
    pointer-events: none;
}

.setup-reveal.is-open {
    grid-template-rows: 1fr;
    opacity: 1;
    margin-top: 0.15rem;
    pointer-events: auto;
}

.setup-reveal__inner {
    overflow: hidden;
    min-height: 0;
}

.setup-reveal.is-open .setup-reveal__inner > * {
    animation: setup-reveal-item 0.34s var(--neo-ease, cubic-bezier(0.22, 1, 0.36, 1)) both;
}

.setup-reveal.is-open .setup-reveal__inner > *:nth-child(2) {
    animation-delay: 0.04s;
}

.setup-reveal.is-open .setup-reveal__inner > *:nth-child(3) {
    animation-delay: 0.08s;
}

@keyframes setup-reveal-item {
    from {
        opacity: 0;
        transform: translate3d(0, 8px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* More experiences accordion */
.setup-more {
    overflow: hidden;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.setup-more[open] {
    border-style: solid;
    background: rgba(255, 255, 255, 0.55);
}

.setup-more__summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    transition: color 0.2s ease;
}

.setup-more__summary::-webkit-details-marker {
    display: none;
}

.setup-more__summary::after {
    content: '';
    width: 0.55rem;
    height: 0.55rem;
    border-right: 2px solid #111;
    border-bottom: 2px solid #111;
    transform: rotate(45deg);
    transition: transform 0.28s var(--neo-ease, cubic-bezier(0.22, 1, 0.36, 1));
    flex-shrink: 0;
}

.setup-more[open] .setup-more__summary::after {
    transform: rotate(225deg);
}

.setup-more__body {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition:
        grid-template-rows 0.34s var(--neo-ease, cubic-bezier(0.22, 1, 0.36, 1)),
        opacity 0.24s ease;
}

.setup-more[open] .setup-more__body {
    grid-template-rows: 1fr;
    opacity: 1;
}

.setup-more__body > * {
    overflow: hidden;
    min-height: 0;
}

.setup-more[open] .setup-more__item {
    animation: setup-reveal-item 0.36s var(--neo-ease, cubic-bezier(0.22, 1, 0.36, 1)) both;
    animation-delay: calc(var(--setup-stagger, 0) * 45ms);
}

/* Link field with live brand icon */
.setup-link-field {
    position: relative;
    width: 100%;
}

.setup-link-field__icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.35rem;
    height: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    pointer-events: none;
    font-size: 1rem;
    transition: color 0.2s ease;
}

.setup-link-field__icon.is-brand {
    color: #111;
}

.setup-link-field__icon.is-swap i {
    animation: setup-icon-pop 0.28s var(--neo-ease, cubic-bezier(0.22, 1, 0.36, 1));
}

@keyframes setup-icon-pop {
    0% { transform: scale(0.7); opacity: 0.35; }
    60% { transform: scale(1.12); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.setup-link-field__input {
    padding-left: 2.75rem !important;
}

.setup-link-hint {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: #4b5563;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.setup-link-hint.is-warn {
    color: #9a1b24;
    font-weight: 600;
}

.setup-link-hint.is-ok {
    color: #166534;
}

@media (prefers-reduced-motion: reduce) {
    .setup-reveal,
    .setup-reveal.is-open .setup-reveal__inner > *,
    .setup-more__body,
    .setup-more[open] .setup-more__item,
    .setup-link-field__icon.is-swap i,
    .auth-gate-card .account-choice-card,
    .auth-gate-card .account-choice-card__lead-icon {
        animation: none !important;
        transition: none !important;
    }

    .setup-reveal {
        opacity: 1;
    }

    .setup-reveal:not(.is-open) {
        display: none;
    }
}
