/* =========================================================
   AUTH LAYOUT
========================================================= */

:root {

    --auth-primary: #0b4f9c;
    --auth-primary-dark: #083b75;
    --auth-primary-light: #eaf3ff;

    --auth-text: #172033;
    --auth-muted: #6b7280;

    --auth-border: #d9e0e8;
    --auth-background: #f7f9fc;
    --auth-white: #ffffff;

    --auth-danger: #dc3545;
    --auth-success: #198754;

    --auth-radius: 12px;

    --auth-shadow:
        0 20px 60px rgba(15, 23, 42, 0.10);
}


/* =========================================================
   RESET
========================================================= */

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    min-height: 100%;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;

    background: var(--auth-background);

    color: var(--auth-text);

    font-family:
        "Cairo",
        "Tahoma",
        "Arial",
        sans-serif;

    overflow-x: hidden;
}

button,
input,
textarea,
select {
    font-family: inherit;
}

button {
    border: 0;
}

a {
    text-decoration: none;
}


/* =========================================================
   MAIN AUTH PAGE
========================================================= */

.auth-page {

    width: 100%;
    min-height: 100vh;

    display: grid;

    /*
       الشمال للصورة
       اليمين للمحتوى
    */
    grid-template-columns: 50% 50%;

    direction: ltr;

    background: var(--auth-white);
}


/* =========================================================
   LEFT IMAGE
========================================================= */

.auth-image {

    position: relative;

    width: 100%;
    min-height: 100vh;

    overflow: hidden;

    background: #e9eef5;
}

.auth-image picture {

    display: block;

    width: 100%;
    height: 100%;
}

.hero-image {

    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

    object-position: center;

    animation: authImageFade 700ms ease both;
}


/* =========================================================
   RIGHT CONTENT
========================================================= */

.auth-content {

    width: 100%;
    min-height: 100vh;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 45px 60px;

    background: var(--auth-white);

    direction: rtl;

    overflow-y: auto;
}


/* =========================================================
   AUTH CARD
========================================================= */

.auth-card {

    width: 100%;

    max-width: 620px;

    margin: auto;

    padding: 10px 0;

    animation: authSlideUp 550ms ease both;
}


/* =========================================================
   BRAND
========================================================= */

.auth-brand {

    margin-bottom: 22px;

    text-align: center;
}

.auth-brand-title {

    margin: 0;

    color: var(--auth-primary);

    font-size: 27px;

    font-weight: 800;

    line-height: 1.5;
}

.auth-brand-subtitle {

    margin: 2px 0 0;

    color: var(--auth-muted);

    font-size: 16px;

    font-weight: 600;
}


/* =========================================================
   HEADING
========================================================= */

.auth-heading {

    margin-bottom: 25px;

    text-align: center;
}

.auth-heading h1 {

    margin: 0;

    color: var(--auth-text);

    font-size: 28px;

    font-weight: 800;

    line-height: 1.5;
}

.auth-heading p {

    margin: 7px 0 0;

    color: var(--auth-muted);

    font-size: 14px;

    line-height: 1.8;
}


/* =========================================================
   FORM
========================================================= */

.auth-form {

    width: 100%;
}


/* =========================================================
   REGISTER GRID
========================================================= */

.auth-register-grid {

    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 15px 18px;

    width: 100%;
}


/*
   الحقول التي تحتاج عرض كامل
*/

.auth-field.full {

    grid-column: 1 / -1;
}


/* =========================================================
   FIELD
========================================================= */

.auth-field {

    min-width: 0;
}

.auth-field label {

    display: block;

    margin-bottom: 7px;

    color: var(--auth-text);

    font-size: 14px;

    font-weight: 700;

    line-height: 1.5;

    text-align: right;
}


/* =========================================================
   INPUT
========================================================= */

.auth-input {

    position: relative;

    width: 100%;

    display: flex;

    align-items: center;
}

.auth-input input {

    width: 100%;

    height: 50px;

    padding: 0 45px 0 45px;

    border: 1px solid var(--auth-border);

    border-radius: var(--auth-radius);

    outline: none;

    background: #fff;

    color: var(--auth-text);

    font-size: 14px;

    font-weight: 500;

    direction: rtl;

    text-align: right;

    transition:
        border-color 200ms ease,
        box-shadow 200ms ease,
        background-color 200ms ease;
}

.auth-input input::placeholder {

    color: #a1aab8;

    font-weight: 400;
}

.auth-input input:focus {

    border-color: var(--auth-primary);

    background: #fff;

    box-shadow:
        0 0 0 3px rgba(11, 79, 156, 0.12);
}


/* =========================================================
   INPUT ICON
========================================================= */

.auth-input-icon {

    position: absolute;

    right: 15px;

    top: 50%;

    transform: translateY(-50%);

    z-index: 2;

    color: #7b8798;

    font-size: 19px;

    pointer-events: none;
}


/* =========================================================
   PASSWORD TOGGLE
========================================================= */

.password-toggle {

    position: absolute;

    left: 7px;

    top: 50%;

    transform: translateY(-50%);

    width: 38px;
    height: 38px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background: transparent;

    color: #7b8798;

    cursor: pointer;

    transition:
        background-color 180ms ease,
        color 180ms ease;
}

.password-toggle:hover {

    background: var(--auth-primary-light);

    color: var(--auth-primary);
}


/* =========================================================
   FILE INPUT
========================================================= */

.auth-file-input {

    padding: 11px 45px 11px 10px !important;

    cursor: pointer;
}

.auth-file-input::file-selector-button {

    margin-left: 10px;

    padding: 5px 12px;

    border: 0;

    border-radius: 7px;

    background: var(--auth-primary-light);

    color: var(--auth-primary);

    font-family: inherit;

    font-size: 12px;

    font-weight: 700;

    cursor: pointer;
}


/* =========================================================
   HELP TEXT
========================================================= */

.auth-help {

    display: block;

    margin-top: 5px;

    color: var(--auth-muted);

    font-size: 11px;

    line-height: 1.6;
}


/* =========================================================
   ERRORS
========================================================= */

.auth-error {

    margin-top: 5px;

    color: var(--auth-danger);

    font-size: 12px;

    font-weight: 600;

    line-height: 1.6;
}


/* Laravel validation message */

.alert {

    margin-bottom: 18px;

    border-radius: 10px;

    font-family: inherit;

    font-size: 13px;
}


/* =========================================================
   ADMIT
========================================================= */

.auth-admit {

    width: 100%;

    display: flex;

    align-items: center;

    gap: 9px;

    margin-top: 18px;

    margin-bottom: 17px;

    padding: 11px 13px;

    border: 1px solid #e3e8ef;

    border-radius: 10px;

    background: #fafbfd;

    color: var(--auth-text);

    font-size: 13px;

    font-weight: 600;

    line-height: 1.7;

    cursor: pointer;
}

.auth-admit input {

    width: 18px;
    height: 18px;

    flex: 0 0 18px;

    accent-color: var(--auth-primary);

    cursor: pointer;
}


/* =========================================================
   BUTTON
========================================================= */

.auth-button {

    width: 100%;

    min-height: 51px;

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 9px;

    border-radius: 10px;

    background:
        linear-gradient(
            135deg,
            var(--auth-primary),
            #1766b7
        );

    color: #fff;

    font-size: 15px;

    font-weight: 800;

    cursor: pointer;

    box-shadow:
        0 10px 24px rgba(11, 79, 156, 0.20);

    transition:
        transform 180ms ease,
        box-shadow 180ms ease,
        background 180ms ease;
}

.auth-button:hover {

    transform: translateY(-1px);

    box-shadow:
        0 13px 28px rgba(11, 79, 156, 0.25);
}

.auth-button:active {

    transform: translateY(0);
}

.auth-button i {

    font-size: 19px;
}


/* =========================================================
   SWITCH LOGIN / REGISTER
========================================================= */

.auth-switch {

    margin-top: 19px;

    color: var(--auth-muted);

    font-size: 13px;

    font-weight: 500;

    text-align: center;
}

.auth-switch-button {

    display: inline-flex;

    align-items: center;
    justify-content: center;

    margin-right: 7px;

    padding: 6px 14px;

    border-radius: 7px;

    background: var(--auth-primary-light);

    color: var(--auth-primary);

    font-weight: 800;

    transition:
        background-color 180ms ease,
        color 180ms ease;
}

.auth-switch-button:hover {

    background: var(--auth-primary);

    color: #fff;
}


/* =========================================================
   FOOTER
========================================================= */

.auth-footer {

    margin-top: 20px;

    color: #9aa3af;

    font-size: 11px;

    text-align: center;
}


/* =========================================================
   ANIMATIONS
========================================================= */

@keyframes authImageFade {

    from {
        opacity: 0;
        transform: scale(1.025);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes authSlideUp {

    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1100px) {

    .auth-page {

        grid-template-columns: 45% 55%;
    }

    .auth-content {

        padding: 40px;
    }

    .auth-card {

        max-width: 570px;
    }

    .auth-brand-title {

        font-size: 24px;
    }
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 760px) {

    html,
    body {

        min-height: 100%;

        height: auto;

        overflow-x: hidden;

        overflow-y: auto;
    }


    .auth-page {

        min-height: 100vh;

        height: auto;

        display: flex;

        flex-direction: column;

        direction: ltr;
    }


    /*
       الصورة في الموبايل
    */

    .auth-image {

        width: 100%;

        min-height: 190px;

        height: 190px;

        flex: 0 0 190px;
    }


    .hero-image {

        object-position: center;

        object-fit: cover;
    }


    /*
       المحتوى
    */

    .auth-content {

        width: 100%;

        min-height: auto;

        flex: 1;

        display: block;

        padding: 28px 18px 35px;

        overflow: visible;

        direction: rtl;
    }


    .auth-card {

        width: 100%;

        max-width: 100%;

        margin: 0 auto;

        padding: 0;
    }


    .auth-brand {

        margin-bottom: 17px;
    }


    .auth-brand-title {

        font-size: 22px;
    }


    .auth-brand-subtitle {

        font-size: 14px;
    }


    .auth-heading {

        margin-bottom: 20px;
    }


    .auth-heading h1 {

        font-size: 23px;
    }


    .auth-heading p {

        font-size: 13px;
    }


    /*
       على الموبايل كل الحقول تحت بعضها
    */

    .auth-register-grid {

        grid-template-columns: 1fr;

        gap: 14px;
    }


    .auth-field,
    .auth-field.full {

        grid-column: 1 / -1;

        width: 100%;
    }


    .auth-input input {

        height: 50px;

        font-size: 14px;
    }


    .auth-admit {

        margin-top: 17px;
    }


    .auth-button {

        min-height: 51px;
    }


    .auth-switch {

        line-height: 2;
    }


    .auth-footer {

        padding-bottom: 5px;
    }
}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 420px) {

    .auth-image {

        min-height: 160px;

        height: 160px;

        flex-basis: 160px;
    }


    .auth-content {

        padding: 24px 14px 30px;
    }


    .auth-brand-title {

        font-size: 20px;
    }


    .auth-heading h1 {

        font-size: 21px;
    }


    .auth-register-grid {

        gap: 12px;
    }


    .auth-input input {

        height: 48px;

        padding-right: 43px;
    }
}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .hero-image,
    .auth-card {

        animation: none;
    }

    * {

        scroll-behavior: auto !important;

        transition-duration: 0.01ms !important;
    }
}
/* =========================
   العودة للرئيسية
========================= */

.auth-home-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 18px;
    color: #2563eb;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    direction: rtl;
}

.auth-home-link i {
    margin-left: 6px;
    font-size: 18px;
}

.auth-home-link:hover {
    color: #1d4ed8;
    text-decoration: none;
}
