﻿/* ══════════════════════════════════════════════════════════════
   Auth.Master — estilos base para TODAS las pantallas de acceso
   Paleta: blanco + verde COBAED (#1b4332) + dorado (#c9a84c)
══════════════════════════════════════════════════════════════ */
:root {
    --verde: #1b4332;
    --verde-mid: #2d6a4f;
    --verde-claro: #52b788;
    --verde-bg: #f0f7f3;
    --dorado: #c9a84c;
    --dorado-dark: #a8852e;
    --blanco: #ffffff;
    --gris-fondo: #f4f6f5;
    --borde: #d4ddd7;
    --texto: #1a2e22;
    --muted: #607b6c;
    --error: #c0392b;
    --exito: #2d6a4f;
    --radio: 10px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--blanco);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--texto);
}

/* ── Barra superior ─────────────────────────────────────────── */
.auth-topbar {
    background: var(--blanco);
    border-bottom: 1px solid #e8ede9;
    padding: 0 24px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

    .auth-topbar .logo-wrap {
        display: flex;
        align-items: center;
        gap: 12px;
        text-decoration: none;
    }

        .auth-topbar .logo-wrap img {
            height: 46px;
            width: auto;
        }

    .auth-topbar .logo-fallback {
        display: flex;
        flex-direction: column;
    }

        .auth-topbar .logo-fallback .siglas {
            font-size: 22px;
            font-weight: 900;
            letter-spacing: 1.5px;
            color: var(--verde);
            line-height: 1;
        }

        .auth-topbar .logo-fallback .subtitulo {
            font-size: 9px;
            letter-spacing: 1.5px;
            color: var(--muted);
            text-transform: uppercase;
        }

    .auth-topbar .sistema-label {
        font-size: 13px;
        font-weight: 600;
        color: var(--muted);
        border: 1.5px solid var(--borde);
        border-radius: 20px;
        padding: 4px 14px;
    }

/* Franja dorada debajo de la topbar */
.auth-stripe {
    height: 3px;
    background: linear-gradient(90deg, var(--verde) 0%, var(--dorado) 50%, var(--verde-claro) 100%);
    flex-shrink: 0;
}

/* ── Área de contenido centrada ─────────────────────────────── */
.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: var(--gris-fondo);
}

/* ── Tarjeta ─────────────────────────────────────────────────── */
.auth-card {
    background: var(--blanco);
    border-radius: 16px;
    box-shadow: 0 2px 4px rgba(27,67,50,.06), 0 8px 24px rgba(27,67,50,.10);
    width: 100%;
    max-width: 480px;
    overflow: hidden;
    border: 1px solid #e4ebe5;
}
    /* Línea dorada superior de la tarjeta */
    .auth-card::before {
        content: '';
        display: block;
        height: 4px;
        background: linear-gradient(90deg, var(--dorado), var(--verde-claro));
    }

/* ── Cabecera de la tarjeta ─────────────────────────────────── */
.auth-card-head {
    background: var(--verde-bg);
    padding: 24px 32px 20px;
    border-bottom: 1px solid #d8ebe1;
    display: flex;
    align-items: center;
    gap: 14px;
}

    .auth-card-head .icono-pagina {
        width: 48px;
        height: 48px;
        border-radius: 12px;
        background: var(--verde);
        color: var(--blanco);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        flex-shrink: 0;
    }

    .auth-card-head h2 {
        font-size: 20px;
        font-weight: 800;
        color: var(--verde);
        margin: 0;
        line-height: 1.2;
    }

    .auth-card-head p {
        font-size: 12px;
        color: var(--muted);
        margin: 4px 0 0;
    }

/* ── Cuerpo de la tarjeta ───────────────────────────────────── */
.auth-card-body {
    padding: 28px 32px 32px;
}

/* ── Mensajes de alerta ─────────────────────────────────────── */
.auth-alert {
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 18px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    display: none;
}

    .auth-alert.visible {
        display: flex;
    }

    .auth-alert.error {
        background: #fdecea;
        color: var(--error);
        border-left: 4px solid var(--error);
    }

    .auth-alert.exito {
        background: #d4edda;
        color: var(--exito);
        border-left: 4px solid var(--exito);
    }

    .auth-alert.info {
        background: #e8f4fd;
        color: #1565c0;
        border-left: 4px solid #1565c0;
    }

/* ── Grupos de campo ────────────────────────────────────────── */
.campo {
    margin-bottom: 18px;
}

    .campo label {
        display: block;
        font-size: 11px;
        font-weight: 700;
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: .6px;
        margin-bottom: 6px;
    }

.input-wrap {
    display: flex;
    align-items: stretch;
    border: 1.5px solid var(--borde);
    border-radius: var(--radio);
    overflow: hidden;
    transition: border-color .18s, box-shadow .18s;
    background: var(--blanco);
}

    .input-wrap:focus-within {
        border-color: var(--verde);
        box-shadow: 0 0 0 3px rgba(27,67,50,.09);
    }

    .input-wrap .ico {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        background: var(--gris-fondo);
        color: var(--muted);
        flex-shrink: 0;
        border-right: 1px solid var(--borde);
        font-size: 14px;
    }

    .input-wrap input {
        flex: 1;
        border: none;
        outline: none;
        padding: 11px 14px;
        font-size: 14px;
        background: transparent;
        color: var(--texto);
        font-family: inherit;
    }

        .input-wrap input::placeholder {
            color: #b0bdb5;
        }
    /* Botón de ojo (contraseña) */
    .input-wrap .btn-ojo {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        background: none;
        border: none;
        border-left: 1px solid var(--borde);
        color: var(--muted);
        cursor: pointer;
        font-size: 14px;
        flex-shrink: 0;
        transition: color .15s;
    }

        .input-wrap .btn-ojo:hover {
            color: var(--verde);
        }
/* Hint debajo del input */
.campo-hint {
    font-size: 11px;
    color: var(--muted);
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── Botón principal ─────────────────────────────────────────── */
.btn-auth {
    width: 100%;
    padding: 12px;
    background: var(--verde);
    color: var(--blanco);
    border: none;
    border-radius: var(--radio);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .3px;
    cursor: pointer;
    transition: background .18s, transform .1s;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

    .btn-auth:hover {
        background: var(--verde-mid);
    }

    .btn-auth:active {
        transform: scale(.98);
    }

    .btn-auth.dorado {
        background: var(--dorado);
        color: var(--verde);
    }

        .btn-auth.dorado:hover {
            background: var(--dorado-dark);
            color: #fff;
        }

/* ── Botón secundario / link ─────────────────────────────────── */
.btn-regresar {
    background: none;
    border: none;
    color: var(--dorado-dark);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    padding: 0;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color .15s;
}

    .btn-regresar:hover {
        color: var(--verde);
        text-decoration: underline;
    }

/* Barra de acciones (Regresar + Botón principal) */
.auth-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 22px;
    gap: 12px;
}

    .auth-actions .btn-auth {
        flex: 1;
        max-width: 200px;
    }

/* ── Divisor ─────────────────────────────────────────────────── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
}

    .auth-divider::before,
    .auth-divider::after {
        content: '';
        flex: 1;
        height: 1px;
        background: var(--borde);
    }

/* ── Botón Google ────────────────────────────────────────────── */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    border: 1.5px solid var(--borde);
    border-radius: var(--radio);
    background: var(--blanco);
    font-size: 14px;
    font-weight: 600;
    color: var(--texto);
    cursor: pointer;
    transition: border-color .18s, box-shadow .18s, background .18s;
    text-decoration: none;
    font-family: inherit;
}

    .btn-google:hover {
        border-color: #4285F4;
        box-shadow: 0 2px 8px rgba(66,133,244,.18);
        background: #fafcff;
        color: var(--texto);
        text-decoration: none;
    }

    .btn-google .google-icon {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }

/* ── Links de pie de tarjeta ─────────────────────────────────── */
.auth-links {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #eef1ee;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .auth-links a,
    .auth-links span {
        font-size: 12.5px;
        color: var(--muted);
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .auth-links a {
        color: var(--verde-mid);
        font-weight: 600;
    }

        .auth-links a:hover {
            color: var(--verde);
            text-decoration: underline;
        }

/* ── CAPTCHA ────────────────────────────────────────────────── */
.captcha-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 20px;
}

.captcha-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.captcha-img-wrap {
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--gris-borde);
    background: #fff;
}

    .captcha-img-wrap img {
        display: block;
        max-width: 100%;
        height: auto;
    }

.captcha-refresh {
    background: var(--gris-fondo);
    border: 1px solid var(--gris-borde);
    color: var(--verde-mid);
    cursor: pointer;
    font-size: 14px;
    padding: 12px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .captcha-refresh:hover {
        color: var(--verde);
        background: #edf2f7;
    }

.captcha-input-wrap {
    flex: 1;
    min-width: 130px;
}

/* ── Pie de página ───────────────────────────────────────────── */
.auth-footer {
    text-align: center;
    padding: 16px;
    font-size: 11px;
    color: #aab5ad;
    background: var(--gris-fondo);
    border-top: 1px solid #e4ebe5;
    flex-shrink: 0;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 520px) {
    .auth-main {
        padding: 24px 12px;
        align-items: flex-start;
    }

    .auth-card-body {
        padding: 22px 20px 26px;
    }

    .auth-card-head {
        padding: 18px 20px 16px;
    }

    .auth-topbar {
        padding: 0 16px;
    }

    .auth-card {
        border-radius: 12px;
    }
}
