:root {
    --brand-color: #AA0F16;
    --brand-hover: #820b11;
    --text-dark: #111827;
    --text-gray: #6b7280;
    --border-light: #d1d5db;
    --bg-page: #f3f4f6;
}

* {
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-page);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 10px;
}

.joinnus-wrapper {
    display: flex;
    width: 100%;
    max-width: 1000px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    overflow: hidden;
}

.j-left-panel {
    width: 45%;
    background: linear-gradient(135deg, #cc151e 0%, #7c0a0f 100%);
    padding: 30px 40px;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
}

.badge-seguridad {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 20px;
}

.j-left-panel h2 {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
}

.alegrito-img {
    width: 160px;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.2));
}

.badge-bottom {
    background: #ffffff;
    color: var(--brand-color);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    margin-top: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.badge-bottom i { color: #10b981; margin-right: 5px; }

.j-right-panel {
    width: 55%;
    padding: 25px 40px;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.logo-mobile { display: none; }

.j-header { margin-bottom: 15px; }
.j-header h2 { font-size: 22px; font-weight: 800; color: var(--text-dark); margin-bottom: 4px; }
.j-header p { font-size: 13px; color: var(--text-gray); }

.j-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.j-grid-3-7 { display: grid; grid-template-columns: 35% 65%; gap: 10px; margin-bottom: 10px; }

.j-input-box {
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 4px 12px;
    background: #ffffff;
    transition: all 0.2s ease;
    position: relative;
}

.j-input-box:focus-within {
    border-color: var(--brand-color);
    box-shadow: 0 0 0 1px var(--brand-color);
}

.j-input-box label {
    display: block;
    font-size: 11px;
    color: var(--text-gray);
    margin-bottom: 0px;
    font-weight: 500;
}

.j-input-box input, 
.j-input-box select {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: var(--text-dark);
    padding: 2px 0;
    font-weight: 500;
}

.j-input-box input[readonly] { color: var(--text-gray); cursor: not-allowed; }

.j-divider {
    margin: 12px 0 10px 0;
    font-size: 11px;
    font-weight: 700;
    color: var(--brand-color);
    letter-spacing: 0.5px;
}

.ticket-wrapper { border: 1px solid var(--border-light); border-radius: 8px; margin-bottom: 8px; overflow: hidden; }
.ticket-header { background: #f9fafb; padding: 10px 15px; font-size: 13px; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.ticket-header.success { background: #f0fdf4; color: #166534; border-bottom: 1px solid #bbf7d0; }
.ticket-body { padding: 12px; background: #fff; display: none; border-top: 1px solid var(--border-light); }
.ticket-body.active { display: block; }

.loading-text { position: absolute; right: 12px; top: 16px; font-size: 12px; color: var(--brand-color); font-weight: 600; display: none; }

.j-legales { margin-top: 10px; font-size: 12px; color: var(--text-gray); }
.j-legales a { color: var(--brand-color); font-weight: 600; text-decoration: none; cursor: pointer; }
.j-legales a:hover { text-decoration: underline; }

.j-checkbox-row {
    display: flex;
    align-items: flex-start;
    background: #f9fafb;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-light);
}

.j-checkbox-row input { margin-right: 8px; margin-top: 2px; accent-color: var(--brand-color); }
.j-checkbox-row label { font-size: 12px; color: var(--text-dark); cursor: pointer; line-height: 1.3; }

.j-btn-submit {
    width: 100%;
    background: #e5e7eb;
    color: #9ca3af;
    border: none;
    padding: 14px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    margin-top: 12px;
    cursor: not-allowed;
    transition: all 0.3s ease;
}

.j-btn-submit:not(:disabled) {
    background: var(--brand-color);
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(170, 15, 22, 0.25);
}

.j-btn-submit:not(:disabled):hover {
    background: var(--brand-hover);
    transform: translateY(-2px);
}

.position-relative { position: relative; }
.autocomplete-list { position: absolute; top: 100%; left: 0; width: 100%; background: #fff; border: 1px solid var(--border-light); border-radius: 0 0 8px 8px; max-height: 150px; overflow-y: auto; z-index: 9999; list-style: none; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); display: none; }
.autocomplete-list li { padding: 8px 12px; cursor: pointer; font-size: 13px; color: var(--text-dark); border-bottom: 1px solid #f3f4f6; }
.autocomplete-list li:hover { background: #f0fdf4; color: #166534; }

@media (max-width: 768px) {
    .joinnus-wrapper { flex-direction: column; border-radius: 0; }
    .j-left-panel { width: 100%; padding: 25px 20px; }
    .alegrito-img { width: 120px; }
    .j-right-panel { width: 100%; padding: 25px 20px; }
    .logo-mobile { display: block; text-align: center; margin-bottom: 15px; }
    .logo-mobile img { width: 80px; }
    .j-grid-2, .j-grid-3-7 { grid-template-columns: 1fr; gap: 10px; }
}

/* ==========================================================================
   SWEETALERT2 CUSTOM PREMIUM UI
   ========================================================================== */
.custom-swal { border-radius: 16px !important; padding: 2em !important; font-family: 'Inter', sans-serif !important; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important; }
.custom-swal-title { font-weight: 800 !important; color: var(--text-dark) !important; font-size: 22px !important; }
.custom-swal-text { color: var(--text-gray) !important; font-size: 15px !important; line-height: 1.5 !important; }
.custom-swal-btn { background-color: var(--brand-color) !important; border-radius: 50px !important; padding: 12px 30px !important; font-weight: 700 !important; font-size: 15px !important; color: #ffffff !important; box-shadow: 0 4px 12px rgba(170, 15, 22, 0.2) !important; transition: all 0.2s ease !important; cursor: pointer; border: none !important; }
.custom-swal-btn:hover { background-color: var(--brand-hover) !important; transform: translateY(-2px); }
.modern-spinner { width: 45px; height: 45px; border: 4px solid #f3f4f6; border-top: 4px solid var(--brand-color); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 20px auto; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* === BOTÓN FINALIZAR BLANCO CON BORDE ROJO === */
.finalizar-swal-btn {
    background-color: #ffffff !important; 
    color: var(--brand-color) !important; 
    border: 2px solid var(--brand-color) !important; 
    border-radius: 50px !important;
    padding: 10px 30px !important; 
    font-weight: 700 !important;
    font-size: 15px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.2s ease !important;
    cursor: pointer;
}
.finalizar-swal-btn:hover {
    background-color: #fde8e9 !important; 
    transform: translateY(-2px);
}

/* ==========================================================================
   RESTAURAR FORMATO DE TEXTO EN TÉRMINOS Y CONDICIONES
   ========================================================================== */
.formato-legales p { margin-bottom: 12px; line-height: 1.6; }
.formato-legales h1, .formato-legales h2, .formato-legales h3, .formato-legales h4 { margin-top: 18px; margin-bottom: 10px; font-weight: 700; color: var(--brand-color); }
.formato-legales ul, .formato-legales ol { margin-left: 20px; margin-bottom: 12px; }
.formato-legales li { margin-bottom: 6px; line-height: 1.5; }
.formato-legales strong, .formato-legales b { font-weight: 700; }

/* ==========================================================================
   ESTILOS DE VALIDACIÓN EN TIEMPO REAL (TIPO JOINNUS)
   ========================================================================== */
.error-msg-ext {
    color: #dc2626; /* Rojo intenso */
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
    margin-left: 4px;
    display: none;
}

.j-input-box.has-error {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.1) !important;
    background-color: #fffafb;
}

.j-input-box.has-error label {
    color: #dc2626 !important;
}