﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport for mobile browsers */
    background: linear-gradient(135deg, #020617, #0f172a, #111827);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    overflow-x: hidden;
    overflow-y: auto;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); /* Notch/island safe area */
}

/* ── Background effects ── */
.background-glow {
    position: fixed;
    width: clamp(300px, 50vw, 700px);
    height: clamp(300px, 50vw, 700px);
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.18);
    filter: blur(120px);
    animation: pulse 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.syria-map {
    position: fixed;
    width: clamp(320px, 60vw, 900px);
    opacity: 0.08;
    animation: floatMap 8s ease-in-out infinite;
    z-index: 0;
    filter: drop-shadow(0 0 30px rgba(59, 130, 246, 0.4));
    pointer-events: none;
}

@keyframes floatMap {
    0%, 100% {
        transform: translateY(0px) rotate(-1deg);
    }

    50% {
        transform: translateY(-20px) rotate(1deg);
    }
}

.particles span {
    position: fixed;
    width: 4px;
    height: 4px;
    background: rgba(96, 165, 250, 0.8);
    border-radius: 50%;
    animation: particleMove linear infinite;
}

@keyframes particleMove {
    from {
        transform: translateY(100vh);
    }

    to {
        transform: translateY(-100vh);
    }
}

/* ── Main container ── */
.login-container {
    position: relative;
    z-index: 2;
    width: 92%;
    max-width: 1150px;
    min-height: 680px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    border-radius: 36px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.45);
    margin: 20px auto;
}

/* ── Left side ── */
.left-side {
    position: relative;
    padding: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.logo {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 800;
    margin-bottom: 35px;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
    flex-shrink: 0;
}

h1 {
    font-size: clamp(32px, 4vw, 58px);
    line-height: 1.15;
    margin-bottom: 25px;
    font-weight: 800;
}

    h1 span {
        background: linear-gradient(90deg, #3b82f6, #8b5cf6);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

.description {
    color: #cbd5e1;
    line-height: 2;
    font-size: clamp(14px, 1.5vw, 18px);
    max-width: 500px;
}

.floating-box {
    position: absolute;
    bottom: 40px;
    left: 40px;
    width: 280px;
    padding: 22px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    animation: floating 4s ease-in-out infinite;
}

    .floating-box h3 {
        margin-bottom: 8px;
        font-size: 22px;
    }

    .floating-box p {
        color: #cbd5e1;
        line-height: 1.8;
        font-size: 14px;
    }

@keyframes floating {
    0%, 100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* ── Right side / Card ── */
.right-side {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    position: relative;
}

.login-card {
    width: 100%;
    max-width: 430px;
    padding: 45px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: fadeUp 1s ease;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0px);
    }
}

.login-card h2 {
    font-size: clamp(24px, 3vw, 36px);
    margin-bottom: 10px;
}

.login-card .subtitle {
    color: #cbd5e1;
    margin-bottom: 35px;
    line-height: 1.8;
}

/* ── Form elements ── */
.input-group {
    margin-bottom: 20px;
    position: relative;
}

    .input-group input {
        width: 100%;
        padding: 18px 20px;
        border-radius: 16px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        background: rgba(255, 255, 255, 0.06);
        color: white;
        outline: none;
        font-size: 15px;
        transition: 0.3s ease;
        /* Prevent iOS zoom on focus (font-size must be ≥ 16px on mobile) */
    }

        .input-group input:focus {
            border-color: #3b82f6;
            box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
        }

        .input-group input::placeholder {
            color: #94a3b8;
        }

.password-group {
    position: relative;
}

.toggle-password {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 18px;
    color: #94a3b8;
    transition: 0.3s;
    /* Touch target ≥ 44px for accessibility */
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .toggle-password:hover {
        color: #3b82f6;
    }

.remember-wrapper {
    margin-top: 15px;
    margin-bottom: 20px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

    .remember-me input {
        display: none;
    }

.checkmark {
    width: 22px;
    height: 22px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    position: relative;
    transition: 0.3s ease;
    flex-shrink: 0; /* Don't shrink on small screens */
}

.remember-me input:checked + .checkmark {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-color: transparent;
}

    .remember-me input:checked + .checkmark::after {
        content: '✓';
        position: absolute;
        color: white;
        font-size: 14px;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

.remember-text {
    color: #e2e8f0;
    font-size: 15px;
}

.login-btn {
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 18px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.35s ease;
    margin-top: 10px;
    box-shadow: 0 12px 35px rgba(59, 130, 246, 0.35);
    /* Prevent double-tap zoom on mobile */
    touch-action: manipulation;
    /* min tap target */
    min-height: 56px;
}

    .login-btn:hover {
        transform: translateY(-4px) scale(1.02);
    }

    .login-btn:active {
        transform: scale(0.98);
    }

.extra-links {
    margin-top: 25px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

    .extra-links a {
        color: #93c5fd;
        text-decoration: none;
        font-size: 14px;
        transition: 0.3s ease;
        /* min tap target */
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

        .extra-links a:hover {
            color: white;
        }

/* ══════════════════════════════════════════════
       RESPONSIVE BREAKPOINTS
    ══════════════════════════════════════════════ */

/* ── Tablet landscape  (≤ 1100px) ── */
@media (max-width: 1100px) {
    .left-side {
        padding: 50px;
    }

    .login-card {
        padding: 35px;
    }
}

/* ── Tablet portrait  (≤ 992px) ── */
@media (max-width: 992px) {
    .login-container {
        grid-template-columns: 1fr;
        min-height: auto;
        border-radius: 28px;
        width: 95%;
    }

    .left-side {
        padding: 50px 35px 130px;
        text-align: center;
        align-items: center;
    }

    .logo {
        margin-bottom: 24px;
    }

    .floating-box {
        left: 50%;
        transform: translateX(-50%);
        bottom: 20px;
        animation: none; /* avoid layout shift on tablet */
    }

    h1 {
        font-size: 44px;
    }

    .description {
        font-size: 16px;
    }

    .right-side {
        padding: 30px 35px 50px;
    }

    .login-card {
        max-width: 100%;
        border-radius: 24px;
    }
}

/* ── Mobile large  (≤ 600px) ── */
@media (max-width: 600px) {
    body {
        padding: 12px;
    }

    .login-container {
        border-radius: 24px;
        width: 100%;
        margin: 12px auto;
    }

    .left-side {
        padding: 40px 24px 130px;
    }

    h1 {
        font-size: 34px;
    }

    .logo {
        width: 64px;
        height: 64px;
        font-size: 24px;
        border-radius: 18px;
    }

    .description {
        font-size: 14px;
        line-height: 1.8;
    }

    .floating-box {
        width: calc(100% - 48px);
        left: 24px;
        transform: none;
    }

    .right-side {
        padding: 24px 20px 36px;
    }

    .login-card {
        padding: 28px 20px;
        border-radius: 20px;
    }

        .login-card h2 {
            font-size: 26px;
        }

    .input-group input {
        padding: 16px 18px;
        /* Prevent iOS zoom — font-size must be ≥ 16px */
        font-size: 16px;
    }

    .login-btn {
        padding: 16px;
        font-size: 15px;
    }

    .extra-links {
        justify-content: center;
    }

    .syria-map {
        width: 420px;
    }

    .background-glow {
        filter: blur(60px);
    }
}

/* ── Mobile small  (≤ 380px) ── */
@media (max-width: 380px) {
    h1 {
        font-size: 28px;
    }

    .login-card h2 {
        font-size: 22px;
    }

    .left-side {
        padding: 32px 18px 120px;
    }

    .login-card {
        padding: 24px 16px;
    }

    .floating-box {
        padding: 16px;
    }

        .floating-box h3 {
            font-size: 18px;
        }

        .floating-box p {
            font-size: 13px;
        }
}

/* ── Landscape phone  (short height) ── */
@media (max-height: 500px) and (orientation: landscape) {
    .login-container {
        grid-template-columns: 1fr 1fr; /* restore two columns */
        min-height: auto;
    }

    .left-side {
        padding: 30px;
        text-align: left;
        align-items: flex-start;
    }

    .floating-box {
        display: none;
    }
    /* not enough vertical space */

    .logo {
        width: 50px;
        height: 50px;
        font-size: 20px;
        margin-bottom: 16px;
    }

    h1 {
        font-size: 26px;
        margin-bottom: 12px;
    }

    .description {
        font-size: 13px;
    }

    .right-side {
        padding: 20px;
    }

    .login-card {
        padding: 22px 20px;
    }

    .input-group {
        margin-bottom: 12px;
    }

        .input-group input {
            padding: 12px 16px;
        }

    .login-btn {
        padding: 14px;
    }

    .login-card .subtitle {
        margin-bottom: 18px;
    }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .background-glow,
    .syria-map,
    .floating-box,
    .particles span,
    .login-card {
        animation: none;
    }

    .login-btn:hover {
        transform: none;
    }
}
