/* ============================================
   RESET Y ESTILOS BASE
   ============================================ */
   * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* ============================================
   PRIMER MODAL: FORMULARIO DE REGISTRO
   ============================================ */
.modal-overlay {
    display: none;
    /* Oculto por defecto */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 16, 43, 0.9);
    backdrop-filter: blur(10px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-in-out;
}

.modal-overlay.active {
    display: flex;
}

.modal-container {
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.4s ease-out;
}

.modal-content {
    background: #ffffff;
    border-radius: 24px;
    padding: 40px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

/* Logo */
.modal-logo {
    text-align: center;
    margin-bottom: 0px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.modal-logo img {
    width: 200px;
    height: 100px;
    object-fit: contain;
    border-radius: 12px;
    margin: 0 auto;
    display: block;
}

/* Título */
.modal-title {
    font-size: 28px;
    font-weight: 700;
    color: #00102b;
    text-align: center;
    margin-bottom: 32px;
    letter-spacing: -0.5px;
}

/* Formulario */
.registro-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px 32px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-left: 4px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    color: #1f2937;
    background-color: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.3s ease;
    outline: none;
}

.form-group input:focus {
    background-color: #ffffff;
    border-color: #056cf2;
    box-shadow: 0 0 0 4px rgba(255, 212, 45, 0.1);
}

.form-group input::placeholder {
    color: #9ca3af;
}

/* Estilos para campos con error */
.form-group input.error,
.form-group select.error {
    border-color: #ef4444;
    background-color: #fef2f2;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.form-group input.error:focus,
.form-group select.error:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
}

/* Mensajes de error */
.error-message {
    display: none;
    color: #ef4444;
    font-size: 12px;
    font-weight: 500;
    margin-top: 4px;
    margin-left: 4px;
    animation: fadeIn 0.2s ease-in-out;
}

.error-message.show {
    display: block;
}

/* Mostrar mensaje de error cuando el campo tiene la clase error */
.form-group input.error ~ .error-message,
.form-group input.error + .error-message {
    display: block;
}

/* Para el campo de teléfono que está dentro de un wrapper */
.form-group .phone-input-wrapper ~ .error-message {
    display: none;
}

.form-group .phone-input-wrapper input.error ~ .error-message,
.form-group input.error ~ .error-message#error-telefono {
    display: block;
}

/* Wrapper para el input de teléfono */
.phone-input-wrapper {
    display: flex;
    gap: 12px;
}

/* Select de país */
.country-select {
    width: 120px;
    padding: 14px 12px;
    font-size: 15px;
    color: #1f2937;
    background-color: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.3s ease;
    outline: none;
    cursor: pointer;
    appearance: none;
    /* Eliminar flecha por defecto en algunos navegadores */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

.country-select:focus {
    background-color: #ffffff;
    border-color: #056cf2;
    box-shadow: 0 0 0 4px rgba(255, 212, 45, 0.1);
}

/* ============================================
   BOTÓN ANIMADO - ESTILO UNIFICADO
   (Para ambos modales: Registrarme y Entendido)
   ============================================ */
.btn-animado {
    outline: none;
    cursor: pointer;
    border: none;
    padding: 16px 48px;
    margin: 0;
    font-family: inherit;
    font-size: 16px;
    position: relative;
    display: inline-block;
    letter-spacing: 0.05rem;
    font-weight: 700;
    border-radius: 500px;
    overflow: hidden;
    background: #002956;
    color: #002956;
    text-transform: uppercase;
}

/* Botón en el formulario (ancho completo) */
.registro-form .btn-animado {
    width: 100%;
}

.btn-animado span {
    position: relative;
    z-index: 10;
    transition: color 0.4s;
}

.btn-animado:hover span {
    color: #ffffff;
}

.btn-animado::before,
.btn-animado::after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.btn-animado::before {
    content: "";
    background: #ffd700;
    width: 120%;
    left: -10%;
    transform: skew(30deg);
    transition: transform 0.4s cubic-bezier(0.3, 1, 0.8, 1);
}

.btn-animado:hover::before {
    transform: translate3d(100%, 0, 0);
}

.btn-animado:active {
    transform: scale(0.98);
}

/* Estilos para los botones específicos */
.btn-registrarme,
.btn-entendido {
    outline: none;
    cursor: pointer;
    border: none;
    padding: 0;
    margin: 0;
    font-family: inherit;
    font-size: 16px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    letter-spacing: 0.05rem;
    font-weight: 700;
    border-radius: 500px;
    overflow: hidden;
    background: #002956;
    color: #002956; /* Color azul oscuro para el texto base */
    text-transform: uppercase;
    z-index: 1; /* Asegurar que el botón esté por encima de otros elementos */
    isolation: isolate; /* Crear un nuevo stacking context para proteger el botón */
    transition: color 0.4s;
}

/* El texto dentro del span será azul oscuro (visible sobre el fondo dorado) */
.btn-registrarme span,
.btn-entendido span {
    position: relative;
    z-index: 10; /* Por encima del ::before (fondo dorado) */
    transition: color 0.4s;
    color: #002956; /* Color azul oscuro para el texto (se verá sobre el fondo dorado del ::before) */
    display: inline-block; /* Asegurar que el z-index funcione */
}

.btn-registrarme:hover span,
.btn-entendido:hover span {
    color: #ffffff; 
}

.btn-registrarme::before,
.btn-registrarme::after,
.btn-entendido::before,
.btn-entendido::after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.btn-registrarme::before,
.btn-entendido::before {
    content: "";
    background: #ffd700;
    width: 120%;
    left: -10%;
    transform: skew(30deg);
    transition: transform 0.4s cubic-bezier(0.3, 1, 0.8, 1);
}

.btn-registrarme:hover::before,
.btn-entendido:hover::before {
    transform: translate3d(100%, 0, 0);
}

.btn-registrarme:active,
.btn-entendido:active {
    transform: scale(0.98);
}

/* Contenedor del botón centrado */
.form-button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 24px;
}

/* Botón de registro con tamaño específico */
.btn-registrarme {
    width: 365.62px;
    height: 56px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

/* Botón de entendido con tamaño específico */
.btn-entendido {
    width: 150px;
    height: 56px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0 auto;
}

/* Centrar el botón en el formulario */
.form-group-button {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 8px;
}

/* ============================================
   SEGUNDO MODAL: CONFIRMACIÓN CON OVERLAY
   ============================================ */
.overlay-confirmacion {
    display: none;
    /* Oculto por defecto */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 16, 43, 0.9);
    backdrop-filter: blur(10px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.4s ease-in-out;
}

.overlay-confirmacion.active {
    display: flex;
}

.confirmacion-container {
    width: 90%;
    max-width: 500px;
    animation: scaleIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.confirmacion-content {
    background: #ffffff;
    border-radius: 24px;
    padding: 48px 40px;
    text-align: center;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

/* Logo Confirmación */
.confirmacion-logo {
    width: 50%;
    height: auto;
    max-width: 425px;
    margin: 0 auto 24px;
    display: block;
    filter: brightness(0) saturate(100%) invert(27%) sepia(96%) saturate(2476%) hue-rotate(200deg) brightness(95%) contrast(95%);
}

/* Título Confirmación */
.confirmacion-titulo {
    font-size: 32px;
    font-weight: 700;
    color: #00102b;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

/* Mensaje Confirmación */
.confirmacion-mensaje {
    font-size: 25px;
    font-weight: 600;
    color: #00102b;
    margin-bottom: 32px;
    line-height: 1.4;
}

/* ============================================
   ANIMACIONES
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .registro-form {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .form-group:nth-child(1),
    .form-group:nth-child(2),
    .form-group:nth-child(3),
    .form-group:nth-child(4),
    .form-group:nth-child(5),
    .form-group:nth-child(6) {
        grid-column: 1;
    }

    .form-group-empty {
        display: none;
    }

    .btn-animado {
        grid-column: 1;
    }

    .btn-registrarme {
        width: 100%;
        max-width: 365.62px;
    }
}

@media (max-width: 640px) {
    .modal-content {
        padding: 32px 24px;
    }

    .modal-title {
        font-size: 24px;
    }

    .confirmacion-content {
        padding: 40px 28px;
    }

    .confirmacion-titulo {
        font-size: 26px;
    }

    .confirmacion-mensaje {
        font-size: 18px;
    }
}
