/* =====================================================
   login.css  v5.0  —  lighter colors, centered mobile
   ===================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ── */
html, body {
    height: 100%;
}

body {
    font-family: 'Assistant', sans-serif;
    direction: rtl;
    min-height: 100svh;
    background: linear-gradient(145deg, #2563eb 0%, #3b82f6 45%, #60a5fa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    -webkit-font-smoothing: antialiased;
}

/* ── Soft texture on background ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 45% at 75% 5%,  rgba(255,255,255,.18) 0%, transparent 60%),
        radial-gradient(ellipse 45% 40% at 20% 90%, rgba(255,255,255,.10) 0%, transparent 55%);
    pointer-events: none;
    z-index: 0;
}

/* orb elements – hidden */
.lg-orb { display: none; }

/* ── Card ── */
.lg-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 22px;
    padding: 44px 40px 36px;
    box-shadow:
        0 2px 6px   rgba(37,99,235,.10),
        0 12px 32px rgba(37,99,235,.20),
        0 40px 80px rgba(37,99,235,.15);
    animation: lg-appear .4s ease both;
}

@keyframes lg-appear {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Logo ── */
.lg-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.lg-logo-ring {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    background: linear-gradient(145deg, #eff6ff, #dbeafe);
    border: 2px solid rgba(59,130,246,.15);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-shadow: 0 4px 14px rgba(37,99,235,.18);
}

.lg-logo-ring img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ── Heading ── */
.lg-head {
    text-align: center;
    margin-bottom: 28px;
}

.lg-head h1 {
    font-size: 1.7rem;
    font-weight: 800;
    color: #1e3a8a;
    margin-bottom: 4px;
    letter-spacing: -.3px;
}

.lg-sub {
    font-size: .92rem;
    color: #6b7280;
    font-weight: 500;
}

/* ── Alerts ── */
.lg-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: .88rem;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 20px;
}

.lg-alert i { flex-shrink: 0; font-size: 1rem; margin-top: 1px; }

.lg-alert-err {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.lg-alert-ok {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* ── Input row ── */
.lg-field-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid #d1d5db;
    border-radius: 12px;
    background: #f8faff;
    margin-bottom: 14px;
    transition: border-color .2s, box-shadow .2s, background .2s;
    overflow: hidden;
}

.lg-field-wrap:focus-within {
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59,130,246,.18);
}

.lg-ico {
    width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    color: #9ca3af;
    flex-shrink: 0;
    transition: color .2s;
}

.lg-field-wrap:focus-within .lg-ico { color: #3b82f6; }

.lg-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 13px 2px 13px 12px;
    font-family: 'Assistant', sans-serif;
    font-size: .97rem;
    font-weight: 500;
    color: #111827;
    direction: rtl;
    outline: none;
    min-width: 0;
}

.lg-input::placeholder { color: #c4cada; font-weight: 400; }

.lg-eye {
    background: none;
    border: none;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #9ca3af;
    font-size: .9rem;
    transition: color .2s;
    flex-shrink: 0;
}
.lg-eye:hover { color: #3b82f6; }

/* ── Toggle (password / OTP) ── */
.lg-toggle-wrap {
    display: flex;
    gap: 6px;
    background: #f0f4ff;
    border-radius: 12px;
    padding: 5px;
    margin-bottom: 16px;
}

.lg-tab {
    flex: 1;
    padding: 10px 8px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #93a3c0;
    font-family: 'Assistant', sans-serif;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    transition: background .2s, color .2s, box-shadow .2s;
    min-height: 42px;
}

.lg-tab:hover:not(.lg-tab-on) {
    background: rgba(59,130,246,.10);
    color: #2563eb;
}

.lg-tab.lg-tab-on {
    background: #ffffff;
    color: #1d4ed8;
    font-weight: 700;
    box-shadow: 0 1px 6px rgba(37,99,235,.14), 0 0 0 1px rgba(59,130,246,.10);
}

.lg-tab:disabled { opacity: .4; cursor: not-allowed; }

/* ── Submit button ── */
.lg-btn {
    width: 100%;
    min-height: 48px;
    padding: 13px 20px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-family: 'Assistant', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    transition: filter .2s, transform .18s, box-shadow .18s;
    box-shadow: 0 4px 16px rgba(37,99,235,.35);
    margin-top: 4px;
    letter-spacing: .15px;
}

.lg-btn:hover:not(:disabled) {
    filter: brightness(1.10);
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(37,99,235,.42);
}

.lg-btn:active:not(:disabled) {
    filter: brightness(.97);
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(37,99,235,.28);
}

.lg-btn:disabled { opacity: .5; cursor: not-allowed; }

/* OTP send button — sky */
.lg-btn-teal {
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
    box-shadow: 0 4px 16px rgba(14,165,233,.30);
}
.lg-btn-teal:hover:not(:disabled) { box-shadow: 0 6px 20px rgba(14,165,233,.40); }

/* Loading */
.lg-btn.loading { pointer-events: none; opacity: .72; }
.lg-btn.loading::after {
    content: '';
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lg-spin .65s linear infinite;
}
@keyframes lg-spin { to { transform: rotate(360deg); } }

/* ── Footer ── */
.lg-footer {
    margin-top: 28px;
    text-align: center;
    font-size: .78rem;
    color: #9ca3af;
    line-height: 1.8;
}
.lg-footer strong { color: #6b7280; font-weight: 600; }

/* =====================================================
   MOBILE  ≤ 540px
   ===================================================== */
@media (max-width: 540px) {
    body {
        align-items: center;
        padding: 24px 16px;
        min-height: 100svh;
    }

    .lg-card {
        max-width: 100%;
        border-radius: 18px;
        padding: 34px 24px 28px;
        box-shadow:
            0 2px 6px   rgba(37,99,235,.10),
            0 10px 28px rgba(37,99,235,.18);
    }

    .lg-logo-ring {
        width: 68px;
        height: 68px;
        border-radius: 15px;
        padding: 10px;
    }

    .lg-head { margin-bottom: 22px; }
    .lg-head h1 { font-size: 1.5rem; }
    .lg-sub  { font-size: .88rem; }

    /* prevent iOS zoom on inputs */
    .lg-input { font-size: 16px; }

    .lg-tab { font-size: .84rem; padding: 9px 6px; min-height: 40px; gap: 5px; }

    .lg-btn { font-size: .97rem; min-height: 50px; }

    .lg-footer { margin-top: 22px; font-size: .75rem; }
}

/* =====================================================
   Very small  ≤ 360px
   ===================================================== */
@media (max-width: 360px) {
    body { padding: 16px 10px; }
    .lg-card { padding: 28px 16px 22px; }
    .lg-logo-ring { width: 58px; height: 58px; }
    .lg-head h1 { font-size: 1.3rem; }
    .lg-tab { font-size: .8rem; padding: 8px 4px; }
}

/* =====================================================
   Dark mode
   ===================================================== */
@media (prefers-color-scheme: dark) {
    body { background: linear-gradient(145deg, #1e3a8a 0%, #1d4ed8 45%, #2563eb 100%); }

    .lg-card {
        background: #0f172a;
        box-shadow: 0 2px 6px rgba(0,0,0,.35), 0 12px 32px rgba(0,0,0,.50);
    }

    .lg-logo-ring  { background: linear-gradient(145deg, #1e3264, #1e40af); border-color: rgba(96,165,250,.15); }
    .lg-head h1    { color: #bfdbfe; }
    .lg-sub        { color: #94a3b8; }

    .lg-field-wrap { background: #1e293b; border-color: #334155; }
    .lg-field-wrap:focus-within { background: #1e2d4a; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.18); }
    .lg-ico        { color: #475569; }
    .lg-field-wrap:focus-within .lg-ico { color: #60a5fa; }
    .lg-input      { color: #e2e8f0; }
    .lg-input::placeholder { color: #475569; }
    .lg-eye        { color: #475569; }
    .lg-eye:hover  { color: #60a5fa; }

    .lg-toggle-wrap    { background: #1e293b; }
    .lg-tab            { color: #475569; }
    .lg-tab.lg-tab-on  { background: #1e3a8a; color: #bfdbfe; box-shadow: 0 1px 6px rgba(0,0,0,.35); }
    .lg-tab:hover:not(.lg-tab-on) { background: rgba(59,130,246,.12); color: #93c5fd; }

    .lg-alert-err { background: rgba(220,38,38,.12); color: #f87171; border-color: rgba(220,38,38,.3); }
    .lg-alert-ok  { background: rgba(22,163,74,.12);  color: #4ade80; border-color: rgba(22,163,74,.3); }

    .lg-footer        { color: #475569; }
    .lg-footer strong { color: #64748b; }
}
