/* imparables/perfil_styles.css */
/* Versión 5.1 - Final Premium Polish */

:root {
    /* --- COLORES --- */
    --c-primary: #567c8d;
    --c-primary-dark: #3e5a66;
    --c-primary-light: #7a9bad;
    
    --c-secondary: #4a6b7d;
    --c-accent-gold: #d4a574;
    --c-accent-gold-light: #fdf5ec;
    
    --c-success: #52b788;
    --c-error: #ef476f;
    --c-error-bg: #fff0f3;
    
    --c-text-main: #2d3748;
    --c-text-muted: #718096;
    --c-text-light: #a0aec0;
    --c-white: #ffffff;
    
    /* Grises neutros */
    --c-gray-50: #f8fafc;
    --c-gray-100: #f0f7fa;
    --c-gray-200: #e2e8f0;
    --c-gray-300: #edf2f7;

    --c-bg-body: #f7f9fc;
    --c-card-bg: rgba(255, 255, 255, 0.85);
    
    /* --- SOMBRAS --- */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.02), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-md: 0 4px 12px rgba(86, 124, 141, 0.08), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 15px 30px rgba(86, 124, 141, 0.12), 0 5px 15px rgba(0,0,0,0.05);
    
    --radius-md: 16px;
    --radius-lg: 24px;
    
    /* --- FUENTES --- */
    --font-sans: 'Inter', sans-serif;
    --font-display: 'Inter', sans-serif;
    --font-serif: 'Playfair Display', serif;
}
*:focus-visible {
    outline: 2px solid var(--c-primary);
    outline-offset: 3px;
    border-radius: 3px;
}


/* BASE */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body { font-family: var(--font-sans); color: var(--c-text-main); background: var(--c-bg-body); min-height: 100vh; overflow-x: hidden; font-size: 16px; line-height: 1.5; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
img { max-width: 100%; display: block; }

/* FONDO ANIMADO */
.app-background { position: fixed; width: 100%; height: 100%; z-index: -1; top: 0; left: 0; }
.mesh-gradient { width: 150%; height: 150%; position: absolute; top: -25%; left: -25%; background: radial-gradient(at 0% 0%, rgba(86,124,141,0.15), transparent 50%), radial-gradient(at 100% 100%, rgba(212,165,116,0.15), transparent 50%); filter: blur(60px); animation: meshMove 20s ease-in-out infinite alternate; }
.noise-overlay { position: absolute; width: 100%; height: 100%; opacity: 0.4; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E"); mix-blend-mode: overlay; }
@keyframes meshMove { to { transform: translate(-2%, -2%) scale(1.05); } }

/* LAYOUT */

.app-container {
    max-width: 600px; /* Ancho optimizado tipo móvil */
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(20px); /* Efecto vidrio ligero en los bordes */
    box-shadow: 0 0 40px rgba(0,0,0,0.05);
    overflow: hidden;
}
.main-content { padding: 24px; flex: 1; display: flex; flex-direction: column; gap: 32px; }

/* HEADER / HERO - NUEVO DISEÑO */
.profile-hero { text-align: center; padding: 40px 24px 20px; background: linear-gradient(to bottom, rgba(255,255,255,0.9), rgba(255,255,255,0)); }
.brand-logo { max-width: 320px; height: auto; margin: 0 auto 30px; opacity: 1; }
.profile-avatar-wrapper { position: relative; width: 160px; height: 160px; margin: 0 auto 20px; }
.profile-avatar { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 4px solid var(--c-white); box-shadow: var(--shadow-md); position: relative; z-index: 2; }
.avatar-ring { position: absolute; inset: -8px; border-radius: 50%; border: 1px solid var(--c-accent-gold); opacity: 0.3; animation: pulseRing 3s infinite; }
/* Badge BI Mejorado */
.consultant-badge {
    position: absolute;
    bottom: -10px; /* Bajamos un poco más para que no tape la cara */
    left: 50%;
    transform: translateX(-50%); /* Centrado perfecto */
    z-index: 3;
    background: var(--c-primary); /* Color de marca oscuro */
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 1.0rem;
    font-weight: 600;
    border: 3px solid white; /* Borde blanco para separar de la foto */
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.badge-label { opacity: 0.7; font-size: 0.85em; letter-spacing: 0.05em; border-right: 1px solid rgba(255,255,255,0.3); padding-right: 6px; }
.consultant-badge:hover {
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}
.badge-action { opacity: 0; font-size: 0.85em; transition: opacity 0.2s; margin-left: 2px; }
.consultant-badge:hover .badge-action { opacity: 0.8; }

/* NUEVA JERARQUIA DE TEXTO EN HEADER */
.profile-name { font-family: var(--font-serif); font-size: 1.6rem; color: var(--c-text-main); margin-bottom: 4px; font-weight: 700; line-height: 1.2; }
.profile-title-large { font-family: var(--font-display); font-size: 1.3rem; color: var(--c-primary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; margin-bottom: 4px; }
.profile-period { font-size: 1.0rem; color: var(--c-text-muted); font-weight: 500; margin-bottom: 20px; }

/* BOTÓN DE EDITAR INLINE */
.btn-edit-inline {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 24px; background: white; border: 1px solid var(--c-primary-light);
    color: var(--c-primary); border-radius: 20px; font-size: 0.9rem; font-weight: 600;
    transition: 0.2s; box-shadow: var(--shadow-sm);
}
.btn-edit-inline:hover { background: var(--c-primary); color: white; transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* STATS - GRID 2x2 */
.section-header { display: flex; align-items: center; margin-bottom: 16px; }
.section-header h3 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; color: var(--c-primary-dark); display: flex; align-items: center; gap: 8px; }

.stats-grid-2x2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.stat-box {
    background: rgba(255,255,255,0.7); backdrop-filter: blur(10px);
    border-radius: var(--radius-md); padding: 16px;
    border: 1px solid rgba(255,255,255,0.5);
    display: flex; flex-direction: column; justify-content: center;
    box-shadow: var(--shadow-sm); transition: 0.3s;
}
.stat-box:hover { background: white; transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-box.full-width { grid-column: 1 / -1; align-items: center; text-align: center; }
.stat-box.primary-stat { background: linear-gradient(135deg, #ffffff, var(--c-gray-100)); border-color: var(--c-gray-200); }

.stat-label { font-size: 0.875rem; text-transform: uppercase; color: var(--c-text-muted); font-weight: 600; letter-spacing: 0.05em; margin-bottom: 6px; }
.stat-value-group { display: flex; align-items: baseline; gap: 2px; }
.stat-num { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--c-text-main); line-height: 1; }
.stat-num.text-muted { color: var(--c-text-light); }
.stat-num-large { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; color: var(--c-primary); }
.stat-symbol { font-size: 0.9rem; color: var(--c-text-muted); font-weight: 500; }

.mini-bar-container { width: 100%; height: 4px; background: var(--c-gray-300); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.mini-bar { height: 100%; background: var(--c-primary); border-radius: 2px; }

/* INFO CARDS */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.info-card { background: white; padding: 14px; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 12px; cursor: pointer; transition: 0.2s; border: 1px solid transparent; }
.info-card:hover { border-color: var(--c-primary-light); transform: translateY(-2px); }
.info-icon { width: 32px; height: 32px; background: var(--c-bg-body); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1.2em; }
.info-content { flex: 1; overflow: hidden; }
.info-content .label { display: block; font-size: 0.875rem; color: var(--c-text-light); text-transform: uppercase; font-weight: 700; }
.info-content .value { 
    display: block; 
    font-size: 0.85rem; 
    font-weight: 500; 
    color: var(--c-text-main); 
    
    /* --- CORRECCIÓN PARA EMAIL LARGO --- */
    white-space: normal;       /* Permite que el texto use varias líneas */
    word-break: break-word;    /* Rompe la palabra si es demasiado larga para el ancho */
    overflow-wrap: anywhere;   /* Asegura que cadenas largas (como emails) bajen de línea */
    line-height: 1.3;          /* Mejor lectura si ocupa 2 líneas */
}
.info-action { opacity: 0; font-size: 0.9em; transition: 0.2s; }
.info-card:hover .info-action { opacity: 0.6; }

/* CAMPAIGN CARDS */
.campaigns-stack { display: flex; flex-direction: column; gap: 20px; }
.campaign-card { display: block; background: white; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); transition: 0.3s; text-decoration: none; }
.campaign-card:not(.disabled):hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.campaign-card.disabled { filter: grayscale(1); opacity: 0.8; cursor: default; }
.campaign-media { position: relative; height: 160px; background: var(--c-gray-200); }
.campaign-media img { width: 100%; height: 100%; object-fit: cover; }
.media-overlay { position: absolute; bottom: 0; left: 0; width: 100%; height: 60%; background: linear-gradient(to top, rgba(0,0,0,0.6), transparent); }
.campaign-status { position: absolute; top: 12px; right: 12px; padding: 4px 10px; border-radius: 12px; font-size: 0.875rem; font-weight: 700; text-transform: uppercase; backdrop-filter: blur(4px); color: white; }
.status-active { background: rgba(82, 183, 136, 0.9); } .status-void { background: rgba(45, 55, 72, 0.8); }
.campaign-body { padding: 14px 18px; background: white; display: flex; justify-content: space-between; align-items: center; }
.campaign-title { font-size: 0.95rem; font-weight: 600; color: var(--c-text-main); margin: 0; font-family: var(--font-display); }
.campaign-cta { font-size: 0.8rem; font-weight: 600; color: var(--c-primary); }
.quick-links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-top: 8px; }
.quick-link-btn { min-width: 44px; min-height: 44px; background: rgba(255,255,255,0.6); border: 1px solid white; padding: 8px 12px; border-radius: 12px; display: flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 500; color: var(--c-secondary); transition: 0.2s; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.quick-link-btn:hover { background: white; transform: translateY(-2px); color: var(--c-primary); }

/* --- SORTEOS / RIFAS (DISEÑO INTEGRADO AZUL) --- */
.raffles-grid { display: flex; flex-direction: column; gap: 16px; }

.raffle-card-premium {
    /* Mismo estilo base que las otras tarjetas */
    background: white; 
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid transparent; /* Sin borde dorado por defecto */
    transition: 0.3s;
}

/* Header alineado con la marca (Gris suave/Blanco) */
.raffle-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--c-gray-300);
    background: var(--c-gray-50); /* Fondo gris muy suave */
    display: flex; justify-content: space-between; align-items: center;
}

.raffle-card-header h4 { 
    font-size: 0.95rem; 
    font-weight: 700; 
    color: var(--c-primary-dark); /* Azul oscuro de la marca */
    font-family: var(--font-display); 
}

.raffle-date { 
    font-size: 0.75rem; 
    color: var(--c-text-muted); 
    background: white;
    border: 1px solid var(--c-gray-200);
    padding: 4px 10px; 
    border-radius: 20px; 
}

.raffle-card-body { padding: 20px; }

/* Estilos Ganador - AHORA EN AZUL/VERDE (Marca) */
.raffle-card-premium.winner-glow {
    border: 0px solid var(--c-primary-light); /* Borde azul suave */
    box-shadow: 0 0 15px rgba(86, 124, 141, 0.15);
}

.winner-content { text-align: center; animation: popIn 0.5s ease; }

.winner-badge { 
    display: inline-block; 
    background: var(--c-primary); /* Mantenemos dorado solo aquí para destacar éxito */
    color: white; 
    font-weight: bold; 
    font-size: 0.8rem; 
    padding: 6px 16px; 
    border-radius: 20px; 
    margin-bottom: 16px; 
    letter-spacing: 0.05em; 
    box-shadow: 0 4px 10px rgba(212, 165, 116, 0.3); 
}

.prize-detail { 
    background: var(--c-gray-100); /* Fondo Azul muy pálido en lugar de beige */
    border: 1px solid #dbeafe; /* Borde azul sutil */
    padding: 15px; 
    border-radius: 12px; 
    margin-bottom: 10px; 
}

.prize-rank { 
    font-size: 0.875rem;
    color: var(--c-primary); 
    font-weight: 700; 
    text-transform: uppercase; 
    display: block; 
    margin-bottom: 4px; 
}

.prize-desc { 
    font-size: 1rem; 
    font-weight: 700; 
    color: var(--c-primary-dark); 
    margin-bottom: 6px; 
}

.prize-ticket { 
    font-family: monospace; 
    font-size: 0.85rem; 
    color: var(--c-text-muted);
    background: white;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}
.contact-director { font-size: 0.8rem; color: var(--c-text-muted); font-style: italic; margin-top: 10px; }

/* MODAL & FABRIC */
/* Modal Styles */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(45, 55, 72, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: flex-end; /* Mobile bottom sheet style */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-backdrop.active { opacity: 1; pointer-events: auto; }

.modal-panel {
    background: #ffffff;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    border-radius: 24px 24px 0 0;
    padding: 24px;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 40px;
}

@media (min-width: 640px) {
    .modal-backdrop { align-items: center; }
    .modal-panel { border-radius: 24px; transform: translateY(20px) scale(0.95); opacity: 0; }
    .modal-backdrop.active .modal-panel { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-backdrop.active .modal-panel { transform: translateY(0); }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--c-gray-300);
}

.modal-header h3 { font-family: var(--font-display); font-size: 1.4rem; color: var(--c-primary-dark); }
.modal-close { min-width: 44px; min-height: 44px; font-size: 1.8rem; line-height: 1; color: var(--c-text-muted); transition: 0.2s; }
.modal-close:hover { color: var(--c-error); transform: rotate(90deg); }

.modal-scroll-content { overflow-y: auto; padding-right: 4px; margin-bottom: 20px; }

/* Formularios en Modal */
.form-section { margin-bottom: 24px; }
.form-section h4 { font-size: 0.9rem; color: var(--c-text-light); text-transform: uppercase; margin-bottom: 12px; letter-spacing: 0.05em; font-weight: 600; }
.form-section.highlight { background: #fffaf0; padding: 15px; border-radius: 12px; border: 1px solid var(--c-gray-100); }

.modern-form .input-group { position: relative; margin-bottom: 16px; }
.input-row { display: flex; gap: 12px; }
.input-row .input-group { flex: 1; }

.input-field {
    width: 100%;
    padding: 14px 12px;
    border: 2px solid var(--c-gray-200);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: 0.3s;
    background: transparent;
}

.input-field:focus-visible { border-color: var(--c-primary); outline: none; background: white; }
.input-field.locked { background: #f7fafc; border-color: var(--c-gray-300); color: var(--c-text-muted); cursor: not-allowed; }

.input-label {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    padding: 0 4px;
    color: var(--c-text-muted);
    font-size: 1rem;
    pointer-events: none;
    transition: 0.2s ease;
}

/* Floating Label logic */
.input-field:focus + .input-label,
.input-field:not(:placeholder-shown) + .input-label {
    top: 0;
    transform: translateY(-50%) scale(0.85);
    background: white;
    color: var(--c-primary);
    font-weight: 600;
}

/* Custom File Upload */
.file-upload-wrapper { position: relative; }
.file-input { opacity: 0; position: absolute; width: 0.1px; height: 0.1px; }
.file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    color: var(--c-text-muted);
    cursor: pointer;
    transition: 0.2s;
}
.file-label:hover { border-color: var(--c-primary); color: var(--c-primary); background: var(--c-gray-100); }

.btn-primary {
    background: var(--c-primary);
    color: white;
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    transition: 0.3s;
    box-shadow: 0 4px 12px rgba(86, 124, 141, 0.25);
}
.btn-primary:hover { background: var(--c-primary-dark); transform: translateY(-2px); box-shadow: 0 6px 15px rgba(86, 124, 141, 0.35); }
.btn-primary.full-width { width: 100%; }
/* ALERTAS */
.alert-card { display: flex; gap: 12px; padding: 16px; border-radius: 12px; margin-bottom: 24px; box-shadow: var(--shadow-sm); border-left: 4px solid; }
.alert-card.error { background: var(--c-error-bg); border-color: var(--c-error); color: #9b1c1c; }
.alert-card.success { background: #eafef3; border-color: var(--c-success); color: #046c4e; }

/* TOAST */
.toast-container { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 2000; }
.toast { background: rgba(45,55,72,0.9); color: white; padding: 10px 20px; border-radius: 30px; font-size: 0.9rem; margin-top: 10px; opacity: 0; transform: translateY(20px); transition: 0.3s; backdrop-filter: blur(4px); }
.toast.show { opacity: 1; transform: translateY(0); }

/* ANIMACIONES */
@keyframes pulseRing { 0% { transform: scale(0.95); opacity: 0.5; } 100% { transform: scale(1.05); opacity: 0.2; } }
@keyframes popIn { 0% { transform: scale(0.8); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.animate-up { animation: fadeUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.delay-1 { animation-delay: 0.1s; } .delay-2 { animation-delay: 0.2s; } .delay-3 { animation-delay: 0.3s; } .delay-4 { animation-delay: 0.4s; }

/* ADMIN BANNER */
.admin-banner { background: #2d3748; color: white; text-align: center; padding: 8px; font-size: 0.85rem; position: sticky; top: 0; z-index: 1000; }
.admin-badge { font-weight: bold; color: #fbbf24; } .admin-return { color: white; text-decoration: underline; margin-left: 10px; }

/* LOGIN */
.simple-header { text-align: center; padding: 40px 0; } .simple-logo { max-width: 320px; height: auto; margin: 0 auto; }
.auth-card { background: white; padding: 40px 30px; border-radius: 24px; box-shadow: var(--shadow-lg); max-width: 400px; margin: 0 auto; }
.auth-header { text-align: center; margin-bottom: 30px; }
.footer-link { color: var(--c-primary); font-weight: 600; text-decoration: underline; }
.app-footer { text-align: center; padding: 30px 20px; font-size: 0.85rem; color: var(--c-text-muted); margin-top: auto; }

/* MEDIA QUERIES */
@media (min-width: 640px) {
    .app-container { border-radius: 24px; margin: 20px auto; min-height: calc(100vh - 40px); }
    .main-content { padding: 40px; }
    .info-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Botón Editar Inferior */
.bottom-actions {
    margin-top: 20px;
    text-align: center;
    padding-bottom: 10px;
}

.btn-edit-bottom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 30px;
    background: transparent;
    border: 2px solid var(--c-gray-200);
    color: var(--c-text-muted);
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: 0.3s;
    width: 100%; /* Ocupa ancho completo en móvil */
    max-width: 300px;
}

.btn-edit-bottom:hover {
    border-color: var(--c-primary);
    color: var(--c-primary);
    background: white;
    box-shadow: var(--shadow-sm);
}

/* --- Corrección Boletos Asignados (Grid Compacto) --- */

.boletos-container { 
    display: grid; 
    /* Crea columnas automáticas de mínimo 80px de ancho */
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); 
    gap: 8px; 
    margin-top: 12px;
}

.boleto-chip {
    font-family: 'Courier New', monospace; /* Fuente monoespaciada para alinear números */
    font-size: 0.95rem; 
    color: var(--c-text-main);
    background: var(--c-gray-50); /* Fondo gris muy claro */
    border: 1px solid var(--c-gray-200);
    padding: 8px 4px; /* Padding vertical cómodo */
    border-radius: 8px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: default;
    display: flex;
    justify-content: center;
    align-items: center;
}

.boleto-chip:hover {
    border-color: var(--c-primary-light);
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.05);
    color: var(--c-primary);
}

.boleto-chip .hash { 
    color: var(--c-text-light); 
    font-size: 0.8em;
    margin-right: 2px;
    font-weight: normal;
}

.boletos-label { 
    font-size: 0.75rem; 
    text-transform: uppercase; 
    color: var(--c-text-muted); 
    font-weight: 700; 
    margin-bottom: 8px; 
    text-align: center; 
    letter-spacing: 0.05em;
    border-bottom: 1px dashed var(--c-gray-200);
    padding-bottom: 8px;
    display: block; /* Asegura que ocupe el ancho */
}

/* Agrega esto a tus estilos */
.date-select-group {
    display: flex;
    gap: 10px;
}
.date-select {
    padding: 12px;
    border: 1px solid var(--c-gray-200);
    border-radius: 8px;
    background: white;
    font-size: 16px; /* Evita zoom en iPhone */
    color: #2d3748;
    appearance: none; /* Estilo nativo limpio */
    -webkit-appearance: none;
}
.date-select.day { flex: 1; }   /* Ancho flexible pequeño */
.date-select.month { flex: 2; } /* Ancho flexible mediano */
.date-select.year { flex: 1.5;} /* Ancho flexible */

/* imparables/perfil_styles.css (Al final) */

.campaign-media {
    /* Solo definimos que la altura debe animarse suavemente */
    transition: height 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    /* Aseguramos que la imagen siempre cubra el espacio disponible */
    overflow: hidden; 
}

/* ==========================================================================
   WIDGET ACADEMIA - PREMIUM GLASSMORPHISM
   ========================================================================== */

.section-academia {
    margin-bottom: var(--sp-8);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Badge Novedad */
.badge-novedad {
    background: var(--c-error, #ef4444);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    animation: pulseRing 2s ease-in-out infinite;
}

/* Tarjeta de Introducción (Glassmorphism) */
.academia-intro-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
    gap: 15px;
}

.ac-intro-text h4 {
    margin: 0 0 5px 0;
    color: var(--c-primary-dark, #1e293b);
    font-size: 1.1rem;
}

.ac-intro-text p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--c-text-muted);
    line-height: 1.4;
}

.btn-ac-primary {
    background: var(--c-primary);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-ac-primary:hover {
    background: var(--c-primary-dark, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    color: white;
}

/* Contenedor Carrusel Horizontal (Swipeable) */
.academia-swipe-container {
    width: 100%;
    /* Sangría negativa para que el scroll llegue al borde de la pantalla en móviles */
    margin-left: -20px;
    padding-left: 20px;
    padding-right: 20px;
    width: calc(100% + 40px);
}

.ac-swipe-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory; /* Hace que el deslizamiento se ajuste a la tarjeta */
    scroll-behavior: smooth;
    padding-bottom: 24px; /* Espacio para la sombra de las tarjetas */
/* Ocultar scrollbar nativa */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Estilos de la barra de desplazamiento en Chrome/Safari (Solo PC) */
@media (min-width: 640px) {
    .ac-swipe-track::-webkit-scrollbar {
        display: block;
        height: 10px; /* Grosor de la barra */
    }
    .ac-swipe-track::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.4);
        border-radius: 10px;
        margin: 0 20px; /* Que no toque los bordes */
    }
    .ac-swipe-track::-webkit-scrollbar-thumb {
        background-color: var(--c-primary);
        border-radius: 10px;
        border: 2px solid transparent;
        background-clip: padding-box;
    }
}
/* En móviles la ocultamos por completo porque usamos el dedo */
@media (max-width: 639px) {
    .ac-swipe-track::-webkit-scrollbar {
        display: none;
    }
}

/* Tarjetas Individuales de Cursos */
.ac-slide-card {
    flex: 0 0 240px; /* Un poco más estrecha para mostrar continuidad */
    scroll-snap-align: start;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: var(--c-text, #334155);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ac-slide-card:active {
    transform: scale(0.98);
}

.ac-slide-card.locked {
    opacity: 0.85;
}

/* Media / Portada de la tarjeta */
.ac-card-media {
    position: relative;
    width: 100%;
    height: 140px;
    overflow: hidden;
}

.ac-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.ac-slide-card:hover .ac-card-media img {
    transform: scale(1.05);
}

.ac-media-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.3) 0%, transparent 60%);
}

.ac-lock-overlay {
    position: absolute;
    inset: 0;
    background: color-mix(in srgb, var(--c-text-main) 50%, transparent);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
}

/* Cuerpo de la Tarjeta */
.ac-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.ac-title {
    margin: 10px 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--c-text-dark, #0f172a);
    /* Limita el texto a 2 líneas para mantener uniformidad */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ac-desc {
    margin: 0;
    font-size: 0.85rem;
    color: var(--c-text-muted);
}

/* Etiquetas (Tags) */
.ac-tag {
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-new {
    background: rgba(234, 179, 8, 0.15);
    color: #ca8a04;
}

.tag-progress {
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
}

.tag-locked {
    background: rgba(100, 116, 139, 0.15);
    color: #475569;
}

/* Barra de Progreso */
.ac-progress-bar-wrap {
    width: 100%;
    height: 8px;
    background: var(--c-gray-200);
    border-radius: 4px;
    margin-top: auto; /* Empuja la barra al fondo si hay espacio extra */
    overflow: hidden;
}

.ac-progress-fill {
    height: 100%;
    background: var(--c-primary);
    border-radius: 4px;
    transition: width 0.8s ease-out;
}

/* Estado Vacío (Empty State) */
.ac-empty-state {
    text-align: center;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.5);
    border: 2px dashed rgba(203, 213, 225, 0.8);
    border-radius: 16px;
    color: var(--c-text-muted);
    width: 100%;
}

.ac-empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.8;
}

/* ════════════════════════════════════════
   Ajustes Responsivos para Móviles
   ════════════════════════════════════════ */
@media (max-width: 639px) {
    .academia-intro-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
    }
    
    .btn-ac-primary {
        width: 100%;
        text-align: center;
        margin-top: 5px;
    }

    .ac-slide-card {
    flex: 0 0 75vw; /* Esto hace que el 25% de la siguiente tarjeta siempre sea visible */
    max-width: 280px;
    }
    .ac-nav-btn {
    min-width: 44px;
    min-height: 44px;
        display: none;
    }
}

/* ==========================================================================
   FLECHAS DE NAVEGACIÓN - ACADEMIA
   ========================================================================== */
.ac-nav-btn {
    min-width: 44px;
    min-height: 44px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--c-primary) 50%, transparent);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    /* Ocultar por defecto para prevenir que parpadeen en móviles */
    display: none; 
}

.ac-nav-btn:hover {
    background: var(--c-primary-dark, #1d4ed8);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* Posición de cada flecha */
.ac-prev { left: 5px; }
.ac-next { right: 5px; }

/* Solo mostrar las flechas en pantallas de PC / Tablets grandes */
@media (min-width: 640px) {
    .ac-nav-btn {
    min-width: 44px;
    min-height: 44px;
        display: flex;
    }
}

/* ==========================================================================
   MODAL PREMIUM DE CONTENIDO BLOQUEADO (WIDGET ACADEMIA)
   ========================================================================== */
.modal-ac-overlay { 
    position: fixed; inset: 0; 
    background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    z-index: 9999; display: flex; align-items: center; justify-content: center; 
    opacity: 0; pointer-events: none; transition: all 0.3s ease; padding: 20px; 
}
.modal-ac-overlay.active { 
    opacity: 1; pointer-events: auto; 
}
.modal-ac-content { 
    background: rgba(255, 255, 255, 0.95); border: 1px solid rgba(255, 255, 255, 0.5); 
    border-radius: 24px; padding: 40px 30px; text-align: center; max-width: 400px; width: 100%; 
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); 
    transform: translateY(20px) scale(0.95); transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); 
}
.modal-ac-overlay.active .modal-ac-content { 
    transform: translateY(0) scale(1); 
}
.modal-ac-icon { 
    font-size: 3.5rem; margin-bottom: 20px; filter: drop-shadow(0 10px 15px rgba(0,0,0,0.1)); 
    animation: floatLock 3s ease-in-out infinite; 
}
.modal-ac-title { 
    font-family: var(--font-display); font-size: 1.5rem; color: var(--c-primary-dark); 
    font-weight: 800; margin-bottom: 15px; 
}
.modal-ac-text { 
    font-size: 1rem; color: var(--c-text-muted); line-height: 1.6; margin-bottom: 30px; 
}
.modal-ac-btn { 
    background: linear-gradient(135deg, var(--c-accent-gold), #e6b781); color: white; border: none; 
    padding: 14px 28px; border-radius: 30px; font-weight: 700; font-size: 1rem; width: 100%; 
    cursor: pointer; box-shadow: 0 10px 20px rgba(212, 165, 116, 0.3); transition: all 0.3s ease; 
}
.modal-ac-btn:hover { 
    transform: translateY(-3px); box-shadow: 0 15px 25px rgba(212, 165, 116, 0.4); 
}
@keyframes floatLock { 
    0% { transform: translateY(0px); } 
    50% { transform: translateY(-10px); } 
    100% { transform: translateY(0px); } 
}