:root {
    --main-color: #b9242c;
    --main-hover: #991d25;
    --main-active: #7f171e;
    --main-light: #f9eee8;
    --main-contrast: #ffffff;
    --main-focus: #dc7a60;
    --accent-color: #e34449;
    --secondary-color: #211e1c;
    --gradient-start: #5a2925;
    --gradient-end: #211e1c;
    --glow-border: rgba(187, 101, 95, 0.22);
    --glow-ring-1: rgba(185, 36, 44, 0.05);
    --glow-ring-2: rgba(185, 36, 44, 0.03);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font: 14px Arial, sans-serif;
    color: #24364d;
    background: #f6f3ed;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
    border: 1px solid #d4dfeb;
    border-radius: 7px;
    padding: 11px 16px;
    background: white;
    color: #24364d;
    transition: background 0.15s ease, border-color 0.15s ease;
}

button:hover {
    background: var(--main-light, #f9eee8);
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 3px solid var(--main-focus, #dc7a60);
    outline-offset: 2px;
}

.primary {
    background: var(--main-color, #b9242c);
    color: var(--main-contrast, white);
    border-color: var(--main-color, #b9242c);
}

.primary:hover {
    background: var(--main-hover, #991d25);
    border-color: var(--main-hover, #991d25);
}

input {
    width: 100%;
    border: 1px solid #cbd6e3;
    border-radius: 6px;
    padding: 11px;
    background: white;
    color: #30445e;
    transition: border-color 0.15s ease;
}

input:focus {
    border-color: var(--main-color, #b9242c);
    outline: none;
}

input.is-invalid {
    border-color: #dc3545 !important;
    background-color: #fff8f8;
}

.invalid-feedback {
    display: block;
    font-size: 11px;
    color: #dc3545;
    margin-top: 4px;
    font-weight: 500;
}

.alert-error {
    background: #fdf2f2;
    border: 1px solid #f8b4b4;
    color: #9b1c1c;
    border-radius: 6px;
    padding: 11px 14px;
    margin-bottom: 18px;
    font-size: 13px;
    line-height: 1.5;
}

label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    margin: 17px 0;
}

label input {
    margin-top: 6px;
}

[hidden] {
    display: none !important;
}

.wordmark {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -1px;
    color: inherit;
}

.wordmark i {
    font-style: normal;
    color: var(--accent-color, #e34449);
}

.notice {
    font-size: 11px;
    color: #71849b;
    line-height: 1.6;
}

.login-left .notice {
    position: absolute;
    bottom: 30px;
    left: 6vw;
    color: #93aecb;
    margin: 0;
}

/* ===== Login ===== */
.login {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    background: white;
}

.login-left {
    position: relative;
    overflow: hidden;
    color: white;
    padding: 45px 6vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: radial-gradient(ellipse at 25% 20%, var(--gradient-start, #5a2925) 0, var(--gradient-end, #211e1c) 65%);
}

.login-left:after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    right: -180px;
    bottom: -140px;
    border: 1px solid var(--glow-border, rgba(187, 101, 95, 0.22));
    border-radius: 50%;
    box-shadow: 0 0 0 90px var(--glow-ring-1, rgba(185, 36, 44, 0.05)), 0 0 0 180px var(--glow-ring-2, rgba(185, 36, 44, 0.03));
    pointer-events: none;
}

.login-left .wordmark {
    font-size: 54px;
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1.05;
    margin-top: 22px;
    animation: entry .9s ease both;
}

.login-left .wordmark-line {
    width: 48px;
    height: 4px;
    background: var(--accent-color, var(--main-color, #b9242c));
    border-radius: 3px;
    margin: 14px 0 22px;
    animation: entry 1s ease both;
}

.login-left h1 {
    font-size: 34px;
    line-height: 1.15;
    max-width: 450px;
    margin: 0 0 12px;
}

.login-left p {
    color: #d5c8bc;
    line-height: 1.8;
    max-width: 390px;
}

.texanos-hero {
    position: relative;
    width: min(280px, 70vw);
    aspect-ratio: 1 / 1;
    border-radius: 18px;
    overflow: hidden;
    z-index: 1;
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    animation: texanos-enter 1.2s cubic-bezier(.22, 1, .36, 1) both;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}

.texanos-hero.is-placeholder {
    padding: 0;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.texanos-hero img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    position: relative;
    z-index: 1;
}

.texanos-hero img[src=""],
.texanos-hero img:not([src]) {
    display: none;
}

.texanos-hero .hero-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    background: radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.02) 100%);
    user-select: none;
}

.texanos-hero .hero-abbr {
    font-size: 78px;
    font-weight: 900;
    letter-spacing: 4px;
    color: #ffffff;
    line-height: 1;
    text-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    background: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0.75) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.texanos-hero .hero-name {
    margin-top: 14px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.shine {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    background: linear-gradient(110deg, transparent 35%, #ffffff65 48%, transparent 60%);
    transform: translateX(-130%);
    animation: texanos-shine 2.4s ease 1s 1 forwards;
}

.login-right {
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    max-width: 380px;
    width: 100%;
}

.login-box h2 {
    font-size: 27px;
    margin-bottom: 8px;
    color: #173452;
}

.login-box > p {
    color: #73849b;
    margin-bottom: 27px;
}

.login-box .primary {
    width: 100%;
    margin-top: 15px;
    padding: 14px;
    font-size: 14px;
    font-weight: 600;
}

.login-box small {
    display: block;
    line-height: 1.6;
    color: #75879d;
    margin-top: 20px;
}

.brandline {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 35px;
}

.brandline img {
    width: 76px;
    height: 83px;
    object-fit: contain;
}

.brandline img[src=""],
.brandline img:not([src]) {
    display: none;
}

.brandline .company-badge {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--main-color, #b9242c);
    color: var(--main-contrast, #ffffff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 17px;
    letter-spacing: 1px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.brandline span {
    font-size: 11px;
    color: #6a7f96;
}

.brandline strong {
    display: block;
    color: #173452;
    font-size: 14px;
    margin-top: 5px;
}

.pass {
    display: flex;
    align-items: center;
    position: relative;
    margin-top: 6px;
}

.pass input {
    margin-top: 0;
    padding-right: 75px;
}

.pass button {
    position: absolute;
    right: 5px;
    padding: 7px 10px;
    border: 0;
    font-size: 11px;
    background: transparent;
    color: #71849b;
}

.pass button:hover {
    background: #f1f5f9;
    color: #24364d;
}

.forgot-pass {
    display: block;
    text-align: center;
    margin-top: 16px;
    color: #71849b;
    text-decoration: none;
    font-size: 12px;
}

.forgot-pass:hover {
    color: var(--main-color, #b9242c);
    text-decoration: underline;
}

/* ===== Loader Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(2px);
}

.modal-content-loader {
    background: white;
    padding: 24px 32px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.spinner {
    width: 38px;
    height: 38px;
    border: 3.5px solid #f3ece3;
    border-top-color: var(--main-color, #b9242c);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loader-text {
    font-size: 13px;
    font-weight: 600;
    color: #24364d;
}

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

@keyframes entry {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes texanos-enter {
    from {
        opacity: 0;
        transform: translateY(20px) scale(.94);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes texanos-shine {
    to {
        transform: translateX(130%);
    }
}

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

    .login-left {
        padding: 32px 24px;
        align-items: center;
        text-align: center;
    }

    .login-left p {
        display: none;
    }

    .login-left h1 {
        font-size: 23px;
        margin-top: 0;
    }

    .login-left .wordmark {
        margin-top: 12px;
        font-size: 38px;
    }

    .login-left .wordmark-line {
        margin: 10px auto 16px;
        width: 42px;
        height: 3px;
    }

    .login-left .notice {
        margin-top: 14px !important;
    }

    .texanos-hero {
        width: 155px;
        padding: 14px;
        border-radius: 14px;
    }

    .texanos-hero .hero-abbr {
        font-size: 46px;
    }

    .texanos-hero .hero-name {
        font-size: 11px;
        margin-top: 6px;
    }

    .login-right {
        padding: 28px 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }

    .shine {
        display: none;
    }
}
