/* ==========================================================================
   AL FARES "hub" — shared shell for the standalone public pages
   (sign-in, contact). Loaded by:
     resources/views/portal/hub/auth/student-login.blade.php
     resources/views/portal/hub/lms/contact.blade.php

   These pages deliberately load no Metronic bundle, jQuery or icon font —
   this file plus layouts/partials/brand-styles is the whole styling story.

   The surface tokens (--bg / --surface / --elev) are emitted per-brand in an
   inline <style> on each page, from config('brand.portal.surfaces').

   Written with CSS LOGICAL PROPERTIES so one file serves LTR and RTL.
   ========================================================================== */

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

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--brand-text);
    font-family: Cairo, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
}

/* ---------- Two-panel shell ---------- */

.auth {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    min-height: 100vh;
}

.auth__brand {
    position: relative;
    overflow: hidden;
    padding: clamp(32px, 5vw, 64px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        radial-gradient(900px 500px at 85% -10%, rgba(var(--brand-primary-rgb), .38), transparent 60%),
        radial-gradient(700px 420px at 0% 105%, rgba(var(--brand-secondary-rgb), .20), transparent 62%),
        var(--surface);
    border-inline-end: 1px solid var(--brand-border);
}

.auth__star {
    position: absolute;
    inset-block-start: 50%;
    inset-inline-end: -120px;
    transform: translateY(-50%);
    width: 520px;
    max-width: 90%;
    opacity: .06;
    pointer-events: none;
}

.auth__logo img { height: 86px; width: auto; display: block; }

.auth__pitch { position: relative; margin-block: auto; padding-block: 40px; }

.auth__headline {
    font-size: clamp(28px, 3.2vw, 44px);
    font-weight: 900;
    line-height: 1.2;
    color: var(--brand-heading);
    margin: 0 0 14px;
    max-width: 16ch;
}

.auth__sub {
    color: var(--brand-muted);
    font-size: clamp(15px, 1.4vw, 18px);
    max-width: 44ch;
    margin: 0 0 30px;
}

.auth__points { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }

.auth__point {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    color: var(--brand-text);
    font-size: 15.5px;
}

.auth__point svg {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    color: var(--brand-primary);
    margin-block-start: 1px;
}

.auth__foot { position: relative; color: var(--brand-muted); font-size: 13.5px; }
.auth__foot a { color: var(--brand-muted); text-decoration: none; }
.auth__foot a:hover { color: var(--brand-primary); }

.auth__panel {
    display: flex;
    flex-direction: column;
    padding: clamp(24px, 4vw, 56px);
}

.auth__topbar { display: flex; justify-content: flex-end; gap: 10px; }

.auth__card { margin: auto; width: 100%; max-width: 420px; }
.auth__card--wide { max-width: 480px; }

.auth__title { font-size: clamp(24px, 2.6vw, 32px); font-weight: 800; color: var(--brand-heading); margin: 0 0 6px; }
.auth__lead  { color: var(--brand-muted); margin: 0 0 30px; font-size: 15.5px; }

/* ---------- Fields ---------- */

.field { margin-block-end: 18px; }

.field__label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-heading);
    margin-block-end: 8px;
}

.field__box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border-radius: 13px;
    background: var(--elev);
    border: 1px solid var(--brand-border);
    transition: border-color .18s ease, box-shadow .18s ease;
}

.field__box:focus-within {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px rgba(var(--brand-primary-rgb), .16);
}

.field__box svg { width: 19px; height: 19px; color: var(--brand-muted); flex: 0 0 auto; }

.field__box input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--brand-heading);
    font: inherit;
    font-size: 15.5px;
    padding-block: 14px;
}

.field__box input::placeholder { color: var(--brand-muted); opacity: .75; }

.field__peek {
    border: 0;
    background: transparent;
    color: var(--brand-muted);
    cursor: pointer;
    padding: 6px;
    display: inline-flex;
    border-radius: 8px;
}

.field__peek:hover { color: var(--brand-heading); }
.field.is-invalid .field__box { border-color: var(--brand-primary); }

.field__error {
    display: none;
    color: var(--brand-primary);
    font-size: 13px;
    font-weight: 600;
    margin-block-start: 7px;
}

.field.is-invalid .field__error { display: block; }

/* ---------- Buttons & links ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    padding: 15px 22px;
    border: 1px solid transparent;
    border-radius: 13px;
    font: inherit;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .15s ease;
}

.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }

.btn--primary { background: var(--brand-primary); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--brand-primary-dark); transform: translateY(-1px); }
.btn:disabled { opacity: .6; cursor: default; }

.btn--ghost {
    background: transparent;
    border-color: var(--brand-border);
    color: var(--brand-text);
    font-size: 14px;
    font-weight: 700;
    padding: 10px 16px;
    width: auto;
}

.btn--ghost:hover { border-color: var(--brand-primary); color: var(--brand-heading); }

.btn--block { width: 100%; }

.spinner {
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: none;
}

.btn.is-busy .spinner { display: block; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .spinner { animation: none; }
    .btn--primary:hover:not(:disabled) { transform: none; }
    .channel:hover { transform: none; }
}

.altline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-block: 18px 0;
    font-size: 14.5px;
}

.link {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    font-weight: 700;
    color: var(--brand-primary);
    cursor: pointer;
    text-decoration: none;
}

.link:hover { text-decoration: underline; }
.link--muted { color: var(--brand-muted); font-weight: 600; }

/* ---------- Alerts ---------- */

.alert {
    display: none;
    align-items: flex-start;
    gap: 11px;
    padding: 13px 16px;
    border-radius: 12px;
    font-size: 14.5px;
    font-weight: 600;
    margin-block-end: 22px;
    border: 1px solid transparent;
}

.alert.is-shown { display: flex; }
.alert svg { width: 19px; height: 19px; flex: 0 0 auto; margin-block-start: 1px; }

.alert--error {
    background: rgba(var(--brand-primary-rgb), .12);
    border-color: rgba(var(--brand-primary-rgb), .32);
    color: var(--brand-primary);
}

.alert--ok {
    background: rgba(var(--brand-secondary-rgb), .13);
    border-color: rgba(var(--brand-secondary-rgb), .32);
    color: var(--brand-secondary);
}

/* ---------- Contact channels ---------- */

.channels { display: grid; gap: 12px; margin-block-end: 26px; }

.channel {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--brand-border);
    text-decoration: none;
    color: inherit;
    transition: border-color .18s ease, transform .15s ease;
}

a.channel:hover { border-color: var(--brand-primary); transform: translateY(-2px); }

.channel__icon {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--brand-primary-rgb), .14);
    color: var(--brand-primary);
}

.channel__icon svg { width: 22px; height: 22px; }

.channel__body { min-width: 0; }

.channel__label {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--brand-muted);
    margin-block-end: 3px;
}

.channel__value {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--brand-heading);
    overflow-wrap: anywhere;
}

.channel__value[dir="ltr"] { text-align: start; }

/* ---------- Narrow screens ---------- */

@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; }

    .auth__brand {
        border-inline-end: 0;
        border-block-end: 1px solid var(--brand-border);
        padding-block: 28px;
    }

    .auth__pitch, .auth__foot, .auth__star { display: none; }
    .auth__logo { display: flex; justify-content: center; }
    .auth__logo img { height: 66px; }
    .auth__panel { padding-block: 32px; }
}
