/* =====================================================================
   AVIP · Autenticación — Acceso institucional
   Estética: azul marino profundo + dorado, superficies limpias.
   ===================================================================== */

* { box-sizing: border-box; }

.avip-auth-body {
    margin: 0;
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
    font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
    color: #1f2a3d;
    background: #06152a;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Fondo ---------- */

.avip-auth-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    background:
        radial-gradient(900px 620px at 82% -10%, rgba(29, 74, 128, 0.9), transparent 58%),
        radial-gradient(720px 600px at -8% 106%, rgba(179, 36, 58, 0.34), transparent 60%),
        radial-gradient(560px 460px at 108% 108%, rgba(203, 161, 53, 0.16), transparent 60%),
        linear-gradient(155deg, #0a1e3a 0%, #0d2646 50%, #06152a 100%);
    z-index: 0;
}

.avip-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(6px);
    opacity: 0.8;
    animation: avipFloat 16s ease-in-out infinite;
}

.avip-orb--gold {
    width: 300px;
    height: 300px;
    top: -80px;
    right: -50px;
    background: radial-gradient(circle at 35% 35%, rgba(203, 161, 53, 0.42), rgba(203, 161, 53, 0) 70%);
    animation-delay: -4s;
}

.avip-orb--red {
    width: 360px;
    height: 360px;
    bottom: -140px;
    left: -100px;
    background: radial-gradient(circle at 40% 40%, rgba(179, 36, 58, 0.36), rgba(179, 36, 58, 0) 70%);
}

.avip-orb--blue {
    width: 260px;
    height: 260px;
    top: 46%;
    right: 14%;
    background: radial-gradient(circle at 50% 50%, rgba(76, 123, 176, 0.34), rgba(76, 123, 176, 0) 72%);
    animation-delay: -9s;
}

@keyframes avipFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-16px); }
}

/* ---------- Escenario ---------- */

.avip-auth-stage {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.35rem;
    padding: 2.5rem 1rem;
}

.avip-card {
    width: 100%;
    max-width: 1000px;
    min-width: 0;
    background: #ffffff;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 42px 84px -40px rgba(3, 12, 30, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.07);
    animation: avipRise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes avipRise {
    from { opacity: 0; transform: translateY(22px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Tarjetas simples (registro, recuperación, etc.) */
.avip-card:not(:has(.avip-auth)) {
    max-width: 460px;
    border-radius: 20px;
}

.avip-card:not(:has(.avip-auth)) .card-body {
    padding: 2.4rem 2.1rem;
}

.avip-auth {
    display: flex;
    min-width: 0;
    min-height: 580px;
}

/* ---------- Columna lateral ---------- */

.avip-auth__aside {
    position: relative;
    flex: 0 0 46%;
    min-width: 0;
    padding: 2.6rem 2.5rem;
    color: #fff;
    overflow: hidden;
    background:
        radial-gradient(420px 320px at 108% -4%, rgba(29, 74, 128, 0.95), transparent 60%),
        radial-gradient(360px 300px at -12% 112%, rgba(179, 36, 58, 0.4), transparent 62%),
        linear-gradient(160deg, #102e54 0%, #0a1e3a 100%);
    display: flex;
    flex-direction: column;
}

.avip-auth__aside::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.16), transparent);
}

.avip-auth__aside-shine {
    position: absolute;
    top: -70px;
    right: -70px;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(203, 161, 53, 0.22), transparent 68%);
    pointer-events: none;
}

.avip-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    position: relative;
    z-index: 1;
}

.avip-brand__logo {
    height: 52px;
    width: auto;
    max-width: 250px;
    object-fit: contain;
    display: block;
}

/* Marca compacta para pantallas sin columna lateral */
.avip-form-brand {
    display: none;
    margin-bottom: 1.6rem;
}

.avip-form-brand img {
    height: 38px;
    width: auto;
    max-width: 210px;
    object-fit: contain;
}

.avip-auth__aside-body {
    margin-top: auto;
    margin-bottom: auto;
    padding: 2rem 0;
    position: relative;
    z-index: 1;
}

.avip-auth__aside h1 {
    font-size: 2rem;
    line-height: 1.15;
    font-weight: 800;
    margin: 0 0 0.9rem;
    letter-spacing: -0.03em;
    color: #ffffff;
}

.avip-auth__aside h1 span { color: #ddb84d; }

.avip-auth__aside h1::after {
    content: "";
    display: block;
    width: 52px;
    height: 3px;
    margin-top: 1rem;
    border-radius: 3px;
    background: linear-gradient(90deg, #ddb84d, rgba(221, 184, 77, 0.15));
}

.avip-auth__aside p.avip-lead {
    font-size: 0.9rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.76);
    max-width: 32ch;
    margin: 0;
}

.avip-features {
    list-style: none;
    padding: 0;
    margin: 1.9rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.avip-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.84rem;
    color: rgba(255, 255, 255, 0.9);
}

.avip-features li i {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #ddb84d;
}

.avip-auth__aside-foot {
    margin-top: auto;
    padding-top: 2rem;
    position: relative;
    z-index: 1;
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.55);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ---------- Columna principal ---------- */

.avip-auth__main {
    flex: 1;
    min-width: 0;
    padding: 3rem 3rem 2.6rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #ffffff;
}

.avip-auth__main-inner {
    width: 100%;
    max-width: 380px;
    min-width: 0;
    margin: 0 auto;
}

.avip-form-head { margin-bottom: 1.8rem; }

.avip-form-head h2 {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 0 0 0.4rem;
    color: #101a2e;
}

.avip-form-head p {
    color: #6b7688;
    font-size: 0.88rem;
    margin: 0;
}

/* ---------- Campos ---------- */

.avip-field { margin-bottom: 1.1rem; }

.avip-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.42rem;
}

.avip-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #3d4a61;
    margin: 0;
}

.avip-label-row a {
    font-size: 0.76rem;
    font-weight: 600;
    color: #1d4a80;
    text-decoration: none;
}

.avip-label-row a:hover { text-decoration: underline; }

.avip-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.avip-input-wrap > i {
    position: absolute;
    left: 14px;
    font-size: 1.05rem;
    color: #98a2b3;
    pointer-events: none;
    transition: color 0.18s ease;
    z-index: 2;
}

.avip-input {
    width: 100%;
    height: 50px;
    border-radius: 12px;
    border: 1.5px solid #e2e7f1;
    background: #f8fafd;
    padding: 0 0.95rem 0 2.7rem;
    font-size: 0.9rem;
    color: #1f2a3d;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.avip-input::placeholder { color: #6b7688; opacity: 1; }

.avip-input:hover { border-color: #cbd5e6; }

.avip-input:focus {
    outline: none;
    background: #ffffff;
    border-color: #1d4a80;
    box-shadow: 0 0 0 4px rgba(29, 74, 128, 0.14);
}

.avip-input-wrap:focus-within > i { color: #1d4a80; }

.avip-input-wrap .avip-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #98a2b3;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    cursor: pointer;
    transition: color 0.18s ease, background-color 0.18s ease;
    z-index: 3;
}

.avip-input-wrap .avip-toggle:hover {
    color: #1d4a80;
    background: rgba(29, 74, 128, 0.08);
}

.avip-input.is-invalid {
    border-color: #c8102e;
    background: #fff7f7;
}

.avip-error {
    color: #b3243a;
    font-size: 0.76rem;
    margin: 0.4rem 0 0 0.15rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* ---------- Recordarme ---------- */

.avip-remember {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0.35rem 0 1.45rem;
}

.avip-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.82rem;
    color: #5a6678;
    font-weight: 500;
    user-select: none;
}

.avip-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.avip-switch__track {
    width: 40px;
    height: 22px;
    border-radius: 999px;
    background: #d5dbe7;
    position: relative;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.avip-switch__track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
}

.avip-switch input:checked + .avip-switch__track {
    background: linear-gradient(135deg, #163b6b, #2a5d97);
}

.avip-switch input:checked + .avip-switch__track::after {
    transform: translateX(18px);
}

.avip-switch input:focus-visible + .avip-switch__track {
    box-shadow: 0 0 0 3px rgba(29, 74, 128, 0.2);
}

/* ---------- Botón principal ---------- */

.avip-btn {
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #163b6b 0%, #2a5d97 60%, #1d4a80 100%);
    background-size: 160% 160%;
    box-shadow: 0 16px 30px -14px rgba(22, 59, 107, 0.95);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.16s ease, box-shadow 0.2s ease, background-position 0.5s ease;
}

.avip-btn:hover {
    background-position: 100% 0;
    transform: translateY(-1px);
    box-shadow: 0 20px 36px -14px rgba(22, 59, 107, 1);
}

.avip-btn:active { transform: translateY(1px); }

.avip-btn:focus-visible {
    outline: 2px solid #ddb84d;
    outline-offset: 3px;
}

/* ---------- Alertas ---------- */

.avip-alert {
    border-radius: 12px;
    padding: 0.8rem 1rem;
    font-size: 0.83rem;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin-bottom: 1.2rem;
    border: 1px solid transparent;
}

.avip-alert i {
    font-size: 1.1rem;
    line-height: 1.2;
}

.avip-alert--danger {
    background: #fdeceb;
    color: #8f1b2d;
    border-color: #f8d3cd;
}

.avip-alert--success {
    background: #e2f4f0;
    color: #0b6f61;
    border-color: #c2ece2;
}

/* ---------- Pie ---------- */

.avip-auth-footer {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.78rem;
    text-align: center;
    letter-spacing: 0.02em;
}

.avip-auth-footer strong {
    color: rgba(255, 255, 255, 0.88);
    font-weight: 600;
}

/* ---------- Variantes simples (registro / recuperar) ---------- */

.avip-card:not(:has(.avip-auth)) .text-primary { color: #163b6b !important; }

.avip-card:not(:has(.avip-auth)) .form-control {
    height: 48px;
    border-radius: 11px;
}

.avip-card:not(:has(.avip-auth)) .btn-success {
    height: 50px;
    border-radius: 11px;
    font-weight: 700;
}

/* ---------- Responsive ---------- */

@media (max-width: 991.98px) {
    .avip-auth__aside { display: none; }

    .avip-auth { min-height: 0; }

    .avip-auth__main { padding: 2.6rem 1.9rem; }

    .avip-form-brand { display: flex; justify-content: center; }

    .avip-card { max-width: 500px; border-radius: 20px; }
}

/* Pantallas medianas: reducir padding para no apretar el contenido */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .avip-auth__aside { padding: 2.2rem 2rem; }
    .avip-auth__main { padding: 2.4rem 2.2rem 2.2rem; }
    .avip-auth__aside h1 { font-size: 1.7rem; }
    .avip-brand__logo { height: 44px; max-width: 200px; }
}

/* Pantallas bajas: compactar el alto para que no se corte */
@media (min-width: 992px) and (max-height: 760px) {
    .avip-auth { min-height: 0; }
    .avip-auth__aside { padding: 1.8rem 2rem; }
    .avip-auth__aside-body { padding: 1rem 0; }
    .avip-auth__main { padding: 2rem 2.4rem; }
    .avip-auth-stage { padding: 1.5rem 1rem; }
}

@media (max-width: 575.98px) {
    .avip-auth-stage { padding: 1.25rem 0.85rem; }

    .avip-auth__main { padding: 2.1rem 1.4rem; }

    .avip-card { border-radius: 18px; }

    .avip-card:not(:has(.avip-auth)) .card-body { padding: 1.9rem 1.4rem; }
}

/* ---------- Accesibilidad de movimiento ---------- */

@media (prefers-reduced-motion: reduce) {
    .avip-orb,
    .avip-card { animation: none !important; }

    .avip-btn,
    .avip-input,
    .avip-switch__track,
    .avip-switch__track::after { transition: none !important; }
}
