/* =========================================================
   CONFIGURACIÓN GENERAL
   ========================================================= */

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;

    background-color: #100d20;
    background-image:
        linear-gradient(
            135deg,
            rgba(13, 10, 30, 0.78),
            rgba(39, 20, 72, 0.48),
            rgba(10, 17, 38, 0.82)
        ),
        url("/build/assets/silver-CkEKnoFD.png");

    background-size: cover;
    background-position: center;
    background-attachment: fixed;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif,
        "Apple Color Emoji",
        "Segoe UI Emoji",
        "Segoe UI Symbol";

    color: #f5f2ff;
    position: relative;
    isolation: isolate;
}

/* =========================================================
   EFECTO DE CAÍDA: PARTÍCULAS LUMINOSAS
   ========================================================= */

body::before {
    content: "";
    position: fixed;
    inset: -100% 0 0;
    z-index: -1;
    pointer-events: none;

    background-image:
        radial-gradient(
            circle,
            rgba(0, 229, 255, 0.85) 0 2px,
            transparent 3px
        ),
        radial-gradient(
            circle,
            rgba(174, 92, 255, 0.8) 0 2px,
            transparent 3px
        ),
        radial-gradient(
            circle,
            rgba(255, 0, 200, 0.65) 0 1.5px,
            transparent 3px
        ),
        radial-gradient(
            circle,
            rgba(255, 255, 255, 0.65) 0 1px,
            transparent 2px
        );

    background-size:
        115px 145px,
        175px 205px,
        225px 185px,
        95px 115px;

    background-position:
        0 0,
        45px 80px,
        90px 30px,
        25px 60px;

    opacity: 0.65;

    animation: auth-particles-fall 18s linear infinite;
}

@keyframes auth-particles-fall {
    from {
        transform: translateY(-5%);
    }

    to {
        transform: translateY(75%);
    }
}

/* =========================================================
   DISTRIBUCIÓN DEL FORMULARIO Y EL ANUNCIO
   El anuncio aparece al lado cuando hay espacio.
   En pantallas pequeñas se coloca debajo.
   ========================================================= */

body:has(.auth-form) {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px 24px;
}

body:has(.auth-form) > .auth-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    width: 100%;
    max-width: 1050px;
    margin: auto;
}

/* =========================================================
   CONTENEDOR PRINCIPAL DEL FORMULARIO
   ========================================================= */

.auth-form {
    position: relative;
    z-index: 1;

    flex: 0 1 420px;
    width: min(calc(100vw - 20px), 420px);
    margin: 20px 0;

    overflow: hidden;

    border: 1px solid rgba(177, 130, 255, 0.55);
    border-radius: 22px;

    background:
        linear-gradient(
            145deg,
            rgba(46, 32, 82, 0.97),
            rgba(24, 19, 47, 0.97) 55%,
            rgba(19, 28, 55, 0.97)
        );

    box-shadow:
        0 0 12px rgba(136, 78, 255, 0.3),
        0 0 30px rgba(87, 56, 200, 0.22),
        0 20px 55px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.09);

    animation: auth-drop-in 0.85s cubic-bezier(0.2, 0.8, 0.2, 1) both;

    transition:
        border-color 0.3s ease,
        box-shadow 0.3s ease;
}

.auth-form:hover {
    border-color: rgba(0, 229, 255, 0.65);

    box-shadow:
        0 0 15px rgba(0, 229, 255, 0.16),
        0 0 35px rgba(143, 75, 255, 0.28),
        0 22px 60px rgba(0, 0, 0, 0.58),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

@keyframes auth-drop-in {
    0% {
        opacity: 0;
        transform: translateY(-65px) scale(0.96);
    }

    70% {
        opacity: 1;
        transform: translateY(8px) scale(1.005);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* =========================================================
   LOGO: UTILIZA /img/logo2.png
   ========================================================= */

.auth-form__branding {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    width: 100%;
    margin: 0;
    padding: 30px 20px 22px;

    color: #ffffff;
    text-decoration: none;

    position: relative;
}

.auth-form__site-logo {
    display: block;

    width: min(100%, 300px);
    height: 105px;

    margin: 0 auto;

    background-image: url("/img/logo2.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;

    font-size: 0;
    line-height: 0;
    color: transparent;

    filter:
        drop-shadow(0 0 7px rgba(139, 92, 246, 0.6))
        drop-shadow(0 0 17px rgba(0, 229, 255, 0.18));

    animation: auth-logo-glow 4s ease-in-out infinite;
}

@keyframes auth-logo-glow {
    0%,
    100% {
        filter:
            drop-shadow(0 0 6px rgba(139, 92, 246, 0.5))
            drop-shadow(0 0 12px rgba(0, 229, 255, 0.12));
    }

    50% {
        filter:
            drop-shadow(0 0 12px rgba(139, 92, 246, 0.8))
            drop-shadow(0 0 22px rgba(0, 229, 255, 0.3));
    }
}

/* =========================================================
   CABECERA: INICIAR SESIÓN / REGISTRO
   ========================================================= */

.auth-form__header {
    display: flex;
    justify-content: space-around;

    padding: 5px 8px 0;

    background: rgba(7, 6, 18, 0.24);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.auth-form__header-item {
    position: relative;

    width: 100%;
    padding: 21px 12px;

    border: none;
    border-radius: 12px 12px 0 0;

    background-color: transparent;
    color: #bcb3d8;

    text-decoration: none;
    text-align: center;
    line-height: 1.3;

    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1ch;

    cursor: pointer;

    transition:
        color 0.25s ease,
        background-color 0.25s ease,
        box-shadow 0.25s ease;
}

.auth-form__header-item:hover {
    background-color: rgba(144, 97, 255, 0.16);
    color: #ffffff;
    box-shadow: inset 0 -2px 0 #00e5ff;
}

.auth-form__header-item:focus-visible {
    outline: 2px solid #00e5ff;
    outline-offset: -3px;
}

/* =========================================================
   FORMULARIO
   ========================================================= */

.auth-form__form {
    display: flex;
    flex-direction: column;
    gap: 18px;

    padding: 30px 28px 34px;
}

/* =========================================================
   ETIQUETAS
   ========================================================= */

.auth-form__label {
    display: block;

    width: 100%;
    margin: 0 0 7px 4px;

    color: #e5ddff;

    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* =========================================================
   GRUPOS DE CAMPOS
   ========================================================= */

.auth-form__text-input-group,
.auth-form__select-group,
.auth-form__textarea-group {
    display: flex;
    flex-direction: column;

    width: 100%;
    min-width: 0;
    margin: 0;
}

/* =========================================================
   CAMPOS DE TEXTO Y SELECTORES
   ========================================================= */

.auth-form__text-input,
.auth-form__select {
    width: 100%;
    height: 44px;

    margin: 3px 0;
    padding: 8px 15px;

    box-sizing: border-box;

    border: 1px solid rgba(180, 154, 255, 0.25);
    border-radius: 12px;

    background-color: rgba(12, 10, 29, 0.7);
    color: #ffffff;

    outline: none;

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

    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        background-color 0.25s ease;
}

.auth-form__text-input::placeholder,
.auth-form__textarea::placeholder {
    color: #9289b2;
    opacity: 1;
}

.auth-form__text-input:focus,
.auth-form__select:focus,
.auth-form__textarea:focus {
    border-color: #00d9ff;
    background-color: rgba(15, 13, 36, 0.95);

    box-shadow:
        0 0 0 3px rgba(0, 217, 255, 0.1),
        0 0 14px rgba(0, 217, 255, 0.15);
}

/* =========================================================
   OPCIONES DE SELECT
   ========================================================= */

.auth-form__select option {
    background-color: #201737;
    color: #ffffff;
}

/* =========================================================
   ÁREA DE TEXTO
   ========================================================= */

.auth-form__textarea {
    width: 100%;
    min-height: 150px;
    height: 300px;

    margin: 3px 0;
    padding: 12px 15px;

    border: 1px solid rgba(180, 154, 255, 0.25);
    border-radius: 12px;

    background-color: rgba(12, 10, 29, 0.7);
    color: #ffffff;

    outline: none;
    resize: vertical;

    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;

    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

/* =========================================================
   BOTÓN PRINCIPAL
   ========================================================= */

.auth-form__button-container {
    display: flex;
    justify-content: space-around;
    gap: 12px;

    width: 100%;
}

.auth-form__primary-button {
    width: 100%;
    min-height: 48px;

    margin-top: 12px;
    padding: 12px 20px;

    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;

    background: linear-gradient(
        110deg,
        #6d35d4,
        #4934a5 55%,
        #2458b9
    );

    color: #ffffff;

    font-size: 14px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;

    box-shadow:
        0 5px 16px rgba(87, 53, 193, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);

    cursor: pointer;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
}

.auth-form__primary-button:hover {
    transform: translateY(-2px);
    filter: brightness(1.13);

    box-shadow:
        0 7px 22px rgba(0, 217, 255, 0.18),
        0 0 18px rgba(124, 58, 237, 0.35);

    cursor: pointer;
}

.auth-form__primary-button:active {
    transform: translateY(0);
}

.auth-form__primary-button:focus-visible {
    outline: 2px solid #00e5ff;
    outline-offset: 3px;
}

/* =========================================================
   BOTONES SECUNDARIOS
   ========================================================= */

.auth-form__button--text {
    padding: 12px 18px;

    border: 1px solid transparent;
    border-radius: 9999px;

    background: transparent;
    color: #d7c9ff;

    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

.auth-form__button--text:hover {
    border-color: rgba(0, 229, 255, 0.25);
    background-color: rgba(167, 130, 255, 0.14);
    color: #ffffff;
}

/* =========================================================
   CHECKBOXES
   ========================================================= */

.auth-form__checkbox-input-group {
    margin: 0;
}

.auth-form__checkbox-input {
    width: 16px;
    height: 16px;

    margin-left: 5px;
    margin-right: 7px;

    accent-color: #8b5cf6;
    vertical-align: middle;
}

.auth-form__checkbox-input + .auth-form__label {
    display: inline;
    width: auto;
    margin-left: 0;

    color: #d7c9ff;
    font-size: 13px;
    font-weight: 500;
}

/* =========================================================
   FIELDSET
   ========================================================= */

.auth-form__fieldset {
    position: relative;

    padding: 48px 16px 16px;

    border: 1px solid rgba(177, 130, 255, 0.25);
    border-radius: 12px;

    background: rgba(12, 10, 29, 0.3);

    box-shadow:
        0 5px 18px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.auth-form__legend {
    position: absolute;
    top: 0;

    width: auto;
    margin: 0;
    padding: 14px 0;

    border: none;

    background: transparent;
    color: #e6d9ff;

    font-size: 16px;
    font-weight: 800;
}

/* =========================================================
   PIE DEL FORMULARIO
   ========================================================= */

.auth-form__footer {
    display: flex;
    flex-direction: column;

    background: rgba(7, 6, 18, 0.22);

    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-form__footer-item {
    padding: 19px 12px;

    border: none;
    background-color: transparent;

    color: #bdb2e2;

    text-decoration: none;
    text-align: center;
    line-height: 1.4;

    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;

    cursor: pointer;

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

.auth-form__footer-item:hover {
    background-color: rgba(144, 97, 255, 0.14);
    color: #ffffff;
}

/* =========================================================
   MENSAJES DE ERROR E INFORMACIÓN
   ========================================================= */

.auth-form__errors {
    list-style-type: none;

    margin: 0;
    padding: 16px 8px;
}

.auth-form__important-infos {
    display: flex;
    flex-direction: column;
    gap: 12px;

    list-style-type: none;

    margin: 0;
    padding: 0 0 20px;
}

.auth-form__error,
.auth-form__important-info {
    color: #f2eaff;

    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
}

.auth-form__error {
    padding: 10px 12px;

    border: 1px solid rgba(255, 74, 117, 0.35);
    border-radius: 10px;

    background: rgba(255, 42, 91, 0.12);
}

.auth-form__important-info {
    padding: 10px 12px;

    border: 1px solid rgba(0, 229, 255, 0.22);
    border-radius: 10px;

    background: rgba(0, 229, 255, 0.06);
}

/* =========================================================
   ANUNCIO DE INVITACIONES
   IMPORTANTE:
   Este bloque estiliza el anuncio cuando está presente
   en el HTML con la clase .auth-invitation-panel.
   ========================================================= */

.auth-invitation-panel {
    position: relative;
    z-index: 1;

    flex: 1 1 360px;
    width: 100%;
    max-width: 460px;
    margin: 20px 0;
    padding: 30px;

    overflow: hidden;

    border: 1px solid rgba(0, 229, 255, 0.4);
    border-radius: 22px;

    background:
        radial-gradient(
            circle at top right,
            rgba(0, 229, 255, 0.12),
            transparent 45%
        ),
        linear-gradient(
            145deg,
            rgba(29, 35, 67, 0.96),
            rgba(25, 18, 51, 0.97) 55%,
            rgba(43, 24, 71, 0.96)
        );

    box-shadow:
        0 0 18px rgba(0, 229, 255, 0.1),
        0 0 35px rgba(139, 92, 246, 0.18),
        0 20px 55px rgba(0, 0, 0, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);

    animation: auth-drop-in 1s cubic-bezier(0.2, 0.8, 0.2, 1) both;

    transition:
        border-color 0.3s ease,
        box-shadow 0.3s ease,
        transform 0.3s ease;
}

.auth-invitation-panel:hover {
    border-color: rgba(174, 92, 255, 0.75);

    box-shadow:
        0 0 20px rgba(0, 229, 255, 0.14),
        0 0 40px rgba(139, 92, 246, 0.24),
        0 22px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);

    transform: translateY(-3px);
}

.auth-invitation-panel__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    margin-bottom: 18px;
    padding: 8px 12px;

    border: 1px solid rgba(0, 229, 255, 0.3);
    border-radius: 999px;

    background: rgba(0, 229, 255, 0.08);
    color: #73efff;

    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-invitation-panel__title {
    margin: 0 0 16px;

    color: #ffffff;

    font-size: clamp(23px, 2.5vw, 30px);
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.auth-invitation-panel__title span {
    display: block;
    margin-top: 5px;

    background: linear-gradient(90deg, #00e5ff, #b78aff, #ff79d8);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.auth-invitation-panel__text {
    margin: 0 0 16px;

    color: #e0d9f7;

    font-size: 14px;
    line-height: 1.8;
}

.auth-invitation-panel__email {
    display: block;

    margin: 18px 0;
    padding: 14px 12px;

    border: 1px solid rgba(174, 92, 255, 0.4);
    border-radius: 12px;

    background: rgba(10, 8, 26, 0.55);
    color: #78efff;

    font-size: 14px;
    font-weight: 800;
    line-height: 1.5;
    text-align: center;

    overflow-wrap: anywhere;
    text-decoration: none;

    transition:
        border-color 0.25s ease,
        background-color 0.25s ease,
        box-shadow 0.25s ease;
}

.auth-invitation-panel__email:hover {
    border-color: #00e5ff;
    background: rgba(0, 229, 255, 0.08);

    box-shadow: 0 0 18px rgba(0, 229, 255, 0.12);

    color: #ffffff;
}

.auth-invitation-panel__warning {
    margin-top: 20px;
    padding: 16px;

    border: 1px solid rgba(255, 89, 135, 0.38);
    border-radius: 14px;

    background:
        linear-gradient(
            135deg,
            rgba(255, 54, 108, 0.13),
            rgba(116, 25, 71, 0.14)
        );

    color: #ffe7ef;

    font-size: 13px;
    line-height: 1.75;
}

.auth-invitation-panel__warning strong {
    display: block;
    margin-bottom: 6px;

    color: #ff9fbd;

    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.auth-invitation-panel__footer {
    margin-top: 20px;
    padding-top: 15px;

    border-top: 1px solid rgba(255, 255, 255, 0.1);

    color: #a99bcf;

    font-size: 11px;
    line-height: 1.6;
    text-align: center;
}

/* =========================================================
   ELEMENTOS ALPINE.JS
   ========================================================= */

[x-cloak] {
    display: none !important;
}

/* =========================================================
   ACCESIBILIDAD: REDUCIR MOVIMIENTO
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    body::before,
    .auth-form,
    .auth-form__site-logo,
    .auth-invitation-panel {
        animation: none !important;
    }

    .auth-form,
    .auth-invitation-panel,
    .auth-form__primary-button,
    .auth-form__button--text,
    .auth-form__header-item,
    .auth-form__footer-item,
    .auth-form__text-input,
    .auth-form__select,
    .auth-form__textarea,
    .auth-invitation-panel__email {
        transition: none !important;
    }
}

/* =========================================================
   DISEÑO PARA TABLETAS Y PANTALLAS PEQUEÑAS
   ========================================================= */

@media (max-width: 850px) {
    body:has(.auth-form) {
        display: block;
        padding: 16px 12px 30px;
    }

    body:has(.auth-form) > .auth-layout {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .auth-form {
        flex: 0 1 auto;
        width: min(100%, 420px);
        margin: 16px auto;
    }

    .auth-invitation-panel {
        flex: 0 1 auto;
        width: min(100%, 420px);
        max-width: 420px;
        margin: 8px auto 20px;
        padding: 24px;
    }

    .auth-invitation-panel__title {
        font-size: 25px;
    }
}

/* =========================================================
   DISEÑO PARA MÓVILES
   ========================================================= */

@media (max-width: 480px) {
    body:has(.auth-form) {
        padding: 8px 8px 24px;
    }

    .auth-form {
        width: 100%;
        margin: 12px auto;
        border-radius: 18px;
    }

    .auth-form__branding {
        padding: 25px 16px 18px;
    }

    .auth-form__site-logo {
        width: min(100%, 260px);
        height: 85px;
    }

    .auth-form__header-item {
        padding: 18px 8px;
        font-size: 12px;
    }

    .auth-form__form {
        gap: 16px;
        padding: 24px 18px 28px;
    }

    .auth-form__primary-button {
        font-size: 13px;
    }

    .auth-form__fieldset {
        padding: 45px 12px 12px;
    }

    .auth-invitation-panel {
        width: 100%;
        margin: 8px auto 16px;
        padding: 22px 18px;
        border-radius: 18px;
    }

    .auth-invitation-panel__title {
        font-size: 23px;
    }

    .auth-invitation-panel__text {
        font-size: 13px;
    }

    .auth-invitation-panel__email {
        font-size: 13px;
    }
}