/* WhatsAppCloud — Modern Login */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.login-page {
    margin: 0;
    min-height: 100vh;
    font-family: "Noto Sans Arabic", sans-serif;
    background: #0a1628;
    overflow-x: hidden;
}

.login-page .preloader {
    background: #0a1628;
    z-index: 9999;
}

.login-page .preloader .loader__figure {
    border-color: #00a884 transparent #00a884 transparent;
}

.login-page .preloader .loader__label {
    color: #e2e8f0;
    letter-spacing: 0.04em;
}

/* ── Shell ── */
.login-shell {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* ── Brand panel ── */
.login-brand {
    flex: 1.1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    overflow: hidden;
    background: linear-gradient(135deg, #004d40 0%, #008069 35%, #00a884 70%, #25d366 100%);
    background-size: 200% 200%;
    animation: loginGradientShift 12s ease infinite;
}

.login-brand__bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.login-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(1px);
    opacity: 0.35;
    animation: loginFloat 8s ease-in-out infinite;
}

.login-orb--1 {
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.45) 0%, transparent 70%);
    top: -80px;
    right: -60px;
    animation-delay: 0s;
}

.login-orb--2 {
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(37, 211, 102, 0.6) 0%, transparent 70%);
    bottom: 10%;
    left: 8%;
    animation-delay: -2s;
    animation-duration: 10s;
}

.login-orb--3 {
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.35) 0%, transparent 70%);
    top: 45%;
    right: 25%;
    animation-delay: -4s;
    animation-duration: 9s;
}

.login-orb--4 {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.15);
    bottom: 22%;
    right: 15%;
    animation-delay: -1s;
    animation-duration: 7s;
}

.login-brand__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 20%, transparent 100%);
}

.login-brand__content {
    position: relative;
    z-index: 2;
    max-width: 480px;
    color: #fff;
    text-align: center;
    animation: loginFadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-brand__logo {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 2rem;
    padding: 24px 40px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    animation: loginLogoPulse 3s ease-in-out infinite;
}

.login-brand__logo img,
.login-brand__logo-text {
    height: 58px;
    width: auto;
}

.login-brand__title {
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    font-weight: 800;
    line-height: 1.35;
    margin: 0 0 1rem;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}

.login-brand__subtitle {
    font-size: 1.05rem;
    line-height: 1.75;
    margin: 0 0 2.5rem;
    opacity: 0.92;
    font-weight: 400;
}

.login-features {
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: right;
}

.login-feature {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    font-size: 0.95rem;
    opacity: 0;
    transform: translateX(24px);
    animation: loginSlideIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.login-feature:nth-child(1) { animation-delay: 0.35s; }
.login-feature:nth-child(2) { animation-delay: 0.5s; }
.login-feature:nth-child(3) { animation-delay: 0.65s; }

.login-feature__icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.login-feature__icon svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

/* ── Form panel ── */
.login-form-panel {
    flex: 0.9;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #f8fafc;
    position: relative;
}

.login-form-panel::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, transparent, rgba(0, 168, 132, 0.25), transparent);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 24px;
    padding: 2.5rem 2.25rem;
    box-shadow:
        0 4px 6px rgba(15, 23, 42, 0.04),
        0 24px 48px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(15, 23, 42, 0.06);
    animation: loginCardIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

.login-card__mobile-logo {
    display: none;
    text-align: center;
    margin-bottom: 1.75rem;
    padding: 16px 24px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.login-card__mobile-logo img,
.login-card__mobile-logo .login-card__mobile-text {
    height: 52px;
    width: auto;
}

.login-card__header {
    margin-bottom: 2rem;
    animation: loginFadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
}

.login-card__header h1 {
    font-size: 1.65rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.5rem;
}

.login-card__header p {
    margin: 0;
    color: #64748b;
    font-size: 0.95rem;
}

.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 1.25rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    color: #b91c1c;
    font-size: 0.9rem;
    animation: loginShake 0.5s ease;
}

.login-alert svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    fill: currentColor;
}

/* ── Fields ── */
.login-field {
    margin-bottom: 1.15rem;
    animation: loginFadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-field:nth-of-type(1) { animation-delay: 0.4s; }
.login-field:nth-of-type(2) { animation-delay: 0.5s; }

.login-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.45rem;
}

.login-input-wrap {
    position: relative;
}

.login-input-wrap__icon {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.25s ease;
}

.login-input-wrap__icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.login-input {
    width: 100%;
    padding: 0.85rem 2.75rem 0.85rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: #0f172a;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    outline: none;
    transition:
        border-color 0.25s ease,
        background 0.25s ease,
        box-shadow 0.25s ease;
}

.login-input::placeholder {
    color: #94a3b8;
}

.login-input:hover {
    border-color: #cbd5e1;
}

.login-input:focus {
    background: #fff;
    border-color: #00a884;
    box-shadow: 0 0 0 4px rgba(0, 168, 132, 0.12);
}

.login-input:focus + .login-input-wrap__icon,
.login-input-wrap:focus-within .login-input-wrap__icon {
    color: #00a884;
}

.login-input.is-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.login-toggle-pwd {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #94a3b8;
    line-height: 0;
    transition: color 0.2s ease;
}

.login-toggle-pwd:hover {
    color: #00a884;
}

.login-toggle-pwd svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* ── Options row ── */
.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    animation: loginFadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.6s both;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.login-remember input {
    width: 18px;
    height: 18px;
    accent-color: #00a884;
    cursor: pointer;
}

.login-remember span {
    font-size: 0.88rem;
    color: #475569;
}

.login-forgot {
    font-size: 0.88rem;
    color: #00a884;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}

.login-forgot:hover {
    color: #008069;
    text-decoration: underline;
}

/* ── Submit ── */
.login-submit-wrap {
    animation: loginFadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.7s both;
}

.login-submit {
    position: relative;
    width: 100%;
    padding: 0.95rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    background: linear-gradient(135deg, #00a884 0%, #008069 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    overflow: hidden;
    transition:
        transform 0.2s ease,
        box-shadow 0.25s ease;
    box-shadow: 0 4px 14px rgba(0, 168, 132, 0.35);
}

.login-submit::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: left 0.5s ease;
}

.login-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 168, 132, 0.4);
}

.login-submit:hover::before {
    left: 100%;
}

.login-submit:active {
    transform: translateY(0);
}

.login-submit.is-loading {
    pointer-events: none;
    opacity: 0.85;
}

.login-submit__spinner {
    display: none;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: loginSpin 0.7s linear infinite;
    margin: 0 auto;
}

.login-submit.is-loading .login-submit__text {
    display: none;
}

.login-submit.is-loading .login-submit__spinner {
    display: block;
}

.login-footer {
    margin-top: 1.75rem;
    text-align: center;
    font-size: 0.82rem;
    color: #94a3b8;
    animation: loginFadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.8s both;
}

/* ── Recover form ── */
.login-recover {
    display: none;
}

.login-recover.is-visible {
    display: block;
    animation: loginFadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-form--hidden {
    display: none !important;
}

.login-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 1.25rem;
    font-size: 0.88rem;
    color: #64748b;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.2s ease;
}

.login-back:hover {
    color: #00a884;
}

.login-back svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.login-recover h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.5rem;
}

.login-recover p {
    color: #64748b;
    font-size: 0.92rem;
    margin: 0 0 1.5rem;
    line-height: 1.6;
}

.login-btn-secondary {
    width: 100%;
    padding: 0.9rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    color: #64748b;
    background: #f1f5f9;
    border: none;
    border-radius: 12px;
    cursor: not-allowed;
    opacity: 0.8;
}

/* ── Keyframes ── */
@keyframes loginGradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes loginFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-24px) scale(1.04); }
}

@keyframes loginFadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes loginSlideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes loginCardIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes loginLogoPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

@keyframes loginShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

@keyframes loginSpin {
    to { transform: rotate(360deg); }
}

/* ── Responsive ── */
@media (max-width: 991px) {
    .login-shell {
        flex-direction: column;
    }

    .login-brand {
        flex: none;
        padding: 2.5rem 1.5rem 2rem;
        min-height: auto;
    }

    .login-brand__title {
        font-size: 1.5rem;
    }

    .login-brand__subtitle {
        margin-bottom: 1.5rem;
        font-size: 0.95rem;
    }

    .login-features {
        display: none;
    }

    .login-form-panel {
        flex: 1;
        padding: 1.5rem;
        border-radius: 24px 24px 0 0;
        margin-top: -20px;
        z-index: 3;
    }

    .login-form-panel::before {
        display: none;
    }

    .login-card__mobile-logo {
        display: block;
    }

    .login-card {
        padding: 2rem 1.5rem;
        box-shadow: none;
        border: none;
        background: transparent;
    }
}

@media (max-width: 480px) {
    .login-brand {
        padding: 2rem 1.25rem 1.5rem;
    }

    .login-brand__logo img,
    .login-brand__logo-text {
        height: 46px;
    }

    .login-options {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
