/*
 * Styles for the sign-in page at the site root.
 *
 * This file is served straight from public/ rather than built by Vite: the
 * rest of the app ships its assets the same way (see public/css/filament), so
 * a deployment needs no node build step.
 *
 * To use a photograph instead of the bundled illustration, point
 * --auth-image at it; nothing else needs to change.
 */

:root {
    --auth-image: url('/images/auth-background.svg');

    --auth-page: #f1f4f7;
    --auth-surface: #ffffff;
    --auth-ink: #16222e;
    --auth-ink-muted: #5b6b7b;
    --auth-line: #d6dee6;
    --auth-field: #ffffff;
    --auth-accent: #0369a1;
    --auth-accent-hover: #075985;
    --auth-accent-ink: #ffffff;
    --auth-accent-ring: rgb(3 105 161 / 0.18);
    --auth-danger: #b42318;
    --auth-danger-bg: #fef3f2;
    --auth-danger-line: #f5c9c4;

    /* The blue-grey wash laid over the background image. */
    --auth-overlay: linear-gradient(
        160deg,
        rgba(30, 48, 66, 0.9) 0%,
        rgba(51, 72, 92, 0.82) 45%,
        rgba(74, 95, 112, 0.78) 100%
    );
}

@media (prefers-color-scheme: dark) {
    :root {
        --auth-page: #0f1720;
        --auth-surface: #16202b;
        --auth-ink: #e8edf2;
        --auth-ink-muted: #94a5b5;
        --auth-line: #2b3947;
        --auth-field: #101923;
        --auth-accent: #0ea5e9;
        --auth-accent-hover: #38bdf8;
        --auth-accent-ink: #082f49;
        --auth-accent-ring: rgb(56 189 248 / 0.25);
        --auth-danger: #fca5a0;
        --auth-danger-bg: #2a1614;
        --auth-danger-line: #5c2a26;
    }
}

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

html,
body {
    height: 100%;
}

body {
    margin: 0;
    background-color: var(--auth-page);
    color: var(--auth-ink);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans Arabic',
        'Noto Kufi Arabic', Tahoma, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.auth {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 100%;
}

/* ---------------------------------------------------------------- form ---- */

.auth__form-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2.5rem;
    padding: 3rem clamp(1.5rem, 5vw, 4.5rem);
    background-color: var(--auth-surface);
}

.auth__form-inner {
    width: 100%;
    max-width: 26rem;
    margin: auto;
}

.auth__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.75rem;
    color: inherit;
    text-decoration: none;
}

.auth__brand-mark {
    flex: none;
    width: 2.75rem;
    height: 2.75rem;
    color: var(--auth-accent);
}

.auth__brand-name {
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.auth__brand-kicker {
    display: block;
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--auth-ink-muted);
}

.auth__title {
    margin: 0 0 0.375rem;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.auth__subtitle {
    margin: 0 0 2rem;
    color: var(--auth-ink-muted);
}

.auth__alert {
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--auth-danger-line);
    border-radius: 0.625rem;
    background-color: var(--auth-danger-bg);
    color: var(--auth-danger);
    font-size: 0.9375rem;
}

.auth__alert ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth__alert li + li {
    margin-top: 0.25rem;
}

.auth__field + .auth__field {
    margin-top: 1.125rem;
}

.auth__label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.auth__input {
    display: block;
    width: 100%;
    padding: 0.6875rem 0.875rem;
    border: 1px solid var(--auth-line);
    border-radius: 0.625rem;
    background-color: var(--auth-field);
    color: var(--auth-ink);
    font: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth__input:focus {
    outline: none;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px var(--auth-accent-ring);
}

.auth__input[aria-invalid='true'] {
    border-color: var(--auth-danger-line);
}

.auth__remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    font-size: 0.9375rem;
    color: var(--auth-ink-muted);
    cursor: pointer;
}

.auth__remember input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--auth-accent);
    cursor: pointer;
}

.auth__submit {
    display: block;
    width: 100%;
    margin-top: 1.75rem;
    padding: 0.75rem 1rem;
    border: 0;
    border-radius: 0.625rem;
    background-color: var(--auth-accent);
    color: var(--auth-accent-ink);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.auth__submit:hover {
    background-color: var(--auth-accent-hover);
}

.auth__submit:focus-visible {
    outline: 2px solid var(--auth-accent);
    outline-offset: 2px;
}

.auth__footer {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--auth-ink-muted);
    text-align: center;
}

/* -------------------------------------------------------------- visual ---- */

.auth__visual {
    position: relative;
    display: flex;
    align-items: flex-end;
    padding: clamp(2rem, 5vw, 4rem);
    overflow: hidden;
    background-color: #33485c;
    background-image: var(--auth-overlay), var(--auth-image);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover, cover;
    color: #f4f7fa;
}

.auth__visual-content {
    position: relative;
    max-width: 30rem;
}

.auth__tagline {
    margin: 0;
    font-size: clamp(1.375rem, 2.4vw, 1.875rem);
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

.auth__tagline-sub {
    margin: 0.875rem 0 0;
    color: rgb(244 247 250 / 0.72);
}

/* ---------------------------------------------------------- responsive ---- */

@media (max-width: 60rem) {
    .auth {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: 11rem auto;
    }

    .auth__visual {
        grid-row: 1;
        align-items: center;
        padding: 1.5rem clamp(1.5rem, 5vw, 3rem);
    }

    .auth__tagline {
        font-size: 1.25rem;
    }

    .auth__tagline-sub {
        display: none;
    }

    .auth__form-panel {
        grid-row: 2;
        padding: 2.5rem clamp(1.25rem, 5vw, 3rem);
    }

    .auth__brand {
        margin-bottom: 2rem;
    }
}
