@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap');

/* ============ Reset & Base ============ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: auto;
}

body {
    background: #e0e5ec;
    font-family: 'Cairo', Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100dvh;
    /* أصح للموبايل من 100vh */
    margin: 0;
    padding: 16px;
    /* تنفّس داخلي آمن */
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

/* ============ Layout ============ */
.container-login {
    width: 100%;
    max-width: 420px;
    /* كرت مناسب للموبايل */
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ============ Logo ============ */
.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.animated-logo {
    width: clamp(120px, 35vw, 180px);
    height: auto;
    opacity: 0;
    margin-bottom: 1.25rem;
    transform: translateY(-30px) scale(0.95);
    border-radius: 20px;
    animation: fadeSlideIn 1.5s ease-out forwards;
}

@media (hover: hover) {
    .animated-logo:hover {
        transform: scale(1.05);
        box-shadow: 0 12px 25px rgba(0, 0, 0, 0.25);
        transition: all 0.3s ease-in-out;
    }
}

@media (hover: none) {
    .animated-logo:hover {
        transform: none;
        box-shadow: none;
    }
}

/* Animation */
@keyframes fadeSlideIn {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============ Welcome Text ============ */
.welcome-text {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.75rem;
    letter-spacing: 1px;
    text-align: center;
}

.welcome-text h1 {
    margin: 0;
    font-size: clamp(20px, 6vw, 28px);
    font-weight: bold;
    color: #222;
    line-height: 1.25;
    font-family: cursive;
}

.welcome-text h1 span {
    color: #007bff;
    padding-right: 3px;
}

/* ============ Card ============ */
.neumorphic-card {
    width: 100%;
    max-width: 100%;
    background: #e0e5ec;
    padding: 18px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 6px 6px 18px #cfd3d8, -6px -6px 18px #ffffff;
}

.neumorphic-card h2 {
    margin: 0 0 16px;
    color: #1e293b;
    font-weight: 800;
}

.neumorphic-card h2 span {
    color: #007bff;
    font-weight: bolder;
}

/* ============ Form ============ */
form#loginForm {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* Inputs */
.neumorphic-input {
    border: none;
    outline: none;
    width: 100%;
    padding: 14px 16px;
    border-radius: 18px;
    background: #e0e5ec;
    box-shadow: inset 8px 8px 16px #c5c9ce, inset -8px -8px 16px #ffffff;
    font-size: clamp(14px, 3.8vw, 16px);
    transition: background-color .2s ease;
}

@media (hover: hover) {
    .neumorphic-input:hover {
        background-color: rgba(24, 166, 255, 0.08);
    }
}

.neumorphic-input:focus {
    border-bottom: 2px solid #007bff;
}

/* Password field */
.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper input {
    width: 100%;
    background: transparent;
    font-size: 16px;
    margin-left: 0;
    /* إزالة -1.3rem القديمة */
    padding-right: 44px;
    /* مساحة لأيقونة الإظهار */
}

.toggle-password {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 18px;
    user-select: none;
    color: #666;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
}

@media (hover: hover) {
    .toggle-password:hover {
        color: #000;
    }
}

/* Row under password (تذكّرني/نسيت كلمة المرور) */
.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 6px 0 12px;
}

.remember {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.linklike {
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    color: #007bff;
    font: inherit;
}

@media (hover: hover) {
    .linklike:hover {
        color: #004c7a;
        text-decoration: underline;
    }
}

/* Buttons */
.bubbly-button,
.neumorphic-button,
#submitLogin {
    width: 100%;
    padding: 14px 16px;
    border-radius: 18px;
    font-size: 16px;
    border: none;
    cursor: pointer;
}

/* ============ Footer link ============ */
.login-or-signup {
    margin-top: 14px;
    font-size: 14px;
    color: #333;
    text-align: center;
    direction: rtl;
    /* لأن النص بالعربي */
}

.login-or-signup p {
    margin: 0;
    line-height: 1.6;
}

.login-or-signup a {
    font-weight: bold;
    color: #006ca6;
    text-decoration: none;
    transition: all 0.3s ease-in-out;
    border-bottom: 1px dashed transparent;
}

@media (hover: hover) {
    .login-or-signup a:hover {
        color: #004c7a;
        border-bottom: 1px dashed #004c7a;
        letter-spacing: .3px;
    }
}

/* ============ Responsive upsizes ============ */
@media (min-width: 480px) {
    .neumorphic-card {
        padding: 20px;
        border-radius: 18px;
    }
}

@media (min-width: 640px) {
    .container-login {
        max-width: 500px;
    }

    .neumorphic-card {
        padding: 24px;
    }
}