.app-shell {
    min-height: 100vh;
    opacity: 0;
}

.app-shell.is-ready {
    opacity: 1;
    transition: opacity 220ms ease;
}

.auth-app-wrapper {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--color-surface);
}

.auth-mobile-frame {
    width: 100%;
    max-width: 380px;
    min-height: 760px;
    border: 2px solid var(--color-primary);
    border-radius: 32px;
    padding: 10px;
    background: var(--color-background);
    transform: translateX(20px) scale(0.99);
    opacity: 0;
    box-shadow: var(--surface-shadow-strong);
}

.auth-screen {
    min-height: 736px;
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--color-background);
}

.app-shell.is-ready .auth-mobile-frame {
    animation: frame-enter 580ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.auth-top-panel {
    min-height: 188px;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 193, 7, 0.28) 0, transparent 55%),
        var(--gradient-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transform: translateX(16px);
    opacity: 0;
    gap: 10px;
}

.brand-name {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
    letter-spacing: 0.02em;
}

.brand-mark {
    width: 68px;
    height: 68px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.32);
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.14);
}

.brand-mark-inner {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--color-surface);
    color: var(--color-primary);
    font-weight: 700;
}

.brand-mark-logo {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    object-fit: cover;
}

.auth-card,
.otp-card {
    margin-top: -24px;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    background: var(--color-background);
    padding: 26px 22px 30px;
    flex: 1;
    transform: translateX(16px);
    opacity: 0;
    border-top: 1px solid var(--color-border);
}

.app-shell.is-ready .auth-top-panel {
    animation: content-enter 420ms ease forwards;
    animation-delay: 120ms;
}

.app-shell.is-ready .auth-card,
.app-shell.is-ready .otp-card {
    animation: content-enter 420ms ease forwards;
    animation-delay: 220ms;
}

.auth-title {
    margin: 0;
    font-size: 23px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.015em;
}

.auth-title-center {
    text-align: center;
}

.social-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.social-btn {
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface);
    padding: 11px 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--color-text);
}

.social-btn:hover {
    border-color: var(--color-primary);
    background: color-mix(in srgb, var(--color-primary) 6%, var(--color-surface) 94%);
}

.social-icon {
    width: 18px;
    height: 18px;
    display: inline-grid;
    place-items: center;
    color: var(--color-primary);
}

.social-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.auth-divider {
    margin: 12px 0 8px;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
}

.auth-form {
    display: grid;
    gap: 8px;
}

.field-label {
    font-size: 13px;
    font-weight: 600;
    margin-top: 4px;
    color: var(--text-secondary);
}

.field-input {
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface);
    padding: 12px 14px;
    outline: none;
}

.field-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(245, 124, 0, 0.12);
}

.phone-field {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 8px;
}

.phone-prefix {
    min-width: 56px;
    min-height: 46px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface);
    display: inline-grid;
    place-items: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-primary);
    padding: 0 8px;
}

.field-input-phone {
    min-height: 46px;
}

.password-field {
    position: relative;
}

.field-input-with-icon {
    padding-right: 46px;
}

.inline-icon-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 0;
    background: none;
    color: var(--color-primary);
    cursor: pointer;
    display: inline-grid;
    place-items: center;
}

.inline-icon-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.inline-icon-btn .icon-eye-closed {
    display: none;
}

.inline-icon-btn.is-visible .icon-eye-open {
    display: none;
}

.inline-icon-btn.is-visible .icon-eye-closed {
    display: block;
}

.micro-link {
    color: var(--color-primary);
    font-weight: 600;
}

.micro-link-right {
    justify-self: end;
    font-size: 12px;
    margin-bottom: 4px;
}

.primary-btn {
    border: 0;
    border-radius: 24px;
    background: var(--color-primary);
    color: #FFFFFF;
    padding: 12px 16px;
    margin-top: 8px;
    font-weight: 600;
    cursor: pointer;
}

.primary-btn:hover {
    background: var(--color-primary-depth);
}

.primary-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.auth-footer-line {
    margin: 18px 0 0;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.checkbox-row {
    margin-top: 4px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    line-height: 1.4;
}

.checkbox-row input {
    margin-top: 2px;
    accent-color: var(--color-primary);
}

.otp-card {
    margin-top: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.otp-back-link {
    align-self: flex-start;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.otp-description {
    margin: 10px auto 0;
    max-width: 280px;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
}

.otp-description span {
    color: var(--color-primary);
    font-weight: 600;
}

.otp-form {
    margin-top: 18px;
}

.otp-inputs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 18px;
}

.otp-digit {
    width: 46px;
    height: 46px;
    text-align: center;
    border: 0;
    border-radius: 999px;
    background: var(--color-surface);
    font-size: 20px;
    font-weight: 700;
    outline: none;
}

.otp-digit:focus {
    background: color-mix(in srgb, var(--color-primary) 12%, var(--color-surface) 88%);
}

.otp-help {
    margin-top: 14px;
}

.slider-dots {
    margin-top: auto;
    padding-top: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.slider-dots span {
    width: 24px;
    height: 4px;
    border-radius: 999px;
    background: var(--color-border);
}

.slider-dots span.active {
    background: var(--color-primary);
}

.toast-stack {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast-item {
    min-width: 210px;
    max-width: 320px;
    border-radius: 12px;
    background: var(--color-text);
    color: #FFFFFF;
    border: 1px solid rgba(245, 124, 0, 0.4);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.4;
    transform: translateY(-8px);
    opacity: 0;
    transition: transform 220ms ease, opacity 220ms ease;
}

.toast-item.is-visible {
    transform: translateY(0);
    opacity: 1;
}

.toast-item.is-leaving {
    transform: translateY(-8px);
    opacity: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

@keyframes frame-enter {
    from {
        opacity: 0;
        transform: translateX(20px) scale(0.99);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes content-enter {
    from {
        opacity: 0;
        transform: translateX(16px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ── Auth Toasts ── */

.toast-stack {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: calc(100% - 32px);
    max-width: 380px;
    pointer-events: none;
}

.toast-item {
    width: 100%;
    padding: 14px 18px;
    border-radius: 14px;
    background: rgba(30, 30, 30, 0.92);
    color: #FFFFFF;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(-12px) scale(0.96);
    transition: opacity 220ms ease, transform 220ms ease;
    pointer-events: auto;
}

.toast-item.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast-item.is-leaving {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
}

@media (max-width: 480px) {
    .auth-app-wrapper {
        padding: 0;
        background: var(--color-background);
    }

    .auth-mobile-frame {
        border: 0;
        border-radius: 0;
        min-height: 100vh;
        max-width: 100%;
        padding: 0;
    }

    .auth-screen {
        min-height: 100vh;
        border-radius: 0;
    }

    .toast-stack {
        left: 12px;
        right: 12px;
        top: 12px;
        transform: none;
        width: auto;
    }

    .toast-item {
        min-width: auto;
        max-width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {

    .app-shell,
    .app-shell.is-ready,
    .auth-mobile-frame,
    .auth-top-panel,
    .auth-card,
    .otp-card,
    .toast-item {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }

    .app-shell {
        opacity: 1;
    }

    .auth-mobile-frame,
    .auth-top-panel,
    .auth-card,
    .otp-card,
    .toast-item {
        opacity: 1;
    }
}