/* =========================================================
   SIGN IN (resources/views/auth/login.blade.php)
   Same look as the app: Inter, the ALA EH gold accent, glass card,
   light + dark mode (<html data-theme>, set before first paint).
   Brand panel on the left, form on the right; one column on phones.
========================================================= */

:root {
    color-scheme: light;

    --text: #14171b;
    --text-2: #353b42;
    --muted: #59616a;
    --faint: #6c747d;

    --canvas: #e8ebf0;
    --glow-1: rgba(214, 168, 52, .42);
    --glow-2: rgba(110, 134, 176, .36);

    --card: rgba(255, 255, 255, .72);
    --card-edge: rgba(255, 255, 255, .85);
    --card-shadow: 0 24px 60px rgba(40, 48, 66, .16), 0 1px 2px rgba(40, 48, 66, .06);

    --input: rgba(255, 255, 255, .9);
    --input-edge: rgba(20, 23, 27, .14);
    --input-hover: rgba(20, 23, 27, .26);

    --primary: #14171b;
    --primary-hover: #2c3238;
    --on-primary: #ffffff;

    --accent: #b8912c;
    --focus: 0 0 0 3px rgba(184, 145, 44, .3);

    --danger: #b42318;
    --danger-tint: rgba(180, 35, 24, .08);
    --danger-edge: rgba(180, 35, 24, .25);

    --brand-bg: #121418;
    --brand-text: #eef0f2;
    --brand-muted: #a2a9b1;
}

:root[data-theme="dark"] {
    color-scheme: dark;

    --text: #eceef1;
    --text-2: #c8cdd3;
    --muted: #9aa2ab;
    --faint: #848c95;

    --canvas: #0b0d10;
    --glow-1: rgba(184, 145, 44, .26);
    --glow-2: rgba(64, 92, 146, .3);

    --card: rgba(24, 27, 33, .72);
    --card-edge: rgba(255, 255, 255, .09);
    --card-shadow: 0 24px 60px rgba(0, 0, 0, .5), 0 1px 2px rgba(0, 0, 0, .3);

    --input: rgba(0, 0, 0, .3);
    --input-edge: rgba(255, 255, 255, .14);
    --input-hover: rgba(255, 255, 255, .26);

    --primary: #e2bd4d;
    --primary-hover: #efcd66;
    --on-primary: #14171b;

    --accent: #e2bd4d;
    --focus: 0 0 0 3px rgba(226, 189, 77, .32);

    --danger: #f2857c;
    --danger-tint: rgba(242, 133, 124, .12);
    --danger-edge: rgba(242, 133, 124, .3);

    --brand-bg: #08090b;
}

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

html,
body {
    height: 100%;
}

body {
    margin: 0;
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    background:
        radial-gradient(40% 50% at 88% 8%, var(--glow-2), transparent 70%),
        radial-gradient(45% 55% at 60% 100%, var(--glow-1), transparent 70%),
        var(--canvas);
    background-attachment: fixed;
}

svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- Layout ---------- */

.lg {
    display: grid;
    grid-template-columns: minmax(380px, 44%) minmax(0, 1fr);
    min-height: 100dvh;
}

/* ---------- Brand panel ---------- */

.lg-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
    padding: 44px clamp(32px, 4vw, 64px);
    overflow: hidden;
    color: var(--brand-text);
    background:
        radial-gradient(70% 55% at 0% 100%, rgba(226, 189, 77, .22), transparent 70%),
        radial-gradient(60% 45% at 100% 0%, rgba(253, 240, 1, .07), transparent 70%),
        var(--brand-bg);
}

/* One thin gold edge where the panel meets the form */
.lg-brand::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(226, 189, 77, .55), transparent);
}

.lg-brand-top {
    display: flex;
    align-items: center;
    gap: 14px;
}

.lg-logo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 3px rgba(226, 189, 77, .35), 0 8px 24px rgba(0, 0, 0, .4);
}

.lg-brand-name {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.01em;
}

.lg-brand-sub {
    margin-top: 2px;
    color: var(--brand-muted);
    font-size: 13px;
}

.lg-brand-body {
    max-width: 440px;
}

.lg-brand-title {
    margin: 0;
    font-size: clamp(28px, 2.6vw, 36px);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -.025em;
}

.lg-brand-text {
    margin: 16px 0 0;
    color: var(--brand-muted);
    font-size: 15px;
    line-height: 1.6;
}

.lg-points {
    display: grid;
    gap: 12px;
    margin: 32px 0 0;
    padding: 0;
    list-style: none;
}

.lg-points li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #d5d9de;
    font-size: 14px;
}

.lg-points svg {
    flex: none;
    width: 32px;
    height: 32px;
    padding: 7px;
    border-radius: 10px;
    color: #e2bd4d;
    background: rgba(226, 189, 77, .1);
    border: 1px solid rgba(226, 189, 77, .18);
}

.lg-brand-foot {
    color: #7d858e;
    font-size: 12.5px;
}

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

.lg-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 40px 24px;
}

.lg-card {
    width: 100%;
    max-width: 400px;
    padding: 36px 34px 30px;
    border-radius: 22px;
    background: var(--card);
    -webkit-backdrop-filter: blur(22px) saturate(170%);
    backdrop-filter: blur(22px) saturate(170%);
    border: 1px solid var(--card-edge);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), var(--card-shadow);
    animation: lg-rise .45s cubic-bezier(.2, .8, .2, 1) both;
}

:root[data-theme="dark"] .lg-card {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), var(--card-shadow);
}

/* The logo repeats in the card only when the brand panel is hidden (phones). */
.lg-card-logo {
    display: none;
    width: 48px;
    height: 48px;
    margin-bottom: 18px;
    border-radius: 50%;
    object-fit: cover;
}

.lg-title {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.lg-sub {
    margin: 6px 0 24px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

/* ---------- Error ---------- */

.lg-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: -6px 0 20px;
    padding: 11px 13px;
    border-radius: 12px;
    background: var(--danger-tint);
    border: 1px solid var(--danger-edge);
    color: var(--danger);
    font-size: 13.5px;
    line-height: 1.45;
    animation: lg-shake .4s ease both;
}

.lg-alert svg {
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

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

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

.lg-field label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 600;
}

.lg-input {
    position: relative;
}

.lg-input > svg {
    position: absolute;
    left: 14px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: var(--faint);
    pointer-events: none;
    transition: color .15s ease;
}

.lg-input input {
    width: 100%;
    height: 46px;
    padding: 0 14px 0 42px;
    border: 1px solid var(--input-edge);
    border-radius: 12px;
    background: var(--input);
    color: var(--text);
    font: inherit;
    font-size: 15px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.lg-input input[type="password"],
.lg-input input#password {
    padding-right: 48px;
}

.lg-input input:hover {
    border-color: var(--input-hover);
}

.lg-input input:focus {
    border-color: var(--accent);
    box-shadow: var(--focus);
}

.lg-input:focus-within > svg {
    color: var(--accent);
}

.lg-input input[aria-invalid="true"] {
    border-color: var(--danger-edge);
}

.lg-input input[aria-invalid="true"]:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px var(--danger-tint);
}

/* Browser autofill keeps the theme colours */
.lg-input input:-webkit-autofill {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 40px var(--input) inset;
    caret-color: var(--text);
}

.lg-field-error,
.lg-caps {
    margin: 6px 0 0;
    font-size: 12.5px;
}

.lg-field-error {
    color: var(--danger);
}

.lg-caps {
    color: var(--muted);
}

/* Show / hide password */
.lg-reveal {
    position: absolute;
    top: 50%;
    right: 6px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--faint);
    transform: translateY(-50%);
    cursor: pointer;
}

.lg-reveal:hover {
    color: var(--text);
    background: rgba(127, 127, 127, .1);
}

.lg-reveal:focus-visible {
    outline: none;
    box-shadow: var(--focus);
}

.lg-reveal svg {
    width: 18px;
    height: 18px;
}

.lg-reveal .icon-hide,
.lg-reveal.is-visible .icon-show {
    display: none;
}

.lg-reveal.is-visible .icon-hide {
    display: block;
}

/* ---------- Submit ---------- */

.lg-submit {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    margin-top: 24px;
    border: 0;
    border-radius: 12px;
    background: var(--primary);
    color: var(--on-primary);
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 8px 20px rgba(0, 0, 0, .16);
    transition: background-color .15s ease, transform .1s ease, box-shadow .15s ease;
}

.lg-submit:hover {
    background: var(--primary-hover);
}

.lg-submit:active {
    transform: scale(.985);
}

.lg-submit:focus-visible {
    outline: none;
    box-shadow: var(--focus);
}

.lg-spinner {
    display: none;
    width: 18px;
    height: 18px;
    margin-left: 10px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: lg-spin .7s linear infinite;
}

.lg-submit.is-loading {
    cursor: wait;
    opacity: .9;
}

.lg-submit.is-loading .lg-spinner {
    display: inline-block;
}

.lg-help {
    margin: 20px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
}

.lg-legal {
    margin: 0;
    color: var(--faint);
    font-size: 12.5px;
    text-align: center;
}

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

@keyframes lg-rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

@keyframes lg-shake {
    0%, 100% { transform: none; }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(4px); }
    75% { transform: translateX(-2px); }
}

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

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

    .lg-spinner {
        animation-duration: 1.6s;
    }
}

@media (prefers-reduced-transparency: reduce) {
    .lg-card {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        background: #ffffff;
    }

    :root[data-theme="dark"] .lg-card {
        background: #181b21;
    }
}

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

@media (max-width: 900px) {
    .lg {
        grid-template-columns: minmax(0, 1fr);
    }

    .lg-brand {
        display: none;
    }

    .lg-card-logo {
        display: block;
    }

    .lg-panel {
        justify-content: flex-start;
        padding-top: max(40px, 10vh);
    }
}

@media (max-width: 420px) {
    .lg-panel {
        padding: 28px 16px;
    }

    .lg-card {
        padding: 28px 22px 24px;
        border-radius: 18px;
    }
}
