/* ============================================
   PROGRAMA PARA GRUPOS - ESTILOS ESPECÍFICOS
   Minimalista, moderno, mobile-first
   ============================================ */

.inicio-aviso-publico {
    max-width: 40rem;
    margin: 0 auto 1.5rem;
    padding: 0.9rem 1.1rem;
    border-radius: 12px;
    border: 1px solid rgba(140, 0, 60, 0.28);
    background: rgba(140, 0, 60, 0.06);
    text-align: left;
    font-size: 0.95rem;
    line-height: 1.5;
}
.inicio-aviso-publico a {
    color: var(--kv-morado-medio, #8c003c);
    font-weight: 600;
}

/* Variables CSS (fallback si no están en styles.css) */
:root {
    --kv-morado-oscuro-1: #500028;
    --kv-morado-medio: #8c003c;
}

/* Asegurar que los botones se vean correctamente */
button.btn-primary,
a.btn-primary,
button.btn-secondary,
a.btn-secondary {
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.grupos-page,
.ruta-page {
    min-height: 100vh;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    /* Espacio para navbar fija del sitio */
    padding-top: 4.75rem;
}

/* ============================================
   BARRA DE PROGRESO
   ============================================ */

.progress-bar-container {
    position: sticky;
    top: 4.75rem;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1.5rem 1rem 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 900px;
    margin: 0 auto;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
    position: relative;
    min-width: 60px;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid #e0e0e0;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
    position: relative;
    z-index: 2;
    overflow: hidden;
}

.step-power-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 0%;
    background: linear-gradient(180deg, var(--kv-morado-medio) 0%, var(--kv-morado-oscuro-1) 100%);
    transition: width 0.6s ease, height 0.6s ease;
    border-radius: 50%;
}

.step-circle::after {
    content: '';
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--kv-morado-oscuro-1);
    transition: all 0.4s ease;
    position: absolute;
    z-index: 1;
}

.progress-step.active .step-circle {
    border-color: var(--kv-morado-oscuro-1);
    box-shadow: 0 0 0 4px rgba(80, 0, 40, 0.1);
    animation: pulseActive 2s infinite;
}

@keyframes pulseActive {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.progress-step.active .step-circle::after {
    width: 12px;
    height: 12px;
    background: #ffffff;
}

.progress-step.active .step-power-fill {
    width: 50%;
    height: 50%;
}

.progress-step.completed .step-circle {
    border-color: var(--kv-morado-oscuro-1);
    background: var(--kv-morado-oscuro-1);
    animation: celebrateComplete 0.6s ease;
}

@keyframes celebrateComplete {
    0% { transform: scale(1); }
    50% { transform: scale(1.2) rotate(5deg); }
    100% { transform: scale(1); }
}

.progress-step.completed .step-circle::after {
    content: '✓';
    width: 100%;
    height: 100%;
    color: #ffffff;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.progress-step.completed .step-power-fill {
    width: 100%;
    height: 100%;
}

/* Confeti CSS puro */
#confeti-container-grupos {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confeti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #500028;
    top: -10px;
    animation: confetiFall linear forwards;
    border-radius: 2px;
}

@keyframes confetiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Banner de disponibilidad */
.disponibilidad-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #28a745;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    animation: slideInDown 0.5s ease;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.disponibilidad-icon {
    font-size: 1.5rem;
}

.disponibilidad-texto {
    font-size: 1rem;
    color: #28a745;
    font-weight: 600;
}

.disponibilidad-texto strong {
    font-size: 1.2rem;
    color: var(--kv-morado-oscuro-1);
}

/* Grid para aprovechar ancho horizontal */
.step-content-grid {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.form-grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.radio-group-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.step-info-small {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
    font-style: italic;
}

.step-label {
    font-size: 0.75rem;
    color: #999;
    text-align: center;
    transition: color 0.3s ease;
}

.progress-step.active .step-label {
    color: var(--kv-morado-oscuro-1);
    font-weight: 600;
}

.progress-step.completed .step-label {
    color: var(--kv-morado-oscuro-1);
}

.progress-line {
    flex: 1;
    height: 4px;
    background: #e0e0e0;
    margin: 0 0.5rem;
    position: relative;
    top: -20px;
    border-radius: 2px;
    overflow: hidden;
    transition: background 0.4s ease;
}

.progress-line-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--kv-morado-medio) 0%, var(--kv-morado-oscuro-1) 100%);
    transition: width 0.6s ease;
    border-radius: 2px;
}

.progress-line.completed {
    background: #e0e0e0;
}

.progress-line.completed .progress-line-fill {
    width: 100%;
}

/* Barra de poder general */
.progress-power-bar {
    width: 100%;
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    margin-top: 1rem;
    overflow: hidden;
    position: relative;
}

.progress-power-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ffc107 0%, #ff9800 50%, var(--kv-morado-medio) 100%);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 3px;
    position: relative;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
}

.progress-power-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ============================================
   CONTENEDOR PRINCIPAL
   ============================================ */

.grupos-container,
.ruta-container {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1rem;
    min-height: calc(100vh - 120px);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.step {
    display: none;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeInUp 0.5s ease-out;
    box-sizing: border-box;
    padding: 0 1rem;
}

/* Paso 2 (Fechas): calendario usa todo el ancho, contenido en columna */
#step-2 .step-content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    padding-bottom: 3rem;
    max-width: 100%;
}
#step-2 .step-title,
#step-2 .step-subtitle {
    text-align: center;
}
#step-2 .step-subtitle {
    margin-bottom: 1.5rem;
}
#step-2 {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Bloque fijo debajo del calendario: fechas + nota + botón (nunca detrás del calendario) */
.step-2-actions {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 0;
    padding-top: 1.5rem;
    flex-shrink: 0;
}

.step.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-content {
    text-align: center;
    padding: 2rem 0;
}

.step-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    animation: scaleIn 0.5s ease-out;
}

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

.step-title {
    font-family: 'Ethnocentric', sans-serif;
    font-size: 2.5rem;
    color: var(--kv-morado-oscuro-1);
    margin-bottom: 1rem;
    font-weight: normal;
    line-height: 1.2;
}

.step-subtitle {
    font-size: 1.25rem;
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    font-weight: 300;
}

.step-info {
    font-size: 1rem;
    color: #999;
    margin-bottom: 2rem;
    line-height: 1.6;
    font-style: italic;
}

/* ============================================
   BOTONES
   ============================================ */

.btn-primary {
    background: var(--kv-morado-oscuro-1, #500028);
    color: #ffffff !important;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
    min-height: 56px;
    min-width: 200px;
    text-align: center;
    box-sizing: border-box;
}

.btn-primary:hover:not(:disabled) {
    background: var(--kv-morado-medio, #8c003c) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(80, 0, 40, 0.3);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-secondary {
    background: #ffffff !important;
    color: var(--kv-morado-oscuro-1, #500028) !important;
    border: 2px solid var(--kv-morado-oscuro-1, #500028) !important;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    min-height: 56px;
    text-align: center;
    box-sizing: border-box;
}

.btn-secondary:hover {
    background: var(--kv-morado-oscuro-1, #500028) !important;
    color: #ffffff !important;
    transform: translateY(-2px);
}

.btn-enviar-whatsapp {
    background: #25D366;
    margin-top: 1rem;
}

.btn-enviar-whatsapp:hover {
    background: #20ba5a;
}

/* ============================================
   FORMULARIOS
   ============================================ */

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--kv-morado-oscuro-1);
    font-weight: 600;
    font-size: 1rem;
}

.form-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.form-input:focus {
    outline: none;
    border-color: var(--kv-morado-oscuro-1);
    box-shadow: 0 0 0 3px rgba(80, 0, 40, 0.1);
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 1rem;
    background: #f8f8f8;
    border-radius: 10px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.radio-label:hover {
    background: rgba(80, 0, 40, 0.05);
    border-color: rgba(80, 0, 40, 0.2);
}

.radio-label input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.radio-label input[type="radio"]:checked + span {
    color: var(--kv-morado-oscuro-1);
    font-weight: 600;
}

.radio-label:has(input[type="radio"]:checked) {
    background: rgba(80, 0, 40, 0.1);
    border-color: var(--kv-morado-oscuro-1);
}

.radio-label span {
    color: #666;
    line-height: 1.6;
}

/* ============================================
   CARDS DE MODALIDAD
   ============================================ */

.modalidad-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

.modalidad-card {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.modalidad-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--kv-morado-oscuro-1);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.modalidad-card:hover {
    border-color: var(--kv-morado-oscuro-1);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(80, 0, 40, 0.15);
}

.modalidad-card:hover::before {
    transform: scaleX(1);
}

.modalidad-card.selected {
    border-color: var(--kv-morado-oscuro-1);
    background: rgba(80, 0, 40, 0.05);
    box-shadow: 0 8px 24px rgba(80, 0, 40, 0.2);
}

.modalidad-card.selected::before {
    transform: scaleX(1);
}

.modalidad-card.selected .card-icon {
    transform: scale(1.1);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.card-title {
    font-family: 'Ethnocentric', sans-serif;
    font-size: 1.5rem;
    color: var(--kv-morado-oscuro-1);
    margin-bottom: 0.75rem;
    font-weight: normal;
}

.card-description {
    font-size: 1rem;
    color: #666;
    line-height: 1.6;
    font-weight: 300;
}

/* Calendario: estilos en ../assets/css/calendario-unificado.css */

.step-content-calendario {
    max-width: 100%;
    width: 100%;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .step-content-calendario {
        padding: 0 1.5rem;
    }
}

@media (min-width: 1024px) {
    .step-content-calendario {
        padding: 0 2.5rem;
    }
}

@media (min-width: 1400px) {
    .step-content-calendario {
        padding: 0 3rem;
    }
}

/* Bloque "dos opciones" en paso Fechas: explicación clara para grupos */
.calendario-dos-opciones {
    background: #f8f8f8;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.calendario-opcion {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.calendario-opcion:last-of-type {
    margin-bottom: 0;
}

.calendario-opcion-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--kv-morado-oscuro-1, #500028);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 50%;
    line-height: 1;
}

.calendario-opcion-texto {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #333;
}

.calendario-opcion-texto strong {
    color: var(--kv-morado-oscuro-1, #500028);
    display: block;
    margin-bottom: 0.2rem;
}

.calendario-opcion-texto em {
    font-style: normal;
    font-weight: 600;
    color: #555;
}

.calendario-opcion-resumen {
    margin: 1rem 0 0;
    padding-top: 1rem;
    border-top: 1px dashed #ddd;
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

.calendario-opcion-resumen strong {
    color: #333;
}

@media (max-width: 600px) {
    .calendario-dos-opciones {
        padding: 1rem;
    }
    .calendario-opcion-num {
        width: 24px;
        height: 24px;
        font-size: 0.9rem;
    }
    .calendario-opcion-texto {
        font-size: 0.9rem;
    }
}

.obra-card-match {
    font-weight: 600;
    color: var(--kv-morado-oscuro-1);
}

.btn-elegir-obra {
    width: 100%;
    margin-top: 4px;
    padding: 4px 6px;
    font-size: 0.65rem;
    background: var(--kv-morado-oscuro-1);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-elegir-obra:hover {
    opacity: 0.9;
}

.fechas-seleccionadas {
    background: #f8f8f8;
    border-radius: 15px;
    padding: 1.5rem;
    margin: 2rem 0;
    border: 1px solid #e8e8e8;
    clear: both;
}

.fechas-seleccionadas h4 {
    color: var(--kv-morado-oscuro-1);
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
}

.fechas-list-container {
    min-height: 60px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sin-fechas {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

.fecha-seleccionada-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: #ffffff;
    padding: 1rem;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
    flex-shrink: 0;
    min-height: 0;
}

.fecha-seleccionada-item:last-child {
    margin-bottom: 0;
}

.fecha-seleccionada-item:hover {
    border-color: var(--kv-morado-oscuro-1);
    box-shadow: 0 4px 12px rgba(80, 0, 40, 0.1);
}

.fecha-fecha {
    flex: 1;
    min-width: 0;
    color: #666;
    font-weight: 500;
}

.fecha-horario {
    background: var(--kv-morado-oscuro-1);
    color: #ffffff;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 1rem;
}

.btn-remove-fecha {
    background: #ff4444;
    color: #ffffff;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.btn-remove-fecha:hover {
    background: #cc0000;
    transform: scale(1.1);
}

.nota-importante {
    background: rgba(255, 193, 7, 0.1);
    border-left: 4px solid #ffc107;
    border-radius: 8px;
    padding: 1.25rem;
    margin: 2rem 0;
    text-align: left;
}

.nota-importante strong {
    color: #f57c00;
    display: block;
    margin-bottom: 0.5rem;
}

.nota-importante p {
    color: #666;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ============================================
   RESUMEN DE POSTULACIÓN
   ============================================ */

.resumen-postulacion {
    background: #f8f8f8;
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: left;
}

.resumen-item {
    padding: 1rem 0;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.resumen-item:last-child {
    border-bottom: none;
}

.resumen-item strong {
    color: var(--kv-morado-oscuro-1);
    font-size: 1rem;
}

.resumen-item span {
    color: #666;
    font-size: 1.1rem;
}

.resumen-fechas {
    margin-top: 0.5rem;
}

.resumen-fecha-item {
    background: #ffffff;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    color: #666;
    border-left: 4px solid var(--kv-morado-oscuro-1);
}

.nota-envio {
    background: rgba(80, 0, 40, 0.1);
    border-left: 4px solid var(--kv-morado-oscuro-1);
    border-radius: 8px;
    padding: 1.25rem;
    margin: 2rem 0;
    text-align: left;
}

.nota-envio p {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
}

.mensaje-envio-estado {
    margin: 1rem 0 0;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    min-height: 1.2em;
}
.mensaje-envio-estado:empty { display: none; }
.mensaje-envio-proceso { background: rgba(80, 0, 40, 0.12); color: var(--kv-morado-oscuro-1); }
.mensaje-envio-ok { background: rgba(37, 211, 102, 0.2); color: #0d5c2e; }
.mensaje-envio-error { background: rgba(233, 69, 96, 0.15); color: #b71c1c; }

.step-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.progress-step.clickable {
    transition: all 0.3s ease;
}

.progress-step.clickable:hover {
    transform: scale(1.05);
}

.progress-step.clickable:hover .step-circle {
    box-shadow: 0 4px 12px rgba(80, 0, 40, 0.3);
}

/* ============================================
   FEEDBACK VISUAL - MICRO ANIMACIONES
   ============================================ */

.step-completed-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--kv-morado-oscuro-1);
    color: #ffffff;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    animation: feedbackPop 0.6s ease-out;
}

@keyframes feedbackPop {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* ============================================
   RESPONSIVE - MOBILE FIRST
   ============================================ */

@media (max-width: 768px) {
    .progress-bar {
        gap: 0.2rem;
    }
    
    .step-label {
        font-size: 0.6rem;
    }
    
    .step-circle {
        width: 30px;
        height: 30px;
    }
    
    .step-title {
        font-size: 2rem;
    }
    
    .step-subtitle {
        font-size: 1.1rem;
    }
    
    .form-grid-2col {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .radio-group-grid {
        grid-template-columns: 1fr;
    }
    
    .modalidad-cards {
        grid-template-columns: 1fr;
    }
    
    .modalidad-card {
        padding: 1.5rem;
    }
    
    .card-title {
        font-size: 1.25rem;
    }
    
    .fecha-seleccionada-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .fecha-horario {
        margin: 0;
    }
    
    .step-actions {
        flex-direction: column;
    }
    
    .btn-secondary,
    .btn-primary {
        width: 100%;
        min-width: auto;
        display: block;
    }
}

@media (min-width: 769px) {
    .modalidad-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   POPOVER OBRAS EN CALENDARIO (hover día)
   Responsive, ampliable, legible
   ============================================ */

.obra-popover {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: min(92vw, 420px);
    max-width: 420px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(80, 0, 40, 0.2), 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(140, 0, 60, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: scale(0.92);
    transform-origin: top center;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    pointer-events: none;
}

.obra-popover.obra-popover-visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    pointer-events: auto;
}

.obra-popover-title {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--kv-morado-oscuro-1, #500028);
    background: linear-gradient(to bottom, #fff 85%, rgba(255,255,255,0.98));
    border-bottom: 1px solid #eee;
}

.obra-popover-card {
    padding: 1rem 1.25rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
}

.obra-popover-card:last-child {
    border-bottom: none;
}

.obra-popover-subtitulo {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--kv-morado-oscuro-1, #500028);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.obra-popover-fila {
    font-size: 0.9rem;
    color: #444;
    margin-bottom: 0.4rem;
    line-height: 1.4;
}

.obra-popover-fila strong {
    color: #333;
    margin-right: 0.35rem;
}

.obra-popover-nombre {
    font-size: 1.05rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.obra-popover-sinopsis {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    max-height: 5em;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.obra-popover-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.obra-popover-match {
    font-weight: 600;
    color: var(--kv-morado-medio, #8c003c);
}

.obra-popover-horario {
    color: #666;
}

.btn-elegir-obra-popover {
    width: 100%;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    background: var(--kv-morado-medio, #8c003c);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.02s;
}

.btn-elegir-obra-popover:hover {
    background: var(--kv-morado-oscuro-1, #500028);
}

.btn-elegir-obra-popover:active {
    transform: scale(0.98);
}

.btn-elegir-obra-popover:disabled,
.btn-elegir-obra-popover--disabled {
    background: #bbb;
    color: #fff;
    cursor: not-allowed;
    opacity: 0.8;
}

.obra-popover-aviso {
    font-size: 0.8rem;
    color: #8c003c;
    margin: 0 0 0.5rem 0;
    padding: 0.4rem 0;
    line-height: 1.3;
}

/* Notificación éxito match */
.match-exito-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 10001;
    min-width: min(90vw, 360px);
    max-width: 420px;
    padding: 1.5rem;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #28a745;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(40, 167, 69, 0.35);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s;
    pointer-events: none;
}

.match-exito-notification.match-exito-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.match-exito-content {
    text-align: center;
}

.match-exito-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
}

.match-exito-titulo {
    font-size: 1.35rem;
    font-weight: 700;
    color: #155724;
    margin: 0 0 0.5rem 0;
}

.match-exito-texto {
    font-size: 1rem;
    color: #155724;
    line-height: 1.5;
    margin: 0;
}

/* En pantallas grandes: popover más ancho para leer mejor */
@media (min-width: 600px) {
    .obra-popover {
        width: min(90vw, 440px);
        max-width: 440px;
    }
    .obra-popover-sinopsis {
        max-height: 5.5em;
    }
}

@media (min-width: 900px) {
    .obra-popover {
        width: min(420px, 36vw);
        max-width: 480px;
    }
    .obra-popover-nombre { font-size: 1.1rem; }
    .obra-popover-sinopsis { font-size: 0.95rem; max-height: 7em; }
}

/* Día con obra: indicador visible */
.dia-con-obra {
    cursor: pointer;
}

.dia-tiene-obra {
    flex-shrink: 0;
    font-size: 0.85em;
    line-height: 1;
    display: inline-block;
}
