
/* ========================================
   FUNDACINE
   ESTILOS DEL INICIO DE SESION
======================================== */

:root {

    /* PALETA DE COLORES */

    --background: #111111;
    --panel: #1b1b1b;
    --border: #303030;

    --gold: #F0BC78;
    --gold-hover: #ffd39d;

    --text: #ffffff;
    --muted: #aaaaaa;

    --input-background: #111111;
    --input-border: #444444;

    --radius: 12px;

}

/* CONFIGURACION GENERAL */

* {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
}

body {

    margin: 0;

    min-height: 100vh;
    min-height: 100dvh;

    background:
        radial-gradient(
            ellipse at 50% 0%,
            #252019 0%,
            var(--background) 55%
        );

    color: var(--text);

    font-family: Arial, Helvetica, sans-serif;

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

    padding: 35px 25px;

}

[hidden] {
    display: none !important;
}

/* CONTENEDOR PRINCIPAL */

.container {

    width: 100%;
    max-width: 420px;

    animation: page-enter 0.6s ease-out both;

}

@keyframes page-enter {

    from {

        opacity: 0;
        transform: translateY(12px);

    }

    to {

        opacity: 1;
        transform: translateY(0);

    }

}

/* LOGO */

.logo-link {

    display: block;

    width: 180px;
    max-width: 100%;

    margin: 0 auto 35px;

    text-decoration: none;

    border-radius: 6px;

    transition:
        opacity 0.25s ease,
        transform 0.25s ease;

}

.logo-link:hover {

    opacity: 0.85;
    transform: translateY(-2px);

}

.logo-link:focus-visible {

    outline: 2px solid var(--gold);
    outline-offset: 8px;

}

.logo {

    display: block;

    width: 100%;
    height: auto;

}

/* TARJETA */

.card {

    background: var(--panel);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    padding: 35px;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.25);

}

.tag {

    display: block;

    color: var(--gold);

    font-size: 10px;
    font-weight: 600;

    letter-spacing: 2px;
    line-height: 1.6;

    text-transform: uppercase;

}

h1 {

    font-size: 30px;
    line-height: 1.2;

    margin: 15px 0 12px;

    letter-spacing: -0.7px;

}

.description {

    margin: 0;

    font-size: 14px;
    line-height: 1.7;

    color: var(--muted);

}

/* FORMULARIO */

form {
    margin-top: 25px;
}

.form-group {

    margin-bottom: 20px;

}

.field-label {

    display: block;

    font-size: 13px;
    font-weight: 500;

    margin-bottom: 10px;

    color: var(--text);

}

.form-input {

    display: block;

    width: 100%;
    min-width: 0;

    padding: 14px;

    background: var(--input-background);

    color: var(--text);

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

    font-family: inherit;
    font-size: 16px;

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

}

.form-input::placeholder {

    color: #777777;
    font-size: 14px;

}

.form-input:focus {

    outline: none;

    border-color: var(--gold);

    box-shadow:
        0 0 0 3px rgba(240, 188, 120, 0.12);

}

/* INTERRUPTOR DE CONTRASENA */

.password-options {

    display: flex;
    align-items: center;

    margin-top: 2px;
    margin-bottom: 5px;

}

.password-toggle {

    position: relative;

    display: inline-flex;
    align-items: center;

    gap: 10px;

    min-height: 44px;

    cursor: pointer;

    color: var(--muted);

    font-size: 13px;

    user-select: none;

}

/* Ocultar visualmente el checkbox,
   conservando su accesibilidad. */

.password-toggle input {

    position: absolute;

    width: 1px;
    height: 1px;

    padding: 0;
    margin: -1px;

    overflow: hidden;

    clip: rect(0, 0, 0, 0);

    clip-path: inset(50%);

    white-space: nowrap;

    border: 0;

}

/* FONDO DEL INTERRUPTOR */

.switch-track {

    position: relative;

    display: inline-block;

    flex-shrink: 0;

    width: 44px;
    height: 24px;

    background: #444444;

    border-radius: 30px;

    transition:
        background-color 0.25s ease;

}

/* CIRCULO DEL INTERRUPTOR */

.switch-thumb {

    position: absolute;

    top: 3px;
    left: 3px;

    width: 18px;
    height: 18px;

    background: #ffffff;

    border-radius: 50%;

    box-shadow:
        0 2px 5px rgba(0, 0, 0, 0.2);

    transition:
        transform 0.25s ease,
        background-color 0.25s ease;

}

/* INTERRUPTOR ACTIVADO */

.password-toggle input:checked + .switch-track {

    background: var(--gold);

}

.password-toggle input:checked
+ .switch-track .switch-thumb {

    transform: translateX(20px);

    background: #111111;

}

.password-toggle input:checked
~ #password-toggle-text {

    color: var(--gold);

}

/* ACCESIBILIDAD CON TECLADO */

.password-toggle input:focus-visible
+ .switch-track {

    outline: 2px solid var(--gold);
    outline-offset: 4px;

}

/* BOTON DE INICIO DE SESION */

.login-button {

    display: block;

    width: 100%;

    margin-top: 24px;
    padding: 15px;

    border: 0;
    border-radius: 6px;

    background: var(--gold);
    color: #111111;

    font-family: inherit;
    font-size: 14px;
    font-weight: bold;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        transform 0.2s ease;

}

.login-button:hover {

    background: var(--gold-hover);

    transform: translateY(-1px);

}

.login-button:active {

    transform: translateY(0);

}

.login-button:focus-visible {

    outline: 2px solid var(--gold);
    outline-offset: 4px;

}

/* MENSAJES DE ERROR */

.error {

    margin-top: 20px;

    padding: 15px;

    border: 1px solid #713636;
    border-radius: 6px;

    background: #352020;

    color: #ffb3b3;

    font-size: 13px;
    line-height: 1.6;

    overflow-wrap: anywhere;

}

/* PIE DE PAGINA */

.footer {

    margin-top: 28px;

    text-align: center;

    color: #999999;

    font-size: 12px;

}

.back-link {

    display: inline-flex;
    align-items: center;

    gap: 7px;

    min-height: 44px;

    color: var(--gold);

    text-decoration: none;

    transition: color 0.2s ease;

}

.back-link:hover {

    color: var(--gold-hover);

}

.back-link:focus-visible {

    outline: 2px solid var(--gold);
    outline-offset: 5px;

}

.footer p {

    margin: 12px 0 0;

    line-height: 1.6;

}

/* ========================================
   RESPONSIVE
======================================== */

@media (max-width: 480px) {

    body {

        padding: 25px 18px;

    }

    .card {

        padding: 25px;

    }

    .logo-link {

        width: 150px;

        margin-bottom: 25px;

    }

    h1 {

        font-size: 27px;

    }

    .tag {

        font-size: 9px;

        letter-spacing: 1.5px;

    }

    .footer {

        margin-top: 20px;

    }

}

@media (max-width: 340px) {

    body {

        padding: 20px 12px;

    }

    .card {

        padding: 20px;

    }

    h1 {

        font-size: 24px;

    }

}

/* RESPETAR PREFERENCIAS DE MOVIMIENTO */

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

    *,
    *::before,
    *::after {

        animation: none !important;
        transition: none !important;

    }

}
