* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Optimización para móviles - mejorar renderizado */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

:root {
    --primary-color: #e74c3c;
    --primary-dark: #c0392b;
    --primary-light: #ff6b6b;
    --secondary-color: #6c5ce7;
    --accent-color: #fd79a8;
    --text-color: #2d3436;
    --text-light: #636e72;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --border-color: #dfe6e9;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-card: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --bg-gradient-animated: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
}

/* Screen reader only - para accesibilidad SEO */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: #1a237e;
    background-attachment: fixed;
    color: var(--text-color);
    min-height: 100vh;
    padding: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.12) 1.5px, transparent 0);
    background-size: 30px 30px;
    pointer-events: none;
    z-index: 0;
    opacity: 1;
}


/* Optimización para móviles - prevenir zoom en inputs */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px !important; /* Previene zoom automático en iOS */
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    animation: fadeIn 0.6s ease-out;
    width: 100%;
    position: relative;
    z-index: 1;
}

@media (max-width: 1024px) {
    .container {
        max-width: 100%;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header {
    text-align: center;
    color: white;
    margin-bottom: 50px;
    padding: 50px 20px 40px;
    position: relative;
    overflow: hidden;
    z-index: 2;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    header {
        padding: 30px 15px 25px;
        margin-bottom: 30px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 25px 10px 20px;
        margin-bottom: 25px;
    }
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    backdrop-filter: blur(10px);
}


.flag-container {
    display: inline-block;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
    animation: slideDown 0.8s ease-out, flagFloat 3s ease-in-out infinite;
    transform-origin: top center;
}

.flag-spain {
    width: 60px;
    height: 40px;
    display: block;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: flagWave 4s ease-in-out infinite;
    transform-origin: left center;
}

@keyframes flagFloat {
    0%, 100% {
        transform: translateY(0) rotate(-2deg);
    }
    50% {
        transform: translateY(-5px) rotate(2deg);
    }
}

@keyframes flagWave {
    0%, 100% {
        transform: perspective(200px) rotateY(0deg);
    }
    25% {
        transform: perspective(200px) rotateY(5deg);
    }
    50% {
        transform: perspective(200px) rotateY(0deg);
    }
    75% {
        transform: perspective(200px) rotateY(-5deg);
    }
}

@media (max-width: 768px) {
    .flag-spain {
        width: 50px;
        height: 33px;
    }
}

@media (max-width: 480px) {
    .flag-spain {
        width: 45px;
        height: 30px;
    }
}

header h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 15px;
    text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.3);
    font-weight: 800;
    letter-spacing: -0.5px;
    position: relative;
    z-index: 1;
    animation: slideDown 0.8s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.subtitle {
    font-size: clamp(1rem, 2vw, 1.3rem);
    opacity: 0.95;
    font-weight: 400;
    position: relative;
    z-index: 1;
    animation: slideUp 0.8s ease-out 0.2s both;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 0.95;
        transform: translateY(0);
    }
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1.8fr;
    gap: 30px;
    margin-bottom: 40px;
}

/* Cuando solo hay una sección (lista completa) */
.main-content:has(.list-section-full),
.main-content:only-child {
    grid-template-columns: 1fr;
    max-width: 1200px;
    margin: 0 auto 40px;
}

/* Centrar el formulario cuando está solo en la página (sin list-section) */
.main-content:has(.form-section):not(:has(.list-section)) {
    grid-template-columns: 1fr;
    max-width: 700px;
    margin: 0 auto 40px;
}

/* Fallback para navegadores que no soportan :has() */
@supports not selector(:has(*)) {
    .main-content-single {
        grid-template-columns: 1fr;
        max-width: 1200px;
        margin: 0 auto 40px;
    }
}

/* Breakpoint 1024px ya está manejado arriba en la sección responsive */

.form-section,
.list-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 35px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: var(--transition);
    animation: slideIn 0.6s ease-out;
    position: relative;
    z-index: 1;
}

/* Lista completa (cuando ocupa todo el ancho) */
.list-section-full {
    max-width: 100%;
    width: 100%;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.form-section:hover,
.list-section:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.form-section h2,
.list-section h2 {
    color: var(--primary-color);
    margin-bottom: 25px;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-container {
    margin-bottom: 25px;
    position: relative;
}

.search-container::before {
    content: '🔍';
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    z-index: 1;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 15px 20px 15px 50px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--bg-color);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    min-height: 44px;
}

@media (max-width: 480px) {
    .search-input {
        padding: 12px 15px 12px 45px;
        font-size: 16px; /* Previene zoom en iOS */
    }
    
    .search-container::before {
        left: 15px;
        font-size: 1rem;
    }
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1), inset 0 2px 4px rgba(0, 0, 0, 0.05);
    background: white;
}

.search-input::placeholder {
    color: var(--text-light);
}

.contador {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
    white-space: nowrap;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 44px; /* Tamaño mínimo táctil */
}

@media (max-width: 480px) {
    .form-group input,
    .form-group textarea {
        padding: 12px 14px;
        font-size: 16px; /* Previene zoom en iOS */
    }
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1);
    background: white;
    transform: translateY(-1px);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-light);
    opacity: 0.7;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.btn-submit {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    min-height: 48px; /* Tamaño mínimo táctil mejorado */
    touch-action: manipulation; /* Mejora respuesta táctil */
}

@media (max-width: 480px) {
    .btn-submit {
        padding: 14px 20px;
        font-size: 1rem;
        min-height: 44px;
    }
}

.btn-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-submit:hover::before {
    left: 100%;
}

.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.5);
}

.btn-submit:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(231, 76, 60, 0.4);
}

.lista-infieles {
    display: grid;
    gap: 20px;
    max-height: 800px;
    overflow-y: auto;
    padding-right: 5px;
    /* Mejora el scroll en móviles */
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

@media (max-width: 768px) {
    .lista-infieles {
        gap: 15px;
        padding-right: 3px;
    }
}

.lista-infieles::-webkit-scrollbar {
    width: 8px;
}

.lista-infieles::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 10px;
}

.lista-infieles::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.lista-infieles::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.infiel-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 25px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    animation: cardFadeIn 0.5s ease-out;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.infiel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--accent-color) 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.infiel-card:hover::before {
    transform: scaleY(1);
}

.infiel-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.infiel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
    gap: 15px;
    padding-left: 8px;
}

.infiel-nombre {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
    line-height: 1.3;
    letter-spacing: -0.3px;
}

.infiel-redsocial {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.infiel-ciudad {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-top: 5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.infiel-fecha {
    color: var(--text-light);
    font-size: 0.85rem;
    white-space: nowrap;
    background: var(--bg-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
    flex-shrink: 0;
}

.infiel-motivo {
    color: var(--text-color);
    line-height: 1.7;
    margin-top: 15px;
    padding: 18px;
    background: linear-gradient(135deg, var(--bg-color) 0%, #ffffff 100%);
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
    font-size: 0.95rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
}

.contact-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    margin-top: 40px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: slideIn 0.6s ease-out 0.3s both;
    position: relative;
    z-index: 1;
}

.contact-page {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

@media (max-width: 768px) {
    .contact-page {
        max-width: 100%;
    }
}

.header-nav {
    margin-top: 25px;
    position: relative;
    z-index: 1;
}

.nav-link {
    display: inline-block;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    min-height: 44px; /* Tamaño mínimo táctil */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 480px) {
    .nav-link {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.back-link {
    margin-top: 30px;
    text-align: center;
}

.btn-back {
    display: inline-block;
    padding: 12px 24px;
    background: var(--bg-color);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: var(--transition);
    border: 2px solid var(--primary-color);
}

.btn-back:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.contact-section h2 {
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact-subtitle {
    color: var(--text-light);
    margin-bottom: 30px;
    font-size: 1.05rem;
    line-height: 1.6;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

.captcha-group {
    background: var(--bg-color);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.captcha-container {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.captcha-question {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px solid var(--primary-color);
    min-width: 100px;
    text-align: center;
}

.captcha-input {
    flex: 1;
    min-width: 120px;
    max-width: 150px;
}

.btn-refresh-captcha {
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    touch-action: manipulation;
}

.btn-refresh-captcha:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: rotate(180deg);
}

@media (max-width: 480px) {
    .captcha-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .captcha-input {
        max-width: 100%;
    }
}

.loading,
.empty {
    text-align: center;
    padding: 60px 40px;
    color: var(--text-light);
    font-size: 1.1rem;
    background: var(--bg-color);
    border-radius: 12px;
    border: 2px dashed var(--border-color);
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.empty {
    font-style: italic;
    color: var(--text-light);
}

/* ============================================
   RESPONSIVE DESIGN - Mobile First Approach
   ============================================ */

/* Tablets y pantallas medianas (hasta 1024px) */
@media (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding: 0 10px;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

/* Tablets pequeñas y móviles grandes (hasta 768px) */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 0 5px;
    }

    header {
        padding: 30px 15px 25px;
        margin-bottom: 30px;
    }

    header h1 {
        font-size: clamp(1.75rem, 6vw, 2.5rem);
        margin-bottom: 12px;
    }

    .subtitle {
        font-size: clamp(0.9rem, 3vw, 1.1rem);
    }

    .form-section,
    .list-section,
    .contact-section {
        padding: 25px 20px;
        border-radius: 16px;
    }

    .form-section h2,
    .list-section h2 {
        font-size: clamp(1.3rem, 4vw, 1.8rem);
        margin-bottom: 20px;
    }

    .main-content {
        gap: 20px;
        margin-bottom: 30px;
    }

    .infiel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .infiel-fecha {
        margin-top: 10px;
        align-self: flex-start;
        font-size: 0.8rem;
        padding: 5px 10px;
    }

    .infiel-nombre {
        font-size: clamp(1rem, 3vw, 1.3rem);
    }

    .list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .contador {
        align-self: flex-start;
        font-size: 0.85rem;
        padding: 8px 16px;
    }

    .form-row {
        gap: 0;
    }

    .lista-infieles {
        max-height: none;
        gap: 15px;
    }

    .infiel-card {
        padding: 20px;
    }

    .infiel-motivo {
        padding: 15px;
        font-size: 0.9rem;
        margin-top: 12px;
    }

    .captcha-container {
        flex-wrap: wrap;
        gap: 10px;
    }

    .captcha-question {
        font-size: 1rem;
        padding: 8px 12px;
        min-width: 80px;
    }

    .btn-back {
        padding: 12px 20px;
        font-size: 0.95rem;
        min-height: 44px;
    }
}

/* Móviles pequeños (hasta 480px) */
@media (max-width: 480px) {
    body {
        padding: 8px;
    }

    .container {
        padding: 0;
    }

    header {
        padding: 25px 10px 20px;
        margin-bottom: 25px;
    }

    header h1 {
        font-size: clamp(1.5rem, 7vw, 2rem);
        line-height: 1.2;
    }

    .subtitle {
        font-size: clamp(0.85rem, 3.5vw, 1rem);
        line-height: 1.4;
    }

    .form-section,
    .list-section,
    .contact-section {
        padding: 20px 15px;
        border-radius: 14px;
    }

    .form-section h2,
    .list-section h2 {
        font-size: clamp(1.2rem, 5vw, 1.5rem);
        margin-bottom: 18px;
    }

    .form-group {
        margin-bottom: 20px;
    }

    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }

    .search-input {
        padding: 12px 15px 12px 45px;
        font-size: 16px; /* Previene zoom en iOS */
        border-radius: 10px;
    }

    .search-container::before {
        left: 15px;
        font-size: 1rem;
    }

    .infiel-card {
        padding: 18px;
        border-radius: 14px;
    }

    .infiel-nombre {
        font-size: clamp(1rem, 4vw, 1.2rem);
        margin-bottom: 6px;
    }

    .infiel-redsocial,
    .infiel-ciudad {
        font-size: 0.85rem;
    }

    .infiel-motivo {
        padding: 12px;
        font-size: 0.85rem;
        border-radius: 10px;
        margin-top: 10px;
    }

    .btn-submit {
        padding: 14px 20px;
        font-size: 1rem;
        border-radius: 10px;
    }

    .contador {
        font-size: 0.8rem;
        padding: 6px 14px;
    }

    .captcha-container {
        flex-direction: column;
        align-items: stretch;
    }

    .captcha-question {
        width: 100%;
        text-align: center;
    }

    .captcha-input {
        max-width: 100%;
        width: 100%;
    }

    .btn-refresh-captcha {
        width: 100%;
        padding: 12px;
    }

    .nav-link {
        padding: 10px 18px;
        font-size: 0.9rem;
    }

    .btn-back {
        width: 100%;
        padding: 12px 18px;
    }

    .contact-page {
        max-width: 100%;
    }

    .loading,
    .empty {
        padding: 40px 20px;
        font-size: 1rem;
    }
}

/* Móviles muy pequeños (hasta 360px) */
@media (max-width: 360px) {
    body {
        padding: 5px;
    }

    header {
        padding: 20px 8px 15px;
    }

    .form-section,
    .list-section,
    .contact-section {
        padding: 18px 12px;
    }

    .infiel-card {
        padding: 15px;
    }

    .btn-submit {
        padding: 12px 18px;
        font-size: 0.95rem;
    }
}

/* Orientación landscape en móviles */
@media (max-width: 768px) and (orientation: landscape) {
    header {
        padding: 20px 15px 15px;
        margin-bottom: 20px;
    }

    .main-content {
        gap: 15px;
    }

    .lista-infieles {
        max-height: 60vh;
    }
}

/* Mejoras de accesibilidad táctil */
@media (hover: none) and (pointer: coarse) {
    /* Dispositivos táctiles */
    .btn-submit:hover,
    .btn-back:hover,
    .nav-link:hover,
    .btn-refresh-captcha:hover {
        transform: none;
    }

    .btn-submit:active,
    .btn-back:active,
    .nav-link:active,
    .btn-refresh-captcha:active {
        transform: scale(0.98);
        opacity: 0.9;
    }

    .infiel-card:hover {
        transform: none;
    }

    .infiel-card:active {
        transform: scale(0.99);
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: 1600px;
    }

    .main-content {
        grid-template-columns: 1fr 2fr;
    }
}

/* ============================================
   FOOTER - Copyright y Branding
   ============================================ */

.site-footer {
    margin-top: 60px;
    padding: 30px 20px;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(20px);
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    z-index: 2;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.footer-flag {
    display: inline-block;
    margin-bottom: 10px;
    animation: flagFloat 3s ease-in-out infinite;
    transform-origin: top center;
}

.footer-flag .flag-spain {
    width: 50px;
    height: 33px;
    animation: flagWave 4s ease-in-out infinite;
    transform-origin: left center;
}

.footer-brand {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

.footer-copyright {
    font-size: clamp(0.85rem, 2vw, 1rem);
    opacity: 0.9;
    margin: 0;
    font-weight: 400;
}

@media (max-width: 768px) {
    .site-footer {
        margin-top: 40px;
        padding: 25px 15px;
    }

    .footer-flag .flag-spain {
        width: 40px;
        height: 27px;
    }

    .footer-brand {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .footer-copyright {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .site-footer {
        margin-top: 30px;
        padding: 20px 10px;
    }

    .footer-flag .flag-spain {
        width: 35px;
        height: 23px;
    }

    .footer-brand {
        font-size: 0.95rem;
    }

    .footer-copyright {
        font-size: 0.8rem;
        line-height: 1.4;
    }
}

