
/* ==============================
   Variables de diseño
============================== */
:root {
    --primary: #2b3a67;
    --secondary: #119d95;
    --text: #182b43;
    --text-muted: #64748b;
    --border: #cfd6e2;
    --background-input: #ffffff;
    --danger: #dc2626;
    --danger-bg: #fff2f2;
}

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

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
}

/* ==============================
   Fondo
============================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;

    background:
        radial-gradient(
            circle at 1px 1px,
            rgba(255, 255, 255, 0.055) 1px,
            transparent 0
        ) 0 0 / 24px 24px,
        linear-gradient(
            150deg,
            #29365f 0%,
            #30446b 45%,
            #8fcacb 100%
        );
}

/* ==============================
   Tarjeta
============================== */
.login-card {
    width: 100%;
    max-width: 394px;
    overflow: hidden;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 20px 55px rgba(15, 23, 42, 0.16);
    position: relative;
}

/* Línea superior azul y turquesa */
.login-card::before {
    content: "";
    display: block;
    width: 100%;
    height: 4px;
    background: linear-gradient(
        90deg,
        var(--primary),
        var(--secondary)
    );
}

.login-content {
    padding: 28px 28px 26px;
}

/* ==============================
   Marca
============================== */
.brand {
    text-align: center;
    margin-bottom: 30px;
}

.brand-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 15px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #ffffff;
    font-size: 24px;

    background: linear-gradient(
        135deg,
        var(--primary),
        var(--secondary)
    );

    border-radius: 15px;
    box-shadow: 0 5px 12px rgba(43, 58, 103, 0.16);
}

.brand h1 {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--primary);
}

.brand-subtitle {
    margin-top: 3px;
    color: #8996b2;
    font-size: 11px;
    letter-spacing: 1.2px;
}

/* ==============================
   Bienvenida
============================== */
.welcome {
    margin-bottom: 20px;
}

.welcome h2 {
    font-size: 21px;
    font-weight: 700;
    color: #172b42;
    margin-bottom: 7px;
}

.welcome p {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-muted);
}

/* ==============================
   Alerta
============================== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 12px 14px;
    margin-bottom: 18px;

    border-radius: 12px;
    font-size: 12.5px;
    line-height: 1.5;
}

.alert i {
    margin-top: 2px;
    flex-shrink: 0;
}

.alert-error {
    color: var(--danger);
    background: var(--danger-bg);
    border: 1px solid #fecaca;
}

/* ==============================
   Formulario
============================== */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;

    color: #34445b;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.15px;
}

.form-group label span {
    color: #ef4444;
}

/* Campos e iconos */
.input-wrapper {
    height: 39px;
    display: flex;
    align-items: center;
    position: relative;

    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--background-input);

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.input-wrapper:focus-within {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(17, 157, 149, 0.12);
}

.input-icon {
    position: absolute;
    left: 12px;
    color: #94a3b8;
    font-size: 13px;
    pointer-events: none;
}

.input-wrapper input,
.input-wrapper select {
    width: 100%;
    height: 100%;
    min-width: 0;

    padding: 0 36px;
    border: none;
    outline: none;

    background: transparent;
    color: #24354c;

    font-family: inherit;
    font-size: 13px;
}

.input-wrapper input::placeholder {
    color: #9aa5b5;
}

/* Botón de contraseña */
.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 4px;
    border: none;
    background: transparent;

    color: #475569;
    font-size: 14px;
    cursor: pointer;
}

.toggle-password:hover {
    color: var(--secondary);
}

/* Selector de sede */
.select-wrapper {
    background: #f8fafc;
}

.input-wrapper select {
    appearance: auto;
    cursor: pointer;
    padding-right: 10px;
}

/* ==============================
   Recordarme
============================== */
.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0 20px;
}

.remember input {
    width: 15px;
    height: 15px;
    accent-color: var(--secondary);
    cursor: pointer;
}

.remember label {
    font-size: 11px;
    color: #475569;
    cursor: pointer;
}

/* ==============================
   Botón de acceso
============================== */
.login-button {
    width: 100%;
    height: 40px;

    border: none;
    border-radius: 12px;

    color: #ffffff;
    background: linear-gradient(
        100deg,
        var(--primary),
        var(--secondary)
    );

    font-size: 12px;
    font-weight: 700;
    font-family: inherit;

    cursor: pointer;
    box-shadow: 0 2px 4px rgba(43, 58, 103, 0.16);

    transition:
        filter 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.login-button:hover {
    filter: brightness(1.06);
    box-shadow: 0 5px 12px rgba(43, 58, 103, 0.2);
}

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

.login-button:focus-visible,
.toggle-password:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 3px;
}

/* ==============================
   Pie de tarjeta
============================== */
.login-footer {
    min-height: 36px;
    padding: 10px 28px;

    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;

    background: #f8fafc;
    border-top: 1px solid #f1f5f9;

    color: #8996b2;
    font-size: 9px;
}

/* ==============================
   Adaptación a móviles
============================== */
@media (max-width: 480px) {
    .login-container {
        padding: 18px 14px;
        align-items: center;
    }

    .login-card {
        max-width: 100%;
        border-radius: 14px;
    }

    .login-content {
        padding: 26px 22px 24px;
    }

    .brand {
        margin-bottom: 26px;
    }

    .welcome h2 {
        font-size: 20px;
    }

    .login-footer {
        padding: 10px 22px;
    }
}

@media (max-height: 700px) and (min-width: 481px) {
    .login-container {
        padding-top: 18px;
        padding-bottom: 18px;
    }

    .login-content {
        padding-top: 20px;
        padding-bottom: 20px;
    }

    .brand {
        margin-bottom: 20px;
    }
}
