﻿/* ===========================
    LIGHT PREMIUM — PropertyTech
    =========================== */

:root {
    /* Base claros */
    --bg: #F7FAFF;
    --panel: #FFFFFF;
    --panel-bd: #E6EEF6;
    --ink: #1F2D3D;
    --muted: #6E7E90;
    /* Accentos “tech” */
    --blue: #2F80ED;
    --aqua: #37D6FF;
    --mint: #35E6B3;
    --gold: #FFC857;
    /* Estados */
    --error: #E74C3C;
    --ok: #27AE60;
    /* Efectos */
    --glow: 0 10px 30px rgba(47,128,237,.24);
    --panel-shadow: 0 18px 48px rgba(20, 46, 80, .10);
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --speed: .25s;
    /* Tipos */
    --font-inter: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    --font-urbanist: 'Urbanist', var(--font-inter);
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-inter);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* CAMBIOS: Se añade Flexbox al body para la solución del footer */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ——— Fondo técnico premium ——— */
.hero-light {
    position: relative;
    padding: 4.5rem 2rem 2rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: clip;
    background: radial-gradient(1200px 800px at 18% -10%, #FFFFFF 0%, var(--bg) 65%);
    /* CAMBIOS: Ocupa todo el espacio disponible */
    flex-grow: 1;
}

.bg-grid {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(31,45,61,.05) 1px, transparent 1px) 0 0 / 46px 46px, linear-gradient(to bottom, rgba(31,45,61,.05) 1px, transparent 1px) 0 0 / 46px 46px;
    pointer-events: none;
    mask: radial-gradient(ellipse at 40% -20%, rgba(0,0,0,.25), transparent 60%);
}

.bg-fade {
    position: absolute;
    inset: 0;
    background: radial-gradient(600px 300px at 85% 20%, rgba(55,214,255,.12), transparent 60%), radial-gradient(500px 250px at 10% 80%, rgba(47,128,237,.12), transparent 60%);
    pointer-events: none;
}

.bg-reflection {
    position: absolute;
    right: -15%;
    top: -15%;
    width: 520px;
    height: 520px;
    background: conic-gradient(from 180deg, rgba(255,255,255,.7), rgba(255,255,255,0) 60%);
    filter: blur(40px);
    opacity: .35;
    transform: rotate(8deg);
    pointer-events: none;
}

/* Estilos para el botón VOLVER */
.btn-volver-estilizado {
    position: absolute; /* Permite posicionarlo con top/right */
    top: 20px; /* Ajusta según el margen superior deseado */
    right: 20px; /* Ajusta según el margen derecho deseado */

    background-color: #007bff; /* Fondo azul */
    color: white; /* Texto y flecha blancos */
    padding: 10px 20px; /* Relleno para que sea rectangular */
    border-radius: 8px; /* Bordes redondeados */
    text-decoration: none; /* Quitar subrayado del enlace */
    font-weight: 600; /* Texto seminegrita */
    display: flex; /* Para alinear el icono y el texto */
    align-items: center; /* Centrar verticalmente */
    gap: 8px; /* Espacio entre el icono y el texto */
    transition: background-color 0.3s ease; /* Efecto suave al pasar el ratón */
    z-index: 10; /* Asegura que esté por encima de otros elementos */
}

    .btn-volver-estilizado:hover {
        background-color: #0056b3; /* Azul más oscuro al pasar el ratón */
        color: white; /* Asegura que el color del texto no cambie */
    }

    .btn-volver-estilizado i {
        font-size: 1.2em; /* Tamaño del icono */
    }

/* ——— Layout principal ——— */
.container-auth {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1260px;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 56px;
}

/* ——— Panel de marca (izquierda) ——— */
.brand-panel .chip {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .65rem;
    border-radius: 999px;
    font: 600 .78rem/1 var(--font-inter);
    background: linear-gradient(90deg, rgba(47,128,237,.1), rgba(55,214,255,.1));
    border: 1px solid rgba(47,128,237,.25);
    color: #2C3E50;
}

    .brand-panel .chip::before {
        content: "";
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: radial-gradient(circle, var(--aqua) 0%, transparent 65%);
        box-shadow: 0 0 10px var(--aqua);
    }

.title {
    margin: .9rem 0 0;
    /* Uso de clamp() para un tamaño de fuente fluido */
    font: 800 clamp(1.8rem, 2vw + 1rem, 2.8rem) / 1.08 var(--font-urbanist);
    letter-spacing: .3px;
}

.subtitle {
    margin: .35rem 0 0;
    font: 600 1.2rem/1.45 var(--font-inter);
    color: var(--muted);
}

.divider {
    width: 100px;
    height: 3px;
    margin: 1.1rem 0 1.1rem;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--blue), transparent);
    box-shadow: 0 0 12px rgba(47,128,237,.25);
}

.lead {
    max-width: 52ch;
    color: #4a5c70;
    font: 500 1.02rem/1.7 var(--font-inter);
}

.value-points {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
    display: grid;
    gap: .6rem;
}

    .value-points li {
        display: flex;
        align-items: center;
        gap: .6rem;
        color: #3b4f63;
        font-weight: 600;
    }

    .value-points i {
        color: var(--blue);
        filter: drop-shadow(0 0 6px rgba(47,128,237,.25));
    }

/* ——— Panel de acceso (derecha) ——— */
.card.glass.pro {
    background: var(--panel);
    border: 1px solid var(--panel-bd);
    border-radius: var(--radius-lg);
    box-shadow: var(--panel-shadow);
    padding: 2.2rem 2rem;
    text-align: center;
    position: relative;
    isolation: isolate;
    overflow: clip;
}

    .card.glass.pro::after {
        /* brillos sutiles en borde superior */
        content: "";
        position: absolute;
        inset: -1px -1px auto -1px;
        height: 60px;
        border-radius: inherit;
        background: linear-gradient(180deg, rgba(255,255,255,.7), rgba(255,255,255,0));
        pointer-events: none;
    }

.logo-wrap {
    margin-bottom: .9rem;
}

.logo {
    max-width: 150px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.form-title {
    /* Uso de clamp() para un tamaño de fuente fluido */
    font: 800 clamp(1.6rem, 1.8vw + .8rem, 2rem) / 1.1 var(--font-urbanist);
    margin: .2rem 0 .25rem;
    letter-spacing: .2px;
}

.form-subtitle {
    font: 500 .98rem/1.5 var(--font-inter);
    color: var(--muted);
    margin-bottom: 1.1rem;
}

/* ——— Alertas ——— */
.alert-error {
    text-align: left;
    display: flex;
    align-items: center;
    gap: .6rem;
    background: rgba(231, 76, 60, .08);
    color: var(--error);
    border: 1px solid rgba(231,76,60,.25);
    padding: .75rem 1rem;
    border-radius: 14px;
    margin-bottom: 1rem;
    font-weight: 700;
}

/* ——— Formulario ——— */
.form {
    text-align: left;
}

.field {
    margin-bottom: 1rem;
}

    .field label {
        display: block;
        font: 700 .9rem/1.3 var(--font-inter);
        color: #263648;
        margin-bottom: .45rem;
    }

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid #E0E6ED;
    border-radius: var(--radius-md);
    background: #fff;
    transition: box-shadow var(--speed), border-color var(--speed), transform var(--speed);
}

    .input-wrap:focus-within {
        border-color: var(--blue);
        box-shadow: 0 0 0 4px rgba(47,128,237,.18), var(--glow);
    }

    .input-wrap input {
        width: 100%;
        border: 0;
        outline: 0;
        background: transparent;
        color: var(--ink);
        padding: .95rem 2.75rem .95rem 2.6rem;
        font-size: 1rem;
    }

        .input-wrap input::placeholder {
            color: #95A5A6;
        }

/* Iconos de campo */
.icon-left {
    position: absolute;
    left: .9rem;
    font-size: 1.05rem;
    color: #7a8ea2;
}

/* Botón icono ojo */
.icon-btn {
    position: absolute;
    right: .6rem;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
    border-radius: 10px;
    transition: background var(--speed), transform var(--speed), box-shadow var(--speed);
    cursor: pointer;
}

    .icon-btn:hover {
        background: rgba(47,128,237,.08);
    }

    .icon-btn:focus-visible {
        outline: 2px solid var(--blue);
        outline-offset: 3px;
        box-shadow: 0 0 0 4px rgba(47,128,237,.18);
    }

    .icon-btn.is-disabled {
        cursor: not-allowed;
        pointer-events: none;
        opacity: .45;
    }

/* Mensaje inválido */
.invalid {
    display: none;
    color: var(--error);
    margin-top: .35rem;
    font-size: .86rem;
}

/* ——— Botón primario ——— */
.btn.primary {
    margin-top: 1rem;
    width: 100%;
    border: 0;
    border-radius: 14px;
    padding: 1rem 1.1rem;
    color: #fff;
    font: 800 1.02rem/1 var(--font-urbanist);
    text-transform: uppercase;
    letter-spacing: .9px;
    background: linear-gradient(135deg, var(--blue) 0%, #3BA5FF 50%, var(--aqua) 100%);
    box-shadow: 0 10px 26px rgba(59,165,255,.25);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: .6rem;
    transition: transform var(--speed), box-shadow var(--speed), filter var(--speed), opacity var(--speed);
    cursor: pointer;
}

    .btn.primary:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 16px 36px rgba(59,165,255,.28);
        filter: saturate(1.05);
    }

    .btn.primary:active:not(:disabled) {
        transform: translateY(0);
        box-shadow: 0 10px 24px rgba(59,165,255,.22);
    }

    .btn.primary:disabled {
        background: linear-gradient(135deg, #B9C9D9, #A8BDCF);
        color: #f6f9fc;
        box-shadow: none;
        cursor: not-allowed;
    }

.spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    display: none;
    animation: spin .8s linear infinite;
}

.btn.loading .spinner {
    display: inline-block;
}

.btn.loading .btn-text {
    opacity: .9;
}

/* ——— Enlaces secundarios ——— */
.links {
    margin-top: 1.05rem;
    display: flex;
    justify-content: space-between;
    font-size: .95rem;
}

    .links a {
        color: var(--muted);
        text-decoration: none;
        position: relative;
        transition: color var(--speed);
    }

        .links a:hover {
            color: var(--blue);
        }

        .links a::after {
            content: "";
            position: absolute;
            left: 0;
            bottom: -2px;
            width: 0;
            height: 2px;
            background: var(--blue);
            transition: width var(--speed);
        }

        .links a:hover::after {
            width: 100%;
        }

/* ——— Footer ——— */
.site-footer {
    /* CAMBIOS: Se corrige el footer */
    position: static;
    width: 100%;
    background: #000000;
    border-top: 1px solid #555;
    color: #FFFFFF;
    font-size: .85rem;
    z-index: 3;
}

.foot-container {
    max-width: 1260px;
    margin: 0 auto;
    padding: .9rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: .6rem 1.4rem;
    justify-content: center;
}

.site-footer p {
    margin: 0;
}

/* ——— Autofill WebKit ——— */
input:-webkit-autofill {
    -webkit-text-fill-color: var(--ink);
    transition: background-color 100000s ease-in-out 0s;
}

    input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
        box-shadow: 0 0 0 1000px #fff inset;
    }

/* ——— Animaciones ——— */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ——— Responsive ——— */
/* Tablet & Mobile */
@media (max-width: 1100px) {
    .container-auth {
        grid-template-columns: 1fr;
        gap: 3rem; /* Espaciado ajustado para una mejor estética */
    }

    .brand-panel {
        order: 2;
    }

    .auth-panel {
        order: 1;
    }

    .site-footer {
        position: static;
    }

    .hero-light {
        padding-bottom: 2.2rem;
        /* Asegura que el contenido quede centrado en tablets/móviles */
        align-items: center;
    }
}

/* Mobile */
@media (max-width: 560px) {
    .hero-light {
        padding: 3rem 1rem 1rem;
    }

    .card.glass.pro {
        padding: 1.8rem 1.2rem;
        border-radius: 16px;
    }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
