/* Student sign-in — classroom photo, sky-blue backdrop, gold-and-blue framed card. Arabic, right to left. */

:root {
    --sl-sky: #0AA8F8;
    --sl-sky-soft: #8DD0F8;
    --sl-sky-pale: #BFE3FD;
    --sl-blue: #0B6FEB;          /* card border */
    --sl-gold: #F5C90C;          /* card outer ring, divider */
    --sl-gold-deep: #E09021;
    --sl-navy: #0F236A;          /* heading */
    --sl-ink: #0A1650;           /* labels */
    --sl-icon: #103D7E;
    --sl-card: #FBFCFE;
    --sl-field: #EEF6FE;
    --sl-field-line: #8FC3F5;
    --sl-error: #B42318;
    --sl-error-bg: #FDECEA;

    --sl-font: "Cairo", "Segoe UI", Tahoma, system-ui, sans-serif;

    --sl-card-w: min(580px, 42vw);
    --sl-gutter: 3.5vw;
}

/* Arabic letters join, so nothing on this page is letter-spaced. */

*,
*::before,
*::after {
    box-sizing: border-box;
}

[x-cloak] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
}

body.sl-body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--sl-font);
    color: var(--sl-ink);
    background: var(--sl-sky-soft);
    -webkit-font-smoothing: antialiased;
}

/* ---------- Stage ---------- */

.sl {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: flex-start;          /* start = right in RTL: the card sits on the right */
    padding: 40px var(--sl-gutter) 64px;
    overflow: hidden;
    background:
        radial-gradient(70% 55% at 85% 0%, #22B8FB 0%, rgba(34, 184, 251, 0) 70%),
        linear-gradient(165deg, var(--sl-sky) 0%, var(--sl-sky-soft) 40%, var(--sl-sky-pale) 75%, #94D2FD 100%);
}

.sl-photo {
    position: absolute;
    inset-block: 0;
    left: 0;
    /* Ends just under the card's edge; anchored right so the whiteboard and laptop stay in view. */
    width: calc(100% - var(--sl-card-w) - var(--sl-gutter) + 24px);
    background: url("../../includes/images/student-login-classroom.jpg") right 30% / cover no-repeat;
}

/* Soft hand-off from the photo into the sky blue behind the card. */
.sl-photo::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to left, rgba(141, 208, 248, 0.9) 0%, rgba(141, 208, 248, 0) 5%);
}

/* Geometric lattice in the top-right corner. */
.sl-pattern {
    position: absolute;
    top: 0;
    right: 0;
    width: 46%;
    height: 72%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1.4' stroke-opacity='0.75'%3E%3Crect x='20' y='20' width='32' height='32'/%3E%3Crect x='20' y='20' width='32' height='32' transform='rotate(45 36 36)'/%3E%3Cpath d='M0 0L13.4 13.4M72 0L58.6 13.4M0 72L13.4 58.6M72 72L58.6 58.6M36 0V13.4M36 72V58.6M0 36H13.4M72 36H58.6'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 72px 72px;
    -webkit-mask-image: radial-gradient(ellipse 85% 85% at 100% 0%, #000 25%, transparent 72%);
    mask-image: radial-gradient(ellipse 85% 85% at 100% 0%, #000 25%, transparent 72%);
    opacity: 0.55;
    pointer-events: none;
}

.sl-ribbons {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ---------- Card ---------- */

.sl-card {
    position: relative;
    z-index: 2;
    width: var(--sl-card-w);
    padding: 34px 44px 42px;
    text-align: center;
    background: var(--sl-card);
    border: 9px solid var(--sl-blue);
    border-radius: 44px;
    box-shadow:
        0 0 0 5px var(--sl-gold),
        0 0 0 8px rgba(255, 255, 255, 0.55),
        0 34px 60px -24px rgba(0, 32, 120, 0.55);
    animation: sl-rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.sl-logo {
    display: block;
    width: min(360px, 82%);
    height: auto;
    margin: 0 auto;
}

/* Gold rule with a dot at each end. */
.sl-divider {
    position: relative;
    width: 78%;
    height: 3px;
    margin: 16px auto 20px;
    background: linear-gradient(90deg, var(--sl-gold-deep), var(--sl-gold) 50%, var(--sl-gold-deep));
    border-radius: 2px;
}

.sl-divider::before,
.sl-divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 9px;
    height: 9px;
    margin-top: -4.5px;
    background: var(--sl-gold-deep);
    border-radius: 50%;
}

.sl-divider::before {
    left: -4px;
}

.sl-divider::after {
    right: -4px;
}

.sl-title {
    margin: 0 0 18px;
    font-size: clamp(25px, 2.5vw, 36px);
    font-weight: 800;
    line-height: 1.35;
    color: var(--sl-navy);
}

/* ---------- Form ---------- */

.sl-form {
    text-align: start;
}

.sl-field {
    margin-bottom: 16px;
}

.sl-label {
    display: block;
    margin: 0 10px 6px;
    font-size: clamp(18px, 1.6vw, 22px);
    font-weight: 700;
    line-height: 1.4;
    color: var(--sl-ink);
}

.sl-control {
    position: relative;
}

.sl-input {
    display: block;
    width: 100%;
    height: 58px;
    /* Physical sides: the input types left to right, but its icon sits on the right. */
    padding-right: 62px;
    padding-left: 24px;
    font: inherit;
    font-size: 18px;
    font-weight: 600;
    text-align: right;
    color: var(--sl-navy);
    background: linear-gradient(180deg, #E1EEFD 0%, var(--sl-field) 45%);
    border: 2px solid var(--sl-field-line);
    border-radius: 999px;
    box-shadow:
        inset 0 3px 6px rgba(60, 130, 220, 0.22),
        0 1px 0 #FFFFFF;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sl-input--both {
    padding-left: 62px;
}

.sl-input:hover {
    border-color: #6FAFEF;
}

.sl-input:focus {
    outline: none;
    border-color: var(--sl-blue);
    box-shadow:
        inset 0 3px 6px rgba(60, 130, 220, 0.18),
        0 0 0 4px rgba(11, 111, 235, 0.22);
}

.sl-input[aria-invalid="true"] {
    border-color: var(--sl-error);
}

.sl-input[aria-invalid="true"]:focus {
    box-shadow:
        inset 0 3px 6px rgba(60, 130, 220, 0.18),
        0 0 0 4px rgba(180, 35, 24, 0.18);
}

.sl-icon {
    position: absolute;
    top: 50%;
    width: 26px;
    height: 26px;
    margin-top: -13px;
    color: var(--sl-icon);
    pointer-events: none;
}

.sl-icon--start {
    inset-inline-start: 24px;
}

.sl-icon--end {
    inset-inline-end: 24px;
}

.sl-eye {
    position: absolute;
    top: 50%;
    inset-inline-start: 14px;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-top: -22px;
    padding: 0;
    color: var(--sl-icon);
    background: none;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

.sl-eye svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sl-eye:hover {
    background: rgba(11, 111, 235, 0.08);
}

.sl-error {
    margin: 6px 14px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--sl-error);
}

.sl-alert {
    margin: 0 0 18px;
    padding: 12px 18px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.6;
    text-align: start;
    color: #7A1A12;
    background: var(--sl-error-bg);
    border: 1.5px solid #F3B8B0;
    border-radius: 18px;
}

.sl-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100%;
    height: 64px;
    margin-top: 26px;
    font: inherit;
    font-size: clamp(22px, 2vw, 27px);
    font-weight: 800;
    line-height: 1;
    color: #FFFFFF;
    background: linear-gradient(180deg, #2F84F2 0%, #0553E6 22%, #0A2E96 68%, #021A66 100%);
    border: 0;
    border-radius: 999px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        0 3px 0 #E7C64A,
        0 14px 24px -10px rgba(2, 26, 102, 0.6);
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.1s ease;
}

.sl-submit svg {
    width: 30px;
    height: 30px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sl-submit:hover {
    filter: brightness(1.12);
}

.sl-submit:active {
    transform: translateY(2px);
}

.sl-submit[disabled] {
    filter: saturate(0.7);
    cursor: progress;
}

.sl-submit:focus-visible,
.sl-eye:focus-visible {
    outline: 3px solid var(--sl-gold-deep);
    outline-offset: 3px;
}

@keyframes sl-rise {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ---------- Tablets and phones: photo on top, card below ---------- */

@media (max-width: 960px) {
    .sl {
        flex-direction: column;
        justify-content: flex-start;
        padding: 0 16px 56px;
    }

    .sl-photo {
        position: relative;
        width: calc(100% + 32px);
        height: clamp(220px, 42vh, 380px);
        margin: 0 -16px;
        background-position: center 30%;
    }

    .sl-photo::after {
        background: linear-gradient(to top, rgba(141, 208, 248, 0.95) 0%, rgba(141, 208, 248, 0) 30%);
    }

    .sl-pattern {
        width: 100%;
        height: 50%;
        top: auto;
        bottom: 0;
        -webkit-mask-image: radial-gradient(ellipse 90% 80% at 100% 100%, #000 15%, transparent 70%);
        mask-image: radial-gradient(ellipse 90% 80% at 100% 100%, #000 15%, transparent 70%);
    }

    .sl-card {
        width: min(600px, 100%);
        margin-top: -70px;
    }
}

@media (max-width: 560px) {
    .sl-card {
        padding: 24px 20px 30px;
        border-width: 7px;
        border-radius: 32px;
        box-shadow:
            0 0 0 4px var(--sl-gold),
            0 0 0 6px rgba(255, 255, 255, 0.55),
            0 24px 44px -20px rgba(0, 32, 120, 0.55);
    }

    .sl-divider {
        margin: 12px auto 16px;
    }

    .sl-input {
        height: 54px;
        font-size: 17px;
        padding-right: 54px;
        padding-left: 20px;
    }

    .sl-input--both {
        padding-left: 54px;
    }

    .sl-icon--start {
        inset-inline-start: 20px;
    }

    .sl-icon--end {
        inset-inline-end: 20px;
    }

    .sl-eye {
        inset-inline-start: 10px;
    }

    .sl-submit {
        height: 58px;
    }
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
    .sl-card {
        animation: none;
    }

    .sl-input,
    .sl-submit {
        transition: none;
    }
}
