/* ==========================================================================
   Garnet — Login page (self-contained; shares the shell's palette)
   ========================================================================== */
:root {
    --g-brand: #c8102e;
    --g-brand-hover: #a80d26;
    --g-brand-soft: rgba(200, 16, 46, .08);
    --g-brand-ring: rgba(200, 16, 46, .22);

    --g-canvas: #f4f5f7;
    --g-surface: #ffffff;
    --g-line: #e2e5ea;
    --g-line-strong: #cfd4dc;
    --g-ink: #111827;
    --g-ink-2: #374151;
    --g-muted: #6b7280;
    --g-subtle: #9ca3af;
    --g-danger: #b91c1c;
    --g-danger-soft: #fef2f2;
    --g-warning: #b45309;

    --g-menu-bg: #171c27;
    --g-menu-text: #b9c1cf;
    --g-menu-accent: #ff5c70;

    --g-radius: 10px;
    --g-ease: cubic-bezier(.2, .7, .3, 1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --g-brand: #f2495f;
        --g-brand-hover: #ff6377;
        --g-brand-soft: rgba(242, 73, 95, .14);
        --g-brand-ring: rgba(242, 73, 95, .3);
        --g-canvas: #1c222f;
        --g-surface: #232b3a;
        --g-line: #323c50;
        --g-line-strong: #3d4860;
        --g-ink: #e8ecf3;
        --g-ink-2: #c5cddb;
        --g-muted: #8e9ab0;
        --g-subtle: #6c7890;
        --g-danger: #fca5a5;
        --g-danger-soft: rgba(239, 68, 68, .12);
        --g-warning: #fbbf24;
        --g-menu-bg: #141923;
    }
}

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

body.g-login {
    margin: 0;
    min-height: 100vh;
    background: var(--g-canvas);
    color: var(--g-ink-2);
    font-family: "Yekan Bakh FaNum", Tahoma, sans-serif;
    font-size: 14px;
}

:focus-visible {
    outline: 2px solid var(--g-brand);
    outline-offset: 2px;
}

.g-login-shell {
    display: grid;
    grid-template-columns: minmax(380px, 44%) 1fr;
    min-height: 100vh;
}

/* ---------- Brand panel ---------- */
.g-login-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.5rem 3rem;
    overflow: hidden;
    background: var(--g-menu-bg);
    color: var(--g-menu-text);
}

    /* soft brand glow + fine grid for depth, no images needed */
    .g-login-brand::before,
    .g-login-brand::after {
        content: "";
        position: absolute;
        pointer-events: none;
    }

    .g-login-brand::before {
        width: 520px;
        height: 520px;
        top: -180px;
        left: -160px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(200, 16, 46, .35), transparent 65%);
    }

    .g-login-brand::after {
        inset: 0;
        background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
        background-size: 36px 36px;
        -webkit-mask-image: linear-gradient(to bottom, #000, transparent 85%);
        mask-image: linear-gradient(to bottom, #000, transparent 85%);
    }

    .g-login-brand > * {
        position: relative;
        z-index: 1;
    }

.g-login-brand-top,
.g-login-mobile-brand {
    display: flex;
    align-items: center;
    gap: .85rem;
}

.g-login-logo {
    flex: 0 0 auto;
    display: inline-flex;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, .08);
}

    .g-login-logo img {
        display: block;
        object-fit: contain;
    }

.g-login-company {
    color: #fff;
    font-size: .95rem;
    font-weight: 700;
}

.g-login-company-sub {
    color: var(--g-menu-text);
    font-size: .75rem;
    opacity: .8;
}

.g-login-pitch h1 {
    margin: 0 0 .75rem;
    color: #fff;
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.35;
}

.g-login-pitch p {
    max-width: 30rem;
    margin: 0 0 2rem;
    font-size: 1rem;
    line-height: 1.9;
}

.g-login-features {
    display: grid;
    gap: .75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

    .g-login-features li {
        display: flex;
        align-items: center;
        gap: .75rem;
        color: #e5e9f0;
        font-size: .9rem;
    }

    .g-login-features span {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border: 1px solid rgba(255, 255, 255, .1);
        border-radius: 10px;
        background: rgba(255, 255, 255, .05);
        color: var(--g-menu-accent);
        font-size: 1.2rem;
    }

.g-login-brand-foot {
    color: var(--g-menu-text);
    font-size: .75rem;
    opacity: .65;
}

/* ---------- Form side ---------- */
.g-login-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
}

.g-login-card {
    width: 100%;
    max-width: 400px;
}

.g-login-mobile-brand {
    display: none;
    margin-bottom: 2rem;
}

    .g-login-mobile-brand .g-login-logo {
        box-shadow: 0 0 0 1px var(--g-line);
    }

    .g-login-mobile-brand .g-login-company {
        color: var(--g-ink);
    }

    .g-login-mobile-brand .g-login-company-sub {
        color: var(--g-muted);
        opacity: 1;
    }

.g-login-head h2 {
    margin: 0 0 .4rem;
    color: var(--g-ink);
    font-size: 1.5rem;
    font-weight: 800;
}

.g-login-head p {
    margin: 0 0 1.75rem;
    color: var(--g-muted);
    font-size: .875rem;
}

.g-login-alert {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    margin-bottom: 1.25rem;
    padding: .75rem .9rem;
    border: 1px solid color-mix(in srgb, var(--g-danger) 25%, transparent);
    border-radius: var(--g-radius);
    background: var(--g-danger-soft);
    color: var(--g-danger);
    font-size: .8125rem;
    animation: g-shake .35s var(--g-ease);
}

    .g-login-alert > i {
        font-size: 1.2rem;
        margin-top: .05rem;
    }

    .g-login-alert ul {
        margin: 0;
        padding: 0;
        list-style: none;
    }

@keyframes g-shake {
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

.g-field {
    margin-bottom: 1.1rem;
}

.g-label {
    display: block;
    margin-bottom: .4rem;
    color: var(--g-ink-2);
    font-size: .8125rem;
    font-weight: 600;
}

.g-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid var(--g-line-strong);
    border-radius: var(--g-radius);
    background: var(--g-surface);
    transition: border-color .15s, box-shadow .15s;
}

    .g-input-wrap:hover {
        border-color: var(--g-subtle);
    }

    .g-input-wrap:focus-within {
        border-color: var(--g-brand);
        box-shadow: 0 0 0 4px var(--g-brand-ring);
    }

    .g-input-wrap.is-invalid,
    .g-input-wrap:has(.input-validation-error) {
        border-color: var(--g-danger);
    }

.g-input-icon {
    position: absolute;
    right: .85rem;
    color: var(--g-subtle);
    font-size: 1.15rem;
    pointer-events: none;
}

.g-input {
    width: 100%;
    height: 46px;
    padding: 0 2.6rem 0 2.75rem;
    border: 0;
    border-radius: var(--g-radius);
    outline: none;
    background: transparent;
    color: var(--g-ink);
    font-family: inherit;
    font-size: .95rem;
    text-align: left;
}

    .g-input::placeholder {
        color: var(--g-subtle);
    }

    .g-input:-webkit-autofill {
        -webkit-box-shadow: 0 0 0 40px var(--g-surface) inset;
        -webkit-text-fill-color: var(--g-ink);
    }

.g-input-action {
    position: absolute;
    left: .35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--g-muted);
    font-size: 1.2rem;
    cursor: pointer;
}

    .g-input-action:hover {
        background: var(--g-brand-soft);
        color: var(--g-ink);
    }

.g-field-error {
    display: block;
    margin-top: .35rem;
    color: var(--g-danger);
    font-size: .75rem;
}

    .g-field-error:empty {
        display: none;
    }

.g-field-hint {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    margin-top: .35rem;
    color: var(--g-warning);
    font-size: .75rem;
}

    .g-field-hint[hidden] {
        display: none;
    }

.g-login-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem 1rem;
    margin: .25rem 0 1.5rem;
}

.g-check {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: var(--g-ink-2);
    font-size: .8125rem;
    cursor: pointer;
    user-select: none;
}

    .g-check input {
        width: 18px;
        height: 18px;
        margin: 0;
        accent-color: var(--g-brand);
        cursor: pointer;
    }

.g-login-help {
    color: var(--g-muted);
    font-size: .75rem;
}

.g-login-submit {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    border: 0;
    border-radius: var(--g-radius);
    background: var(--g-brand);
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 8px 20px -8px rgba(200, 16, 46, .65);
    cursor: pointer;
    transition: background-color .15s, transform .1s;
}

    .g-login-submit:hover {
        background: var(--g-brand-hover);
    }

    .g-login-submit:active {
        transform: translateY(1px);
    }

    .g-login-submit:disabled {
        cursor: progress;
        opacity: .9;
    }

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

.g-login-submit.is-loading .g-submit-text {
    display: none;
}

.g-login-submit.is-loading .g-spinner {
    display: block;
}

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

.g-login-foot {
    margin-top: 2.5rem;
    font-size: .75rem;
}

    .g-login-foot a {
        color: var(--g-subtle);
        text-decoration: none;
    }

        .g-login-foot a:hover {
            color: var(--g-ink);
        }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .g-login-shell {
        grid-template-columns: 1fr;
    }

    .g-login-brand {
        display: none;
    }

    .g-login-mobile-brand {
        display: flex;
    }

    .g-login-main {
        justify-content: flex-start;
        padding-top: 3rem;
    }
}

@media (max-width: 420px) {
    .g-login-main {
        padding: 2rem 1rem;
    }

    .g-login-head h2 {
        font-size: 1.3rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}
