﻿/* ============================================================
   default.css (v5) - Login page
   Palette: Navy + Royal blue + White only
   Mobile: app-style hero with bottom sheet card
   Desktop: split screen
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&family=Cairo:wght@600;700;800&display=swap');

/* Start Design Tokens */
:root {
    --navy: #0b2a6f;
    --royal: #1f5cff;
    --white: #ffffff;
    --navy-soft: rgba(11, 42, 111, 0.62);
    --navy-faint: rgba(11, 42, 111, 0.4);
    --royal-line: rgba(31, 92, 255, 0.28);
    --royal-tint: rgba(31, 92, 255, 0.06);
    --white-soft: rgba(255, 255, 255, 0.78);
    --white-glass: rgba(255, 255, 255, 0.1);
    --radius-sm: 14px;
    --radius-sheet: 32px;
    --font-body: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
    --font-display: 'Cairo', 'Tajawal', sans-serif;
    --ease-out: cubic-bezier(0.22, 0.8, 0.3, 1);
}
/* End Design Tokens */

/* Start Base */
html,
body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background-color: var(--navy);
}

body {
    font-family: var(--font-body);
    color: var(--navy);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

#frmLogin {
    min-height: 100vh;
    min-height: 100dvh;
}

.split *,
.modal * {
    box-sizing: border-box;
}
/* End Base */

/* Start Layout (mobile first) */
.split {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    background: var(--navy);
}
/* End Layout */

/* Start Brand Panel */
.split-brand {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(40px + env(safe-area-inset-top, 0px)) 24px 44px;
    background: linear-gradient(165deg, var(--navy) 0%, var(--navy) 60%, #12419f 130%);
    overflow: hidden;
    animation: fade-down 0.6s var(--ease-out) both;
}

    /* Decorative soft circles */
    .split-brand::before,
    .split-brand::after {
        content: "";
        position: absolute;
        border-radius: 50%;
        background: var(--white-glass);
        pointer-events: none;
    }

    .split-brand::before {
        width: 260px;
        height: 260px;
        top: -110px;
        inset-inline-end: -80px;
    }

    .split-brand::after {
        width: 180px;
        height: 180px;
        bottom: -90px;
        inset-inline-start: -60px;
    }

.brand-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 480px;
}

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin-bottom: 16px;
    border-radius: 22px;
    background: var(--white);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.25);
    color: var(--royal);
    font-size: 30px;
}

.brand-name {
    margin: 0;
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 800;
    line-height: 1.3;
    color: var(--white);
}

.brand-owner {
    margin: 6px 0 0;
    font-size: 15px;
    font-weight: 500;
    color: var(--white-soft);
}
/* End Brand Panel */

/* Start Form Side (bottom sheet on mobile) */
.split-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: -24px;
    padding: 32px 22px calc(22px + env(safe-area-inset-bottom, 0px));
    border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
    background: var(--white);
    box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.18);
    animation: sheet-up 0.65s 0.1s var(--ease-out) both;
}

.login-box {
    width: 100%;
    max-width: 420px;
}

.login-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 25px;
    font-weight: 800;
    color: var(--navy);
}

.login-hint {
    margin: 6px 0 26px;
    font-size: 14.5px;
    color: var(--navy-soft);
}

.field {
    margin-bottom: 16px;
}

.field-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--navy);
}

.field-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.field-adornment {
    position: absolute;
    inset-inline-start: 16px;
    display: flex;
    align-items: center;
    color: var(--navy-faint);
    font-size: 15px;
    pointer-events: none;
    transition: color 0.2s;
}

.field-wrap:focus-within .field-adornment {
    color: var(--royal);
}

.field-input {
    display: block;
    width: 100%;
    height: 54px;
    padding: 0 46px;
    border: 1.5px solid var(--royal-line);
    border-radius: var(--radius-sm);
    background: var(--royal-tint);
    color: var(--navy);
    font-family: inherit;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

    .field-input::placeholder {
        color: var(--navy-faint);
    }

    .field-input:hover {
        border-color: var(--royal);
    }

    .field-input:focus {
        outline: none;
        border-color: var(--royal);
        background: var(--white);
        box-shadow: 0 0 0 4px rgba(31, 92, 255, 0.15);
    }

    .field-input:-webkit-autofill,
    .field-input:-webkit-autofill:focus {
        -webkit-text-fill-color: var(--navy);
        -webkit-box-shadow: 0 0 0 60px var(--white) inset;
        transition: background-color 9999s ease-out 0s;
    }

.field-input--password {
    padding-inline-end: 46px;
}

.field-toggle {
    position: absolute;
    inset-inline-end: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--navy-faint);
    font-size: 15px;
    cursor: pointer;
    transition: color 0.2s, background-color 0.2s;
}

    .field-toggle:hover {
        color: var(--royal);
        background: var(--royal-tint);
    }

    .field-toggle:focus-visible {
        outline: 2px solid var(--royal);
        outline-offset: 2px;
    }

.btn-login {
    display: block;
    width: 100%;
    height: 56px;
    margin-top: 24px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--royal);
    box-shadow: 0 12px 26px rgba(31, 92, 255, 0.35);
    color: var(--white);
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.15s, box-shadow 0.25s;
}

    .btn-login:hover {
        background: #164be0;
        box-shadow: 0 16px 32px rgba(31, 92, 255, 0.45);
    }

    .btn-login:active {
        transform: scale(0.97);
    }

    .btn-login:focus-visible {
        outline: 3px solid var(--navy);
        outline-offset: 3px;
    }

.login-foot {
    margin: auto 0 0;
    padding-top: 24px;
    font-size: 12.5px;
    color: var(--navy-faint);
    text-align: center;
}
/* End Form Side */

/* Start Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

    .modal[hidden] {
        display: none;
    }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(11, 42, 111, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.modal-dialog {
    position: relative;
    width: 100%;
    max-width: 360px;
    padding: 32px 24px 24px;
    border-radius: 26px;
    background: var(--white);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
    text-align: center;
    animation: pop-in 0.35s var(--ease-out) both;
}

.modal-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    font-size: 26px;
}

    .modal-icon > i {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 64px;
        height: 64px;
        border-radius: 50%;
        color: var(--white);
    }

        .modal-icon > i[hidden] {
            display: none;
        }

.modal-icon-success {
    background: var(--royal);
}

.modal-icon-error {
    background: var(--navy);
}

.modal-message {
    margin: 0 0 22px;
    font-size: 15.5px;
    line-height: 1.8;
    color: var(--navy);
}

.modal-close {
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--royal);
    color: var(--white);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.15s;
}

    .modal-close:hover {
        background: #164be0;
    }

    .modal-close:active {
        transform: scale(0.97);
    }

.spinner {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 4px solid rgba(31, 92, 255, 0.2);
    border-top-color: var(--royal);
    animation: spin 0.8s linear infinite;
}

    .spinner[hidden] {
        display: none;
    }
/* End Modal */

/* Start Animations */
@keyframes fade-down {
    from {
        opacity: 0;
        transform: translateY(-14px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes sheet-up {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes pop-in {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes rise-in-flat {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}
/* End Animations */

/* Start Desktop Split Screen */
@media (min-width: 940px) {
    .split {
        flex-direction: row;
        align-items: stretch;
    }

    .split-brand {
        flex: 1 1 50%;
        padding: 56px 64px;
    }

        .split-brand::before {
            width: 420px;
            height: 420px;
            top: -160px;
            inset-inline-end: -140px;
        }

        .split-brand::after {
            width: 300px;
            height: 300px;
            bottom: -140px;
            inset-inline-start: -100px;
        }

    .brand-logo {
        width: 96px;
        height: 96px;
        margin-bottom: 22px;
        border-radius: 28px;
        font-size: 40px;
    }

    .brand-name {
        font-size: 46px;
    }

    .brand-owner {
        font-size: 18px;
    }

    .split-form {
        flex: 1 1 50%;
        justify-content: center;
        margin-top: 0;
        padding: 56px 64px 32px;
        border-radius: 0;
        box-shadow: none;
        animation: rise-in-flat 0.6s 0.1s var(--ease-out) both;
    }

    .login-box {
        margin-block: auto;
    }

    .login-title {
        font-size: 29px;
    }

    .login-foot {
        margin-top: 0;
    }
}
/* End Desktop Split Screen */

/* Start Compact Screens */
@media (max-width: 380px) {
    .split-form {
        padding-inline: 18px;
    }

    .brand-name {
        font-size: 26px;
    }
}

@media (max-height: 620px) and (max-width: 939px) {
    .brand-logo {
        display: none;
    }

    .split-brand {
        padding-top: calc(22px + env(safe-area-inset-top, 0px));
        padding-bottom: 36px;
    }
}
/* End Compact Screens */

/* Start Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .split-brand,
    .split-form,
    .modal-dialog,
    .spinner {
        animation: none;
    }

    .field-input,
    .btn-login,
    .field-toggle,
    .modal-close {
        transition: none;
    }
}
/* End Reduced Motion */
