* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: url('mundial.webp') no-repeat center center fixed;
    background-size: cover;
}

/* ===== ENCABEZADO AZUL CON MENÚ ===== */
.header {
    background: rgba(23, 36, 218, 0.95);
    backdrop-filter: blur(10px);
    padding: 14px 40px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 100;
}

.header .logo {
    height: 52px;
    width: auto;
    object-fit: contain;
}

.menu-hamburguesa {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 6px;
    border-radius: 8px;
    transition: background 0.2s;
    z-index: 101;
}

.menu-hamburguesa:hover {
    background: rgba(255, 255, 255, 0.15);
}

.menu-hamburguesa span {
    display: block;
    width: 28px;
    height: 3px;
    background: #ffffff;
    border-radius: 4px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.menu-hamburguesa.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.menu-hamburguesa.active span:nth-child(2) {
    opacity: 0;
}

.menu-hamburguesa.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* ===== MENÚ DESPLEGABLE ===== */
.nav-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    width: 260px;
    padding: 20px 0;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transform: scaleY(0);
    transform-origin: top center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-top: 2px solid #e5e7eb;
}

.nav-menu.active {
    transform: scaleY(1);
    opacity: 1;
    visibility: visible;
}

.nav-menu ul {
    list-style: none;
    display: flex;
    flex-direction: column;
}

.nav-menu ul li {
    border-bottom: 1px solid #f3f4f6;
}

.nav-menu ul li:last-child {
    border-bottom: none;
}

.nav-menu ul li a {
    display: block;
    padding: 14px 28px;
    color: #1f2937;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.nav-menu ul li a:hover {
    background: #f3f4f6;
    color: #2563eb;
}

/* ===== CONTENEDOR DEL LOGIN ===== */
.login-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

/* ===== TARJETA DE LOGIN (GLASSMORPHISM) ===== */
.login-card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    padding: 40px 38px 30px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 420px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
}

/* ===== HEADER DE LA TARJETA ===== */
.card-header {
    text-align: center;
    margin-bottom: 28px;
}

.card-header h2 {
    font-size: 30px;
    color: #1a1a2e;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.card-header .subtitle {
    color: #6b7280;
    font-size: 15px;
    margin-top: 4px;
}

/* ===== CAMPOS DEL FORMULARIO ===== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 5px;
}

/* ===== INPUT GROUP ===== */
.input-group {
    display: flex;
    align-items: center;
    background: #f9fafb;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
    overflow: hidden;
}

/* ===== FOCUS SUAVE ===== */
.input-group:focus-within {
    border-color: #7ba3f0;
    box-shadow: 0 0 0 3px rgba(123, 163, 240, 0.15);
    background: #ffffff;
}

/* ===== PREFIJO +52 CON MÁS SEPARACIÓN ===== */
.prefix {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px 12px 16px;  /* ← Aumenté el padding derecho */
    background: #f0f2f5;
    border-right: 2px solid #d1d5db;
    white-space: nowrap;
    min-width: 78px;  /* ← Aumenté el ancho mínimo */
    height: 100%;
    transition: background 0.3s, border-color 0.3s;
}

.input-group:focus-within .prefix {
    background: #eef1f8;
    border-right-color: #7ba3f0;
}

.flag-icon {
    font-size: 20px;
    line-height: 1;
}

.prefix-code {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: 0.5px;
}

/* ===== INPUT DENTRO DEL GRUPO ===== */
.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 0 10px 10px 0;
    font-size: 15px;
    background: transparent;
    outline: none;
    color: #1f2937;
}

.input-group input::placeholder {
    color: #9ca3af;
}

/* ===== INPUT DE CONTRASEÑA CON OJO PROFESIONAL ===== */
.password-group {
    position: relative;
}

.password-group input {
    padding-right: 50px;
}

.toggle-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: background 0.2s, transform 0.2s;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
}

.toggle-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #4b5563;
}

.toggle-btn:active {
    transform: scale(0.9);
}

.eye-icon {
    width: 22px;
    height: 22px;
    transition: stroke 0.2s;
    stroke: #6b7280;
}

.toggle-btn:hover .eye-icon {
    stroke: #4b5563;
}

/* Estado activo (ojo tachado cuando está visible) */
.toggle-btn.active .eye-icon {
    stroke: #4b5563;
}

/* ===== OPCIÓN OLVIDÉ CONTRASEÑA ===== */
.form-options {
    display: flex;
    justify-content: flex-end;
    margin: 16px 0 20px;
    font-size: 14px;
}

.forgot-password {
    color: #1a56db;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.forgot-password:hover {
    color: #143d8a;
    text-decoration: underline;
}

/* ===== BOTÓN AZUL OSCURO ===== */
.btn-azul {
    width: 100%;
    padding: 15px;
    background: #053cb4;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.3s, background 0.3s;
    margin-top: 4px;
    letter-spacing: 0.3px;
}

.btn-azul:hover {
    background: #143d8a;
    box-shadow: 0 6px 24px rgba(26, 86, 219, 0.45);
    transform: translateY(-1px);
}

.btn-azul:active {
    transform: scale(0.97);
}

.btn-azul:disabled {
    background: #93b5f7;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* ===== MENSAJE DE RESPUESTA ===== */
.mensaje {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    display: none;
    text-align: center;
}

.mensaje.exito {
    display: block;
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.mensaje.error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* ===== ENLACE DE REGISTRO ===== */
.registro-link {
    margin-top: 22px;
    text-align: center;
    font-size: 14px;
    color: #6b7280;
}

.registro-link a {
    color: #1a56db;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.registro-link a:hover {
    color: #143d8a;
    text-decoration: underline;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .header {
        padding: 10px 16px;
    }

    .header .logo {
        height: 38px;
    }

    .menu-hamburguesa span {
        width: 24px;
        height: 2.5px;
    }

    .nav-menu {
        width: 100%;
        right: 0;
        border-radius: 0 0 12px 12px;
    }

    .login-card {
        padding: 28px 18px 22px;
        border-radius: 16px;
    }

    .card-header h2 {
        font-size: 24px;
    }

    .btn-azul {
        font-size: 15px;
        padding: 13px;
    }

    .form-options {
        justify-content: center;
    }

    .prefix {
        padding: 10px 14px 10px 12px;  /* ← Ajustado para móvil también */
        min-width: 68px;
        gap: 5px;
    }

    .flag-icon {
        font-size: 17px;
    }

    .prefix-code {
        font-size: 13px;
    }

    .input-group input {
        padding: 10px 14px;
        font-size: 14px;
    }

    .eye-icon {
        width: 19px;
        height: 19px;
    }
}

/* ===== SPINNER AZUL ===== */
.spinner-azul {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.spinner-svg {
    width: 28px;
    height: 28px;
    animation: girar 0.8s linear infinite;
}

.spinner-circle {
    stroke: #ffffff;
    stroke-linecap: round;
    stroke-dasharray: 126;
    stroke-dashoffset: 126;
    animation: spinner-anim 0.8s ease-in-out infinite;
}

@keyframes girar {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes spinner-anim {
    0% {
        stroke-dashoffset: 126;
    }
    50% {
        stroke-dashoffset: 40;
    }
    100% {
        stroke-dashoffset: 126;
    }
}