/* ============================================================
   CRECER CONTABLE - LOGIN
   Diseño moderno, pensado primero para celular.
   ============================================================ */

:root {
    color-scheme: only light;

    --azul-noche: #041a36;
    --azul-marino: #062b57;
    --azul: #0759a5;
    --azul-claro: #1f8bff;
    --dorado: #f2b233;
    --texto: #122238;
    --texto-suave: #6a7a8f;
    --borde: #dde5ef;
    --campo: #f4f7fb;
    --error: #d93025;
    --exito: #16a34a;
}

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

html,
body {
    min-height: 100%;
}

/* Color de fondo de respaldo: la página larga (registro) no muestra gris abajo */
html {
    background: var(--azul-noche);
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--texto);
    background:
        radial-gradient(900px 500px at 15% -10%, rgba(31, 139, 255, .35), transparent 60%),
        radial-gradient(700px 500px at 110% 110%, rgba(242, 178, 51, .18), transparent 60%),
        linear-gradient(160deg, var(--azul-marino) 0%, var(--azul-noche) 70%);
    background-color: var(--azul-noche);
    -webkit-font-smoothing: antialiased;
}


/* ---------------- CONTENEDOR ---------------- */

.login-container {
    flex: 1;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: max(28px, env(safe-area-inset-top)) 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
}


/* ---------------- MARCA ---------------- */

.branding {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: aparecer .6s ease both;
}

.branding-simbolo {
    width: 104px;
    height: auto;
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, .45));
}

.branding-nombre {
    margin-top: 10px;
    font-size: 27px;
    font-weight: 800;
    letter-spacing: -.3px;
    color: #fff;
}

.branding-nombre span {
    color: var(--dorado);
}

.branding-lema {
    margin-top: 4px;
    font-size: 14px;
    color: rgba(255, 255, 255, .7);
}


/* ---------------- TARJETA ---------------- */

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 28px 24px 24px;
    border-radius: 24px;
    background: #fff;
    box-shadow:
        0 24px 60px rgba(0, 10, 30, .45),
        0 2px 0 rgba(255, 255, 255, .6) inset;
    animation: aparecer .6s .08s ease both;
}

.login-card h1 {
    font-size: 24px;
    font-weight: 800;
    color: var(--texto);
}

.subtitle {
    margin: 4px 0 22px;
    font-size: 14px;
    color: var(--texto-suave);
}


/* ---------------- CAMPOS ---------------- */

.input-group {
    margin-bottom: 16px;
}

.input-group label,
.form-group label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 700;
    color: var(--texto);
}

.input-wrapper {
    position: relative;
}

.input-wrapper input,
.form-group input {
    width: 100%;
    height: 50px;
    padding: 0 16px 0 46px;
    border: 1.5px solid var(--borde);
    border-radius: 14px;
    background: var(--campo);
    font-family: inherit;
    font-size: 15px;
    color: var(--texto);
    outline: none;
    transition: border-color .15s, background .15s, box-shadow .15s;
}

.form-group input {
    padding-left: 16px;
}

.input-wrapper input::placeholder,
.form-group input::placeholder {
    color: #9aa8b8;
}

.input-wrapper input:focus,
.form-group input:focus {
    border-color: var(--azul);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(7, 89, 165, .12);
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    pointer-events: none;
}

.input-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #8494a8;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.input-wrapper:focus-within .input-icon svg {
    stroke: var(--azul);
}

.toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    font-size: 17px;
    cursor: pointer;
    filter: grayscale(1);
    opacity: .6;
}

.toggle-password:hover {
    background: #e9eef5;
    opacity: 1;
}

#password {
    padding-right: 50px;
}


/* ---------------- OPCIONES ---------------- */

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 4px 0 20px;
    font-size: 13px;
}

.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--texto-suave);
    cursor: pointer;
}

.remember input {
    width: 17px;
    height: 17px;
    accent-color: var(--azul);
}

.login-options a {
    color: var(--azul);
    font-weight: 600;
    text-decoration: none;
}

.login-options a:hover {
    text-decoration: underline;
}


/* ---------------- BOTÓN ---------------- */

.btn-login {
    width: 100%;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--azul-claro), var(--azul));
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(7, 89, 165, .35);
    transition: transform .12s, box-shadow .12s, filter .12s;
}

.btn-login span {
    font-size: 18px;
    transition: transform .15s;
}

.btn-login:hover {
    filter: brightness(1.05);
    box-shadow: 0 12px 26px rgba(7, 89, 165, .45);
}

.btn-login:hover span {
    transform: translateX(3px);
}

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


/* ---------------- MENSAJES Y ENLACES ---------------- */

.login-message {
    min-height: 18px;
    margin-top: 12px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    color: var(--texto-suave);
}

.registro-link {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #edf1f6;
    font-size: 13.5px;
    color: var(--texto-suave);
}

.registro-link button {
    border: 0;
    background: transparent;
    color: var(--azul);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
}

.registro-link button:hover {
    text-decoration: underline;
}


/* ---------------- REGISTRO (se dibuja dentro de la tarjeta) ---------------- */

.registro-header h2 {
    font-size: 22px;
    font-weight: 800;
}

.registro-header p {
    margin: 4px 0 20px;
    font-size: 14px;
    color: var(--texto-suave);
}

.form-group {
    margin-bottom: 14px;
}

/* Formulario estático antiguo (no se usa) */
.registro-section {
    display: none !important;
}


/* ---------------- PIE ---------------- */

footer {
    padding: 14px 20px max(14px, env(safe-area-inset-bottom));
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, .55);
}


/* ---------------- PANTALLA DE PRESENTACIÓN ---------------- */

.presentacion {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background:
        radial-gradient(420px 420px at 50% 42%, rgba(31, 139, 255, .28), transparent 70%),
        linear-gradient(165deg, #0a3a78 0%, #062b57 45%, #041a36 100%);
    transition: opacity .55s ease, visibility .55s ease;
}

.presentacion-salir {
    opacity: 0;
    visibility: hidden;
}

/* Franjas doradas diagonales */
.franja {
    position: absolute;
    width: 160%;
    left: -30%;
    transform: rotate(-38deg);
    background: linear-gradient(90deg, rgba(240, 180, 60, 0), #f6c65b 35%, #c98b1c 65%, rgba(240, 180, 60, 0));
    box-shadow: 0 0 18px rgba(246, 198, 91, .35);
    opacity: 0;
    animation: franja-entrar .9s ease forwards;
}

.franja-1 { top: 8%;  height: 10px; animation-delay: .05s; }
.franja-2 { top: 17%; height: 3px;  animation-delay: .15s; opacity: .7; }
.franja-3 { bottom: 12%; height: 14px; animation-delay: .1s; }
.franja-4 { bottom: 22%; height: 3px;  animation-delay: .2s; }

.presentacion-centro {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: aparecer .7s .15s ease both;
}

.presentacion-centro img {
    width: 118px;
    height: auto;
    filter: drop-shadow(0 14px 30px rgba(0, 0, 0, .5));
}

.presentacion-nombre {
    margin-top: 18px;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: .32em;
    padding-left: .32em;
    color: #fff;
}

.presentacion-sub {
    margin-top: 4px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .55em;
    padding-left: .55em;
    color: var(--dorado);
}

.presentacion-barra {
    width: 150px;
    height: 5px;
    margin-top: 34px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .16);
    overflow: hidden;
}

.presentacion-barra span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 99px;
    background: linear-gradient(90deg, #62c4ff, #1f8bff);
    animation: cargar 1.9s .2s ease-in-out forwards;
}

@keyframes cargar {
    to { width: 100%; }
}

@keyframes franja-entrar {
    from { opacity: 0; transform: rotate(-38deg) translateX(-12%); }
    to   { opacity: .95; transform: rotate(-38deg) translateX(0); }
}

@media (min-width: 900px) {
    .presentacion-centro img { width: 150px; }
    .presentacion-nombre { font-size: 44px; }
    .presentacion-sub { font-size: 18px; }
}


/* ---------------- ANIMACIÓN ---------------- */

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

    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .branding,
    .login-card {
        animation: none;
    }
}


/* ---------------- COMPUTADORA: marca a la izquierda, tarjeta a la derecha ---------------- */

@media (min-width: 900px) {

    .login-container {
        flex-direction: row;
        justify-content: space-between;
        gap: 60px;
        padding: 40px 40px;
    }

    .branding {
        flex: 1;
        align-items: flex-start;
        text-align: left;
    }

    .branding-simbolo {
        width: 170px;
    }

    .branding-nombre {
        margin-top: 18px;
        font-size: 44px;
        letter-spacing: -1px;
    }

    .branding-lema {
        margin-top: 8px;
        font-size: 17px;
    }

    .login-card {
        padding: 36px 34px 30px;
    }

    .login-card h1 {
        font-size: 27px;
    }
}
