/* =========================================================
   CONCRETAN | CENTRO DE CONTROL
   LOGIN - Diseño institucional
========================================================= */

/* ================= VARIABLES ================= */

:root {
    --red: #D83236;
    --red-dark: #B9252B;
    --ink: #282B2E;
    --gray-dark: #45484B;
    --gray: #77797C;
    --muted: #777E83;
    --line: #E6E7E8;
    --bg: #F4F5F6;
    --white: #FFFFFF;
    --shadow: 0 20px 60px rgba(31, 38, 42, 0.08);
    --radius: 16px;
}

/* ================= RESET ================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

/* ================= LOGIN SHELL ================= */

.login-shell {
    width: 100%;
    max-width: 1000px;
    min-height: 580px;
    display: grid;
    grid-template-columns: 0.95fr 1.35fr;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* ================= BRAND PANEL ================= */

.brand-panel {
    position: relative;
    background: var(--red);
    color: var(--white);
    padding: 55px 45px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
}

    /* Decoración de fondo */

    .brand-panel::before {
        content: "";
        position: absolute;
        width: 350px;
        height: 350px;
        border: 1px solid rgba(255,255,255,0.09);
        border-radius: 50%;
        top: -130px;
        right: -180px;
    }

    .brand-panel::after {
        content: "";
        position: absolute;
        width: 260px;
        height: 260px;
        border: 1px solid rgba(255,255,255,0.08);
        border-radius: 50%;
        bottom: -100px;
        left: -130px;
    }

/* ================= BRAND MARK ================= */

.brand-mark {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    color: var(--red);
    border-radius: 14px;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 22px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    position: relative;
    z-index: 1;
}

/* ================= BRAND NAME ================= */

.brand-name {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--white);
    position: relative;
    z-index: 1;
}

/* ================= BRAND RULE ================= */

.brand-rule {
    width: 48px;
    height: 4px;
    background: rgba(255,255,255,0.85);
    border-radius: 4px;
    margin: 22px 0;
    position: relative;
    z-index: 1;
}

/* ================= BRAND CAPTION ================= */

.brand-caption {
    font-size: 1.1rem;
    line-height: 1.7;
    font-weight: 400;
    color: rgba(255,255,255,0.95);
    position: relative;
    z-index: 1;
}

/* ================= BRAND FOOTER ================= */

.brand-footer {
    position: absolute;
    bottom: 30px;
    left: 45px;
    right: 30px;
    font-size: 0.65rem;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.65);
    position: absolute;
    z-index: 2;
}

/* ================= FORM PANEL ================= */

.form-panel {
    background: var(--white);
    padding: 55px 65px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* ================= FORM CONTENT ================= */

.form-content {
    width: 100%;
    max-width: 400px;
    margin: auto;
}

/* ================= EYEBROW ================= */

.eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--red);
    margin-bottom: 15px;
}

/* ================= TITLE ================= */

h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.7px;
    color: var(--ink);
    margin-bottom: 12px;
}

/* ================= INTRO ================= */

.intro {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 35px;
}

/* ================= FORM ================= */

#loginForm {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

    /* ================= INPUTS ================= */

    #loginForm input {
        width: 100%;
        height: 52px;
        padding: 0 16px;
        border: 1px solid var(--line);
        border-radius: 9px;
        background: #FAFAFA;
        color: var(--ink);
        font-family: inherit;
        font-size: 0.92rem;
        outline: none;
        transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    }

        /* Placeholder */

        #loginForm input::placeholder {
            color: #999DA0;
        }

        /* Hover */

        #loginForm input:hover {
            border-color: #D0D3D5;
        }

        /* Focus */

        #loginForm input:focus {
            background: var(--white);
            border-color: var(--red);
            box-shadow: 0 0 0 3px rgba(216, 50, 54, 0.09);
        }

/* ================= PASSWORD BUTTON ================= */

#togglePassword {
    align-self: flex-end;
    background: transparent;
    border: none;
    color: var(--gray);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 2px 0;
    margin-top: -8px;
    cursor: pointer;
    transition: color 0.2s;
}

    #togglePassword:hover {
        color: var(--red);
    }

/* ================= ERROR MESSAGE ================= */

#mensajeError {
    width: 100%;
    padding: 13px 15px;
    border: 1px solid #F1C9CB;
    border-radius: 8px;
    background: #FCEDEE;
    color: #B9252B;
    font-size: 0.85rem;
    line-height: 1.5;
}

/* ================= LOGIN BUTTON ================= */

#btnLogin {
    width: 100%;
    min-height: 52px;
    margin-top: 8px;
    padding: 14px 20px;
    background: var(--red);
    color: var(--white);
    border: none;
    border-radius: 9px;
    font-family: inherit;
    font-size: 0.93rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s, opacity 0.2s;
}

    /* Hover */

    #btnLogin:hover:not(:disabled) {
        background: var(--red-dark);
        box-shadow: 0 5px 14px rgba(216, 50, 54, 0.18);
    }

    /* Active */

    #btnLogin:active:not(:disabled) {
        transform: scale(0.985);
    }

    /* Loading / disabled */

    #btnLogin:disabled {
        opacity: 0.65;
        cursor: not-allowed;
        box-shadow: none;
    }

/* ================= FORM FOOTER ================= */

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--line);
    padding-top: 20px;
    margin-top: 35px;
    font-size: 0.72rem;
    color: var(--muted);
}

    .form-footer span:first-child {
        font-weight: 700;
        letter-spacing: 1px;
        color: var(--gray-dark);
    }

    .form-footer span:last-child {
        color: var(--muted);
    }

/* ================= ANIMATION ================= */

@keyframes loginAppear {

    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-shell {
    animation: loginAppear 0.35s ease-out;
}

/* ================= ACCESSIBILITY ================= */

input:focus-visible,
button:focus-visible {
    outline: 3px solid rgba(216, 50, 54, 0.22);
    outline-offset: 3px;
}

/* ================= TABLET ================= */

@media (max-width: 900px) {

    body {
        padding: 20px;
    }

    .login-shell {
        max-width: 760px;
        grid-template-columns: 0.85fr 1.3fr;
        min-height: 520px;
    }

    .brand-panel {
        padding: 40px 30px;
    }

    .brand-name {
        font-size: 1.8rem;
    }

    .brand-footer {
        left: 30px;
        font-size: 0.58rem;
    }

    .form-panel {
        padding: 40px;
    }
}

/* ================= MOBILE ================= */

@media (max-width: 650px) {

    body {
        padding: 15px;
        align-items: center;
    }

    .login-shell {
        grid-template-columns: 1fr;
        max-width: 450px;
        min-height: auto;
    }

    /* Panel de identidad */

    .brand-panel {
        min-height: 230px;
        padding: 30px;
        align-items: center;
        text-align: center;
    }

    .brand-mark {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
        margin-bottom: 12px;
        border-radius: 11px;
    }

    .brand-name {
        font-size: 1.65rem;
    }

    .brand-rule {
        margin: 14px 0;
        width: 36px;
    }

    .brand-caption {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .brand-footer {
        display: none;
    }

    /* Formulario */

    .form-panel {
        padding: 35px 25px 25px;
    }

    .form-content {
        max-width: 100%;
    }

    h1 {
        font-size: 1.7rem;
    }

    .intro {
        margin-bottom: 25px;
    }

    #loginForm input {
        height: 48px;
    }

    #btnLogin {
        min-height: 48px;
    }

    .form-footer {
        margin-top: 30px;
        padding-top: 16px;
    }
}

/* ================= SMALL MOBILE ================= */

@media (max-width: 380px) {

    body {
        padding: 10px;
    }

    .brand-panel {
        min-height: 210px;
        padding: 25px 20px;
    }

    .form-panel {
        padding: 28px 20px 20px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .form-footer {
        font-size: 0.65rem;
    }
}

/* ================= REDUCED MOTION ================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
