/* ============================================================
   VeriunCore — ACCESO AL PORTAL DE SOPORTE EXTERNO
   ------------------------------------------------------------
   Tarjeta unica centrada, con el mismo lenguaje visual que el
   login principal: fondo degradado, rejilla, particulas y cinta
   en la esquina.

   Hoja independiente a proposito: el portal de soporte no debe
   romperse porque cambie el CSS del login de la aplicacion.

   Se usa solo en soportex.php. El resto del portal (una vez
   dentro) usa soporte_externo.css.
   ============================================================ */

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

:root {
    --accent: #7c3aed;
    --accent2: #06b6d4;
    --accent3: #a855f7;

    --glow: rgba(124, 58, 237, .55);

    --text: #e2e8f0;
    --muted: #94a3b8;

    --surface: rgba(255, 255, 255, .04);
    --border: rgba(255, 255, 255, .08);

    --radius: 24px;
    --card-w: min(460px, 94vw);
}

html,
body {
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

body {
    background:
        linear-gradient(
            135deg,
            #0f0c29 0%,
            #302b63 50%,
            #24243e 100%
        );

    font-family: 'Rajdhani', system-ui, sans-serif;
    color: var(--text);

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

    padding: 32px 16px;
    position: relative;
}


/* ── Rejilla de fondo ── */

body::before {
    content: '';

    position: fixed;
    inset: 0;

    background-image:
        linear-gradient(
            rgba(124, 58, 237, .07) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(124, 58, 237, .07) 1px,
            transparent 1px
        );

    background-size: 60px 60px;

    pointer-events: none;
    z-index: 0;
}


/* ── Particulas ── */

.particles {
    position: fixed;
    inset: 0;

    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.particle {
    position: absolute;
    border-radius: 50%;

    animation: drift linear infinite;
    opacity: 0;
}

@keyframes drift {
    0% {
        transform: translateY(110vh) scale(0);
        opacity: 0;
    }

    10% {
        opacity: .6;
    }

    90% {
        opacity: .4;
    }

    100% {
        transform: translateY(-10vh) scale(1.2);
        opacity: 0;
    }
}


/* ── Cinta de la esquina ── */

.ribbon {
    position: fixed;
    top: 28px;
    right: -36px;

    width: 160px;
    padding: 8px 0;

    background:
        linear-gradient(
            135deg,
            var(--accent),
            var(--accent2)
        );

    color: #fff;

    font-family: 'Orbitron', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 3px;
    text-align: center;
    text-transform: uppercase;

    transform: rotate(45deg);
    box-shadow: 0 4px 20px var(--glow);

    z-index: 100;
}


/* ============================================================
   TARJETA
   ============================================================ */

.scene {
    position: relative;
    z-index: 10;

    width: var(--card-w);

    animation:
        cardIn .9s
        cubic-bezier(.22, 1, .36, 1)
        both;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(40px) scale(.97);
    }

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

.card-face {
    width: 100%;

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

    backdrop-filter: blur(24px);

    box-shadow:
        0 0 0 1px rgba(124, 58, 237, .12),
        0 32px 80px rgba(0, 0, 0, .5),
        inset 0 1px 0 rgba(255, 255, 255, .07);

    padding: 48px 44px 44px;
}


/* ── Logotipo ── */

.logo-wrap {
    display: flex;
    align-items: center;
    gap: 12px;

    margin-bottom: 36px;
}

/*
 * El logotipo es una imagen con su propio fondo, asi que no
 * lleva el degradado ni la sombra que traia la caja pensada
 * para el icono anterior: se veian como un recuadro detras.
 */
img.logo-icon {
    width: 38px;
    height: 38px;

    object-fit: contain;
    object-position: center;

    flex: 0 0 auto;
}

.logo-text {
    font-family: 'Orbitron', monospace;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 3px;

    background:
        linear-gradient(
            90deg,
            #fff,
            var(--accent2)
        );

    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}


/* ── Titular ── */

.headline {
    font-family: 'Orbitron', monospace;
    font-size: clamp(24px, 5vw, 34px);
    font-weight: 900;
    line-height: 1.15;

    margin-bottom: 10px;
}

.headline em {
    font-style: normal;

    background:
        linear-gradient(
            90deg,
            var(--accent3),
            var(--accent2)
        );

    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtext {
    font-size: 15px;
    font-weight: 400;
    color: var(--muted);

    margin-bottom: 32px;
}


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

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

.field-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.field-group label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;

    color: var(--muted);
}

.input-wrap {
    position: relative;

    display: flex;
    align-items: center;
}

.inp-icon {
    position: absolute;
    left: 14px;

    font-size: 14px;
    opacity: .55;

    pointer-events: none;
}

.input-wrap input[type="text"],
.input-wrap input[type="email"] {
    width: 100%;

    padding: 13px 44px 13px 40px;

    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--border);
    border-radius: 12px;

    color: var(--text);

    font-family: 'Rajdhani', sans-serif;
    font-size: 15px;

    outline: none;

    transition:
        border-color .2s,
        box-shadow .2s;
}

.input-wrap input:focus {
    border-color: rgba(124, 58, 237, .6);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .15);
}

.input-wrap input::placeholder {
    color: rgba(148, 163, 184, .4);
}

/*
 * Campo del codigo: seis digitos separados y centrados. Anula el
 * hueco del icono porque el texto va al centro y nunca llega al
 * borde izquierdo.
 */
.code-input {
    padding: 13px 16px !important;

    font-family: 'Orbitron', monospace !important;
    font-size: 20px !important;
    letter-spacing: 8px !important;
    text-align: center;
}

.code-input::placeholder {
    letter-spacing: 4px !important;
}


/* ── Correo ya elegido ── */

.selected-email {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    padding: 14px 18px;

    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.selected-email .email-info {
    min-width: 0;
}

.selected-email .email-info small {
    display: block;

    font-size: 10px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;

    color: var(--muted);
}

.selected-email .email-info strong {
    display: block;

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

    overflow-wrap: anywhere;
}


/* ============================================================
   AVISOS
   ============================================================ */

.alert {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 14px 18px;
    margin-bottom: 6px;

    border-radius: 12px;
    font-size: 14px;
}

.alert.error {
    background: rgba(239, 68, 68, .15);
    border-left: 3px solid #ef4444;
    color: #fca5a5;
}

.alert.success {
    background: rgba(34, 197, 94, .15);
    border-left: 3px solid #22c55e;
    color: #86efac;
}

.alert.debug {
    background: rgba(124, 58, 237, .15);
    border-left: 3px solid var(--accent);
    color: #c4b5fd;

    font-size: 13px;
}

.alert .alert-icon {
    font-size: 16px;
    flex: 0 0 auto;
}


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

.btn {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    width: 100%;
    padding: 14px 24px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;

    color: var(--text);

    font-family: 'Rajdhani', sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none;

    cursor: pointer;
    overflow: hidden;

    transition: all .25s ease;
}

.btn::before {
    content: '';

    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            135deg,
            var(--accent),
            var(--accent2)
        );

    opacity: 0;
    transition: opacity .25s;
}

.btn:hover::before {
    opacity: .15;
}

.btn:hover {
    border-color: rgba(124, 58, 237, .5);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px var(--glow);
}

.btn:active {
    transform: translateY(0);
}

.btn:focus-visible {
    outline: 2px solid var(--accent2);
    outline-offset: 2px;
}

.btn .label,
.btn .icon {
    position: relative;
    z-index: 1;
}

.btn.primary {
    background:
        linear-gradient(
            135deg,
            var(--accent),
            #6d28d9
        );

    border-color: transparent;
    box-shadow: 0 4px 20px var(--glow);
}

.btn.primary::before {
    display: none;
}

.btn.primary:hover {
    background:
        linear-gradient(
            135deg,
            #8b5cf6,
            var(--accent)
        );

    box-shadow: 0 10px 40px var(--glow);
}

.btn.link {
    width: auto;
    padding: 8px 0;

    background: transparent;
    border: none;

    color: var(--muted);

    font-size: 13px;
    letter-spacing: 1px;
}

.btn.link::before {
    display: none;
}

.btn.link:hover {
    color: var(--accent2);
    transform: none;
    box-shadow: none;
}

/* Reenviar codigo: ocupa el ancho de la tarjeta */
.btn.link.full {
    width: 100%;
    justify-content: center;
}


/* ── Separador ── */

.divider {
    display: flex;
    align-items: center;
    gap: 14px;

    margin: 10px 0 0;

    color: var(--muted);
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.divider::before,
.divider::after {
    content: '';

    flex: 1;
    height: 1px;

    background: var(--border);
}


/* ── Pie ── */

.footer {
    display: flex;
    justify-content: center;

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

    border-top: 1px solid var(--border);
}

.footer-text {
    font-family: 'Orbitron', monospace;
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;

    color: rgba(148, 163, 184, .35);
}

.footer-text i {
    margin-right: 6px;
}


/* ============================================================
   PANTALLAS PEQUEÑAS
   ============================================================ */

@media (max-width: 480px) {

    .card-face {
        padding: 36px 24px 32px;
    }

    .headline {
        font-size: 26px;
    }
}


/*
 * Ventana baja: una pantalla de 768px con la barra del navegador
 * deja unos 650px utiles, y el paso del codigo (que ademas puede
 * llevar aviso de error) se pasaba por 89px. Se aprieta el aire,
 * no el contenido.
 */
@media (max-height: 760px) {

    body {
        padding: 14px 16px;
    }

    .card-face {
        padding: 30px 36px 28px;
    }

    .logo-wrap {
        margin-bottom: 20px;
    }

    .subtext {
        margin-bottom: 20px;
    }

    .footer {
        margin-top: 16px;
        padding-top: 12px;
    }
}


/* Movimiento reducido */
@media (prefers-reduced-motion: reduce) {

    .scene {
        animation: none;
    }

    .particle {
        animation: none;
        opacity: 0;
    }

    .btn {
        transition: none;
    }

    .btn:hover {
        transform: none;
    }
}
