/* Login / auth screens: animated SVG background + glass morphism card */

html,
body.login-page {
    min-height: 100%;
    margin: 0;
}

body.login-page {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.25rem 1rem;
    overflow-x: hidden;
    background: #151b36;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: #151b36;
    pointer-events: none;
}

.login-bg__media {
    position: absolute;
    top: 50%;
    left: 50%;
    display: block;
    border: 0;
    /* Defeat Tailwind Preflight (img { max-width:100%; height:auto }) */
    max-width: none;
    width: max(100%, calc(100vh * 1997 / 764));
    height: max(100%, calc(100vw * 764 / 1997));
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.login-bg__vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(21, 27, 54, 0.05) 0%, rgba(21, 27, 54, 0.28) 100%);
}

.login-glass-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 26.5rem;
    color: #f5f7ff;
    background: linear-gradient(
        165deg,
        rgba(255, 255, 255, 0.22) 0%,
        rgba(255, 255, 255, 0.1) 45%,
        rgba(21, 27, 54, 0.22) 100%
    );
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 1.5rem;
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    overflow: hidden;
}

.login-glass-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
    pointer-events: none;
}

.login-form-wrap {
    position: relative;
    padding: 1.75rem 1.75rem 1.5rem;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.login-brand__icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 10px rgba(64, 105, 236, 0.35));
}

.login-brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.login-brand__name {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #ffffff;
}

.login-brand__sub {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.62);
}

.login-title {
    margin: 0;
    text-align: center;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #ffffff;
}

.login-subtitle {
    margin: 0.4rem 0 0;
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.72);
}

.login-phone {
    display: flex;
    align-items: stretch;
    margin-top: 1.5rem;
    border-radius: 0.85rem;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.28);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.login-phone:focus-within {
    border-color: rgba(13, 222, 184, 0.7);
    background: rgba(255, 255, 255, 0.16);
    box-shadow: 0 0 0 3px rgba(64, 105, 236, 0.28);
}

.login-phone__prefix {
    display: flex;
    align-items: center;
    padding: 0 0.95rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.22);
}

.login-phone__input {
    flex: 1;
    min-width: 0;
    padding: 0.8rem 0.95rem;
    border: 0;
    outline: none;
    background: transparent;
    color: #ffffff;
    font-size: 0.95rem;
}

.login-phone__input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.login-hint {
    margin: 0.75rem 0 1.35rem 0.15rem;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.58);
}

.login-alert {
    margin-top: 0.85rem;
    padding: 0.7rem 0.85rem;
    border-radius: 0.7rem;
    font-size: 0.8rem;
    color: #fff7d6;
    background: rgba(234, 179, 8, 0.18);
    border: 1px solid rgba(250, 204, 21, 0.35);
}

.login-actions {
    display: flex;
    justify-content: flex-end;
}

.login-btn,
a.login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 8.5rem;
    padding: 0.7rem 1.35rem;
    border: 0;
    border-radius: 0.8rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: #ffffff;
    text-decoration: none;
    cursor: pointer;
    background: linear-gradient(135deg, #4069ec 0%, #2b8fe0 50%, #0ddeb8 100%);
    box-shadow: 0 8px 20px rgba(64, 105, 236, 0.35);
    transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.login-btn:hover:not(:disabled) {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(13, 222, 184, 0.28);
}

.login-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(13, 222, 184, 0.4), 0 8px 20px rgba(64, 105, 236, 0.35);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.login-otp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin: 1.5rem 0;
}

.login-otp input {
    width: 2.55rem;
    height: 3rem;
    padding: 0;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 600;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 0.7rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.login-otp input::placeholder {
    color: rgba(255, 255, 255, 0.28);
}

.login-otp input:focus {
    border-color: rgba(13, 222, 184, 0.75);
    background: rgba(255, 255, 255, 0.16);
    box-shadow: 0 0 0 3px rgba(64, 105, 236, 0.28);
}

.login-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 1rem 0;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.7);
}

.login-link {
    color: #7ee7d4;
    cursor: pointer;
    text-decoration: none;
}

.login-link:hover {
    text-decoration: underline;
    color: #0ddeb8;
}

.login-footer-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    font-size: 0.82rem;
}

.login-expire {
    color: #fbbf24;
}

#resendCodeBtn:hover {
    cursor: pointer;
}

@media (max-width: 420px) {
    .login-form-wrap {
        padding: 1.35rem 1.15rem 1.25rem;
    }

    .login-otp {
        gap: 0.28rem;
    }

    .login-otp input {
        width: 2.2rem;
        height: 2.7rem;
        font-size: 1rem;
    }
}

@media (prefers-reduced-transparency: reduce) {
    .login-glass-card {
        background: rgba(21, 27, 54, 0.92);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}
