@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
    --auth-blue: #002776;
    --auth-blue-hover: #001d5c;
    --auth-red: #d71920;
    --auth-black: #1e293b;
    --auth-gray-100: #f8fafc;
    --auth-gray-200: #e2e8f0;
    --auth-gray-600: #64748b;
    --auth-radius: 8px;
    --auth-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    --auth-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Montserrat', sans-serif;
    color: var(--auth-black);
    background: transparent;
}

/* Background */
.auth-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        linear-gradient(135deg, rgba(0, 39, 118, 0.92), rgba(0, 29, 92, 0.85)),
        url('/images/fondo.webp') center / cover no-repeat;
    overflow: hidden;
}

.auth-bg__glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.auth-bg__glow::before,
.auth-bg__glow::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    animation: authGlowDrift 16s ease-in-out infinite;
}

.auth-bg__glow::before {
    top: -8%;
    right: -6%;
    width: 42%;
    height: 50%;
    background: rgba(255, 82, 89, 0.16);
}

.auth-bg__glow::after {
    bottom: -12%;
    left: -8%;
    width: 38%;
    height: 45%;
    background: rgba(255, 255, 255, 0.07);
    animation-delay: -8s;
}

/* Top bar */
.auth-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    flex-shrink: 0;
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.9rem;
    border-radius: var(--auth-radius);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    transition: background 0.3s var(--auth-ease), border-color 0.3s var(--auth-ease), transform 0.3s var(--auth-ease);
}

.auth-back:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
    transform: translateX(-3px);
}

.auth-back i {
    transition: transform 0.3s var(--auth-ease);
}

.auth-back:hover i {
    transform: translateX(-2px);
}

.auth-topbar__badge {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
}

/* Split layout */
.auth-layout {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    width: min(1080px, 100%);
    margin: 0 auto;
    padding: 0 1.5rem 2rem;
    gap: 2rem;
}

.auth-aside {
    display: none;
}

.auth-aside__inner {
    max-width: 420px;
}

.auth-aside__logo {
    height: 72px;
    width: auto;
    margin-bottom: 1.25rem;
    display: block;
}

.auth-aside__tag {
    display: inline-block;
    margin: 0 0 1rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--auth-radius);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
}

.auth-aside__title {
    margin: 0 0 0.75rem;
    font-size: clamp(1.5rem, 3vw, 1.85rem);
    font-weight: 700;
    line-height: 1.25;
    color: #fff;
}

.auth-aside__text {
    margin: 0 0 1.75rem;
    font-size: 0.95rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.8);
}

.auth-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.auth-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    transition: transform 0.3s var(--auth-ease);
}

.auth-features li:hover {
    transform: translateX(4px);
}

.auth-features i {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--auth-radius);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 0.9rem;
    transition: background 0.3s var(--auth-ease), transform 0.3s var(--auth-ease);
}

.auth-features li:hover i {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.06);
}

/* Main / card */
.auth-main {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

.auth-card {
    position: relative;
    border-radius: 12px;
    padding: 2rem 1.75rem;
    background: #fff;
    border: 1px solid var(--auth-gray-200);
    box-shadow: var(--auth-shadow);
    overflow: hidden;
    transition: box-shadow 0.4s var(--auth-ease), transform 0.4s var(--auth-ease);
}

.auth-card:hover {
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

.auth-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--auth-blue), var(--auth-red), var(--auth-blue));
    background-size: 200% 100%;
    animation: authLineShine 5s ease-in-out infinite;
}

.auth-card__head {
    margin-bottom: 1.5rem;
    text-align: center;
}

.auth-title {
    margin: 0 0 0.35rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--auth-black);
}

.auth-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: var(--auth-gray-600);
}

/* Alert */
.auth-alert {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    padding: 0.85rem 1rem;
    border-radius: var(--auth-radius);
    border: 1px solid rgba(201, 62, 39, 0.3);
    background: rgba(201, 62, 39, 0.07);
    color: #991b1b;
    font-size: 0.875rem;
}

.auth-alert i {
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.auth-alert ul {
    font-size: 0.8rem;
}

/* Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.auth-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--auth-black);
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 1rem;
    color: var(--auth-blue);
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1;
}

.auth-input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.75rem;
    border-radius: var(--auth-radius);
    border: 1px solid var(--auth-gray-200);
    background: var(--auth-gray-100);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--auth-black);
    transition: border-color 0.3s var(--auth-ease), box-shadow 0.3s var(--auth-ease), background 0.3s var(--auth-ease), transform 0.3s var(--auth-ease);
}

.auth-input::placeholder {
    color: rgba(107, 107, 107, 0.75);
}

.auth-input:focus {
    outline: none;
    border-color: var(--auth-blue);
    background: #fff;
    box-shadow: 0 4px 16px rgba(0, 39, 118, 0.12);
    transform: translateY(-1px);
}

.auth-input-wrap:has(.auth-toggle-pw) .auth-input {
    padding-right: 2.75rem;
}

.auth-input.is-invalid {
    border-color: #dc2626;
    background: #fef2f2;
}

.auth-toggle-pw {
    position: absolute;
    right: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--auth-gray-600);
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.auth-toggle-pw:hover {
    color: var(--auth-blue);
    background: rgba(0, 26, 112, 0.1);
}

.auth-field-error {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: #dc2626;
}

.auth-form__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.auth-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--auth-gray-600);
    user-select: none;
}

.auth-check input {
    width: 17px;
    height: 17px;
    accent-color: var(--auth-blue);
    cursor: pointer;
}

.auth-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--auth-blue);
    text-decoration: none;
    transition: color 0.2s;
}

.auth-link:hover {
    color: var(--auth-black);
}

.auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.8rem 1.25rem;
    border: 1px solid var(--auth-blue);
    border-radius: var(--auth-radius);
    background: var(--auth-blue);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s var(--auth-ease), transform 0.3s var(--auth-ease), box-shadow 0.3s var(--auth-ease), border-color 0.3s var(--auth-ease);
}

.auth-submit:hover {
    background: var(--auth-blue-hover);
    border-color: var(--auth-blue-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 39, 118, 0.3);
}

.auth-submit:active {
    transform: translateY(0);
    box-shadow: none;
}

.auth-submit i {
    transition: transform 0.3s var(--auth-ease);
}

.auth-submit:hover i {
    transform: translateX(3px);
}

.auth-footer {
    margin: 1.25rem 0 0;
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Override layout wrappers */
body.auth main.py-4 {
    padding: 0 !important;
    min-height: 100vh;
    display: block;
}

body.auth #app {
    min-height: 100vh;
}

/* Desktop split */
@media (min-width: 900px) {
    .auth-layout {
        grid-template-columns: 1fr 440px;
        gap: 3rem;
        padding-bottom: 3rem;
    }

    .auth-aside {
        display: block;
    }

    .auth-main {
        margin: 0;
        max-width: none;
    }

    .auth-card__head {
        text-align: left;
    }
}

@media (max-width: 576px) {
    .auth-topbar {
        padding: 0.75rem 1rem;
    }

    .auth-layout {
        padding: 0 1rem 1.5rem;
    }

    .auth-card {
        padding: 1.5rem 1.25rem;
    }

    .auth-title {
        font-size: 1.45rem;
    }

    .auth-topbar__badge {
        display: none;
    }
}

/* ── Animations ── */

@keyframes authFadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes authFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes authGlowDrift {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(-3%, 4%) scale(1.07);
    }
}

@keyframes authLineShine {
    0%, 100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.auth-animate {
    opacity: 0;
    animation: authFadeUp 0.8s var(--auth-ease) forwards;
}

.auth-animate--d1 { animation-delay: 0.08s; }
.auth-animate--d2 { animation-delay: 0.16s; }
.auth-animate--d3 { animation-delay: 0.24s; }
.auth-animate--d4 { animation-delay: 0.32s; }
.auth-animate--d5 { animation-delay: 0.4s; }
.auth-animate--d6 { animation-delay: 0.48s; }
.auth-animate--d7 { animation-delay: 0.56s; }
.auth-animate--d8 { animation-delay: 0.64s; }

.auth-aside__logo.auth-animate {
    animation-name: authFadeIn;
}

@media (prefers-reduced-motion: reduce) {
    .auth-animate {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }

    .auth-bg__glow::before,
    .auth-bg__glow::after,
    .auth-card::before {
        animation: none !important;
    }

    .auth-back:hover,
    .auth-features li:hover,
    .auth-input:focus,
    .auth-submit:hover,
    .auth-card:hover {
        transform: none;
    }
}
