body.landing-page #main-container {
    display: none;
    opacity: 0;
    transition: opacity 1s ease;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
}

body.landing-page #main-container.active {
    display: block;
    opacity: 1;
}

body.form-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    overflow: hidden !important;
    background-image: url('../assets/onboarding-bg.png');
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
}

body.form-page .welcome-slide,
body.form-page .form {
    background: transparent !important;
    backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    animation: none;
}

body.form-page #app {
    width: 100%;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

body.form-page .question h2,
body.form-page .welcome-content h2,
body.form-page .subtitle,
body.form-page .question p,
body.form-page .welcome-content p,
body.form-page .success-message h2,
body.form-page .success-message p,
body.form-page .state-block h2,
body.form-page .state-block p {
    color: #1a1a1a;
}

body.form-page .topics-textarea {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    color: #1a1a1a;
}

body.form-page .progress-bar {
    background: rgba(0, 0, 0, 0.1);
}

.welcome-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #111;
}

.step-next-enter-active,
.step-next-leave-active,
.step-prev-enter-active,
.step-prev-leave-active {
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.step-next-leave-active,
.step-prev-leave-active {
    pointer-events: none;
}

.step-next-enter-from,
.step-prev-leave-to {
    opacity: 0;
    transform: translateY(26px);
}

.step-next-leave-to,
.step-prev-enter-from {
    opacity: 0;
    transform: translateY(-26px);
}

.step-count {
    text-align: center;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.5);
    margin-bottom: 0.75rem;
}

.step-note {
    text-align: center;
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.6);
    margin: 1.25rem 0 0;
}

.key-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5em;
    height: 1.5em;
    margin-right: 0.6em;
    border: 1px solid currentColor;
    border-radius: 5px;
    font-size: 0.68em;
    font-weight: 600;
    line-height: 1;
    opacity: 0.45;
    vertical-align: 1px;
}

.enter-hint {
    text-align: right;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: rgba(0, 0, 0, 0.55);
    transition: opacity 0.2s ease;
}

.enter-hint.hidden {
    opacity: 0;
}

.welcome-content .enter-hint {
    text-align: center;
}

.field-hint {
    text-align: right;
    font-size: 0.8rem;
    color: rgba(0, 0, 0, 0.5);
    margin-top: 0.4rem;
}

.other-input {
    display: block;
    width: 100%;
    margin-top: 1.25rem;
    padding: 0.9rem 1.15rem;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    background: rgba(255, 255, 255, 0.55);
    font-family: inherit;
    font-size: 1rem;
    color: #1a1a1a;
}

.other-input:focus {
    outline: none;
    border-color: #111;
}

.form-error {
    color: #b91c1c;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    margin-top: 1rem;
}

.form-error:empty {
    display: none;
}

.link-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    margin-top: 1.25rem;
    font-family: inherit;
    font-size: 0.9rem;
    color: rgba(0, 0, 0, 0.6);
    text-decoration: underline;
    cursor: pointer;
}

.link-btn:hover {
    color: #111;
}

.state-block {
    text-align: center;
    padding: 2rem 0;
}

.state-block h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.state-block p {
    margin-bottom: 2rem;
    line-height: 1.6;
}

.success-message h2 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.success-message p {
    line-height: 1.6;
    margin: 0 0 0.75rem;
    overflow-wrap: anywhere;
}

.btn-primary:disabled,
.btn-secondary:disabled,
.start-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.btn-primary .loader {
    border-color: rgba(255, 255, 255, 0.45);
    border-bottom-color: #fff;
}

.grade-btn:focus-visible,
.subject-btn:focus-visible,
.day-btn:focus-visible,
.role-btn:focus-visible,
.sb-dropdown-trigger:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.start-btn:focus-visible,
.link-btn:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

.form-shell {
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
}

.form-shell.can-scroll {
    overflow-y: auto;
    overflow-x: hidden;
}

.form-shell.hover-off .grade-btn:not(.active):hover,
.form-shell.hover-off .subject-btn:not(.active):hover,
.form-shell.hover-off .day-btn:not(.active):hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

@media (hover: none) {
    .form-shell .grade-btn:not(.active):hover,
    .form-shell .subject-btn:not(.active):hover,
    .form-shell .day-btn:not(.active):hover {
        background: rgba(255, 255, 255, 0.2);
        border-color: rgba(255, 255, 255, 0.3);
        transform: none;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    }
}

@media (hover: none), (pointer: coarse) {
    .key-hint,
    .enter-hint,
    .field-hint {
        display: none;
    }
}

@media (max-width: 600px), (max-height: 640px) {
    body.form-page {
        padding: 12px;
    }

    .form-shell {
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
        overflow-y: auto;
        overflow-x: hidden;
    }

    .form-shell .sb-dropdown.open {
        margin-bottom: 290px;
    }
}

@media (max-width: 600px) {
    .form-shell,
    body.landing-page #main-container {
        padding: 2rem 1.25rem;
        border-radius: 28px;
    }

    body.landing-page #main-container {
        width: calc(100% - 24px);
    }

    .form-shell .question {
        margin-bottom: 1.75rem;
    }

    .form-shell .question h2 {
        font-size: 1.3rem;
    }

    .form-shell .navigation {
        margin-top: 2rem;
        gap: 0.6rem;
    }

    .form-shell .btn-primary,
    .form-shell .btn-secondary {
        padding: 0.9rem 1.1rem;
    }

    .form-shell .grade-btn,
    .form-shell .subject-btn,
    .form-shell .day-btn {
        padding: 0.7rem 1.1rem;
        font-size: 0.9rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .step-next-enter-active,
    .step-next-leave-active,
    .step-prev-enter-active,
    .step-prev-leave-active {
        transition: opacity 0.15s ease;
    }

    .step-next-enter-from,
    .step-prev-leave-to,
    .step-next-leave-to,
    .step-prev-enter-from {
        transform: none;
    }
}
