.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    background: #0f0c29;
    background-image:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(102, 126, 234, 0.45) 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 85% 20%, rgba(201, 162, 39, 0.22) 0%, transparent 50%),
        radial-gradient(ellipse 60% 70% at 50% 100%, rgba(118, 75, 162, 0.35) 0%, transparent 55%),
        linear-gradient(160deg, #0f0c29 0%, #1a1535 40%, #242043 100%);
}

.login-page::before,
.login-page::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: loginFloat 12s ease-in-out infinite;
}

.login-page::before {
    width: 420px;
    height: 420px;
    top: -120px;
    right: -80px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.18) 0%, transparent 70%);
}

.login-page::after {
    width: 360px;
    height: 360px;
    bottom: -100px;
    left: -60px;
    background: radial-gradient(circle, rgba(201, 162, 39, 0.12) 0%, transparent 70%);
    animation-delay: -6s;
}

@keyframes loginFloat {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.85; }
    50% { transform: translateY(-18px) scale(1.04); opacity: 1; }
}

.login-shell {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
    animation: loginFadeUp 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes loginFadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 28px;
    padding: 2.5rem 2.25rem 2rem;
    box-shadow:
        0 32px 64px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 1px 0 rgba(255, 255, 255, 0.12) inset;
}

.login-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 28px;
    padding: 1px;
    background: linear-gradient(145deg, rgba(255,255,255,0.25), rgba(102,126,234,0.15), rgba(201,162,39,0.2));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.login-brand {
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-logo {
    width: 96px;
    height: 96px;
    margin: 0 auto 1rem;
    filter: drop-shadow(0 8px 24px rgba(102, 126, 234, 0.45));
}

.login-wordmark {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #ffffff 0%, #d4c4ff 45%, #c9a227 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.35rem;
}

.login-tagline {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.82rem;
    letter-spacing: 0.5px;
}

.login-title {
    color: rgba(255, 255, 255, 0.92);
    font-size: 1.05rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-label {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 0.45rem;
}

.login-field {
    position: relative;
    margin-bottom: 1.15rem;
}

.login-field-icon {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    color: rgba(102, 126, 234, 0.85);
    font-size: 0.95rem;
    pointer-events: none;
}

.login-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.07) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
    border-radius: 14px;
    padding: 0.9rem 2.75rem 0.9rem 1rem !important;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.login-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.login-input:focus {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(102, 126, 234, 0.65) !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2) !important;
    outline: none;
}

.password-toggle {
    position: absolute;
    top: 50%;
    left: 0.85rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.45);
    padding: 0.35rem 0.5rem;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.password-toggle:hover {
    color: rgba(201, 162, 39, 0.95);
}

.login-field.password-field .login-input {
    padding-left: 2.75rem !important;
}

.login-hint {
    color: rgba(255, 255, 255, 0.38);
    font-size: 0.75rem;
    margin-top: 0.35rem;
}

.login-remember {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.88rem;
}

.login-remember .form-check-input {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
}

.login-remember .form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

.login-btn {
    width: 100%;
    padding: 0.95rem 1rem;
    border: none;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 55%, #9b7bff 100%);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.login-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.18) 50%, transparent 60%);
    transform: translateX(-100%);
    transition: transform 0.5s;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(102, 126, 234, 0.5);
    color: #fff;
}

.login-btn:hover::after {
    transform: translateX(100%);
}

.login-alert {
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.35);
    color: #ffb4bc;
    border-radius: 12px;
    font-size: 0.85rem;
}

.login-footer {
    text-align: center;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.login-footer p {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.78rem;
    margin-bottom: 0.25rem;
}

.login-footer .echo-brand {
    color: rgba(102, 126, 234, 0.85);
    font-weight: 600;
    text-decoration: none;
}

.login-footer .echo-brand:hover {
    color: #c9a227;
}

.login-badge {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 575px) {
    .login-page {
        padding: 1rem;
        align-items: flex-start;
        padding-top: max(1.5rem, env(safe-area-inset-top));
    }

    .login-card {
        padding: 1.75rem 1.25rem 1.5rem;
        border-radius: 22px;
    }

    .login-logo {
        width: 72px;
        height: 72px;
    }

    .login-wordmark {
        font-size: 1.75rem;
    }

    .login-title {
        font-size: 0.95rem;
        margin-bottom: 1.25rem;
    }

    .login-input {
        font-size: 16px !important; /* يمنع zoom على iOS */
        padding-top: 0.85rem !important;
        padding-bottom: 0.85rem !important;
    }

    .login-btn {
        padding: 0.85rem;
        font-size: 0.95rem;
    }
}
