/* ====================================
   CUSTOM STYLES - Calculadora RFC/CURP
   ==================================== */

/* FORZAR FONDO GRIS - Sobrescribir todos los estilos */
html {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    background-attachment: fixed !important;
}

/* Variables de Diseño - Azul Claro Moderno */
:root {
  /* Colores principales - Azul cielo armonioso */
  --color-primary: #0284c7;      /* Azul cielo brillante */
  --color-primary-dark: #0369a1; /* Azul cielo oscuro */
  --color-primary-light: #38bdf8; /* Azul cielo claro */

  /* Colores secundarios */
  --color-secondary: #64748b;    /* Gris azulado suave */
  --color-accent: #10b981;       /* Verde esmeralda */
  --color-warning: #f59e0b;      /* Ámbar cálido */
  --color-error: #ef4444;        /* Rojo coral */

  /* Neutrales armoniosos */
  --color-dark: #1e293b;         /* Gris oscuro azulado */
  --color-text: #475569;         /* Gris medio para textos */
  --color-text-light: #94a3b8;   /* Gris claro para subtextos */
  --color-border: #e2e8f0;       /* Gris muy claro para bordes */
  --color-bg: #f8fafc;           /* Fondo blanco azulado */
  --color-white: #ffffff;        /* Blanco puro */

  /* Fondo principal con gradiente sutil */
  --main-bg: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);

  /* Sombras sutiles con tinte azul */
  --shadow-sm: 0 1px 2px 0 rgb(2 132 199 / 0.05);
  --shadow-md: 0 2px 8px 0 rgb(2 132 199 / 0.08);
  --shadow-lg: 0 4px 16px 0 rgb(2 132 199 / 0.1);
  --shadow-xl: 0 8px 24px 0 rgb(2 132 199 / 0.12);

  /* Transiciones suaves */
  --transition-base: all 0.2s ease-in-out;
  --transition-slow: all 0.3s ease-in-out;

  /* Tipografía */
  --font-primary: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Poppins', sans-serif;
}

/* Tipografía Profesional */
body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--main-bg) !important;
    background-image: none !important;
    margin: 0;
    padding: 0;
}

/* Header Profesional */
.main-header {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 50%, #0369a1 100%);
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 2px 12px rgba(2, 132, 199, 0.15);
    position: relative;
    z-index: 100;
}

.header-content {
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.header-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    margin: 0;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.header-title i {
    font-size: 1.75rem;
}

.header-subtitle {
    font-size: clamp(0.875rem, 2vw, 1rem);
    margin: 0.5rem 0 0;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-dark);
}

h1 {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
}

h2 {
    font-size: clamp(1.5rem, 3vw, 1.875rem);
}

/* Cards de Formulario - Diseño Formal */
.form-card {
    background: var(--color-white);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    margin: 2rem auto;
    max-width: 600px;
    width: 100%;
    border: 1px solid var(--color-border);
}

.form-card-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 3px solid var(--color-primary);
}

.form-card-header i {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 0.75rem;
    display: block;
    opacity: 0.9;
}

.form-card-header h1 {
    font-size: 1.875rem;
    color: var(--color-dark);
    margin-bottom: 0.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.form-card-header .text-muted {
    color: var(--color-text-light);
    font-size: 0.9375rem;
    font-weight: 400;
}

/* Formulario Profesional */
.form-modern .form-group {
    margin-bottom: 1.5rem;
}

.form-modern .form-label {
    display: block;
    font-weight: 600;
    color: var(--color-dark);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.form-modern .form-label i {
    color: var(--color-primary);
    margin-right: 0.5rem;
    font-size: 0.875rem;
}

.form-control-modern {
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: var(--transition-base);
    width: 100%;
    background-color: var(--color-white);
}

.form-control-modern:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
    outline: none;
    background-color: var(--color-white);
}

.form-control-modern:invalid:not(:placeholder-shown) {
    border-color: var(--color-error);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23ef4444'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23ef4444' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    padding-right: calc(1.5em + 0.75rem);
}

.form-control-modern:valid:not(:placeholder-shown) {
    border-color: var(--color-accent);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2310b981' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    padding-right: calc(1.5em + 0.75rem);
}

.form-text {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.875rem;
    color: var(--color-text-light);
}

/* Selects Profesionales */
.form-select-modern {
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: var(--transition-base);
    background-color: var(--color-white);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%230284c7' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}

.form-select-modern:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
    outline: none;
    background-color: var(--color-white);
}

.form-select-modern:invalid {
    border-color: var(--color-error);
}

.form-select-modern:valid:not([value=""]) {
    border-color: var(--color-accent);
}

/* Botones Profesionales */
.btn-modern {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    transition: var(--transition-base);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
}

.btn-primary.btn-modern {
    background-color: var(--color-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary.btn-modern:hover {
    background-color: var(--color-primary-dark);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.btn-primary.btn-modern:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-primary.btn-modern:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.3);
}

.btn-modern i {
    margin-right: 0.5rem;
}

/* Tabs Profesionales */
.nav-tabs {
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 2rem;
    justify-content: center;
    background-color: var(--color-white);
    border-radius: 8px 8px 0 0;
    padding: 0.5rem 0.5rem 0;
}

.nav-tabs .nav-link {
    color: var(--color-text);
    font-weight: 600;
    padding: 0.875rem 1.75rem;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    transition: var(--transition-base);
    margin-bottom: 0;
    margin-right: 0.25rem;
    background-color: transparent;
    font-size: 0.9375rem;
}

.nav-tabs .nav-link:hover {
    color: var(--color-primary);
    background-color: var(--color-bg);
    border-color: var(--color-border) var(--color-border) transparent;
}

.nav-tabs .nav-link.active {
    color: var(--color-primary);
    background-color: var(--color-white);
    border-color: var(--color-border) var(--color-border) transparent;
    border-bottom: 2px solid var(--color-white);
    margin-bottom: -2px;
}

/* Banner Publicitario Simplificado */
.banner-container {
    margin: 1.5rem 0;
    text-align: center;
    padding: 0.75rem;
    background: var(--color-bg);
    border-radius: 6px;
    border: 1px solid var(--color-border);
    overflow: hidden;
}

.banner-container a {
    display: block;
    width: 100%;
}

.banner-img {
    max-width: 100%;
    width: 100%;
    height: auto;
    border-radius: 4px;
    transition: var(--transition-base);
    display: block;
}

.banner-img:hover {
    opacity: 0.9;
}

/* Asegurar que todas las imágenes sean responsivas */
img {
    max-width: 100%;
    height: auto;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-container {
    text-align: center;
    color: white;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner-container p {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
}

/* Mensajes de Error en Campos */
.field-error {
    color: var(--color-error);
    font-size: 0.875rem;
    margin-top: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.field-error:before {
    content: "⚠";
    font-size: 1rem;
}

.is-invalid {
    border-color: var(--color-error) !important;
    animation: shake 0.3s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Alertas Profesionales */
.alert {
    border: 1px solid;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.alert:before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 1.125rem;
}

.alert-info {
    background-color: #f0f9ff;
    color: #0369a1;
    border-color: #0284c7;
}

.alert-info:before {
    content: "\f05a";
    color: #0284c7;
}

.alert-danger {
    background-color: #fef2f2;
    color: #b91c1c;
    border-color: #ef4444;
}

.alert-danger:before {
    content: "\f06a";
    color: #ef4444;
}

.alert-success {
    background-color: #ecfdf5;
    color: #047857;
    border-color: #10b981;
}

.alert-success:before {
    content: "\f058";
    color: #10b981;
}

/* Fondo Principal Limpio */
.main-content {
    background: transparent;
}

/* Eliminar cualquier video de fondo */
video.bg-video {
    display: none !important;
}

/* Asegurar que no haya imagen de fondo en dispositivos móviles */
@media (pointer: coarse) and (hover: none) {
    html,
    body {
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
        background-image: none !important;
        background-attachment: fixed !important;
    }

    body video {
        display: none !important;
    }
}

/* Indicadores de Campos Requeridos */
.form-required-legend {
    font-size: 0.8125rem;
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
    padding: 0.625rem 0.875rem;
    background: var(--color-bg);
    border-radius: 4px;
    border-left: 3px solid var(--color-primary);
}

.form-required-legend:before {
    content: "*";
    color: var(--color-primary);
    font-weight: 700;
    margin-right: 0.5rem;
}

/* Asterisco en labels de campos required */
input[required] + label:after,
select[required] + label:after,
label:has(+ input[required]):after,
label:has(+ select[required]):after {
    content: " *";
    color: var(--color-error);
    font-weight: 700;
}

/* Skip Link para Accesibilidad */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    font-weight: 600;
    z-index: 10000;
    border-radius: 0 0 4px 0;
}

.skip-link:focus {
    top: 0;
}

/* Footer Profesional */
footer {
    position: fixed;
    bottom: 10px;
    left: 20px;
    z-index: 3;
    color: var(--color-text);
    font-size: 0.8125rem;
    font-weight: 500;
}

footer a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

footer a:hover {
    text-decoration: underline;
}

/* Iconos Sociales */
.social-icons {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
}

.social-icons .btn {
    border: none;
    box-shadow: var(--shadow-md);
}

.social-icons .btn:hover {
    box-shadow: var(--shadow-lg);
}

/* Animaciones Sutiles */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.tab-pane {
    animation: fadeIn 0.2s ease-out;
}

/* SweetAlert2 Profesional */
.swal2-popup {
    border-radius: 12px !important;
    box-shadow: var(--shadow-xl) !important;
    padding: 2rem !important;
    border: 1px solid var(--color-border) !important;
}

.swal2-title {
    font-family: var(--font-heading) !important;
    color: var(--color-dark) !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
}

.swal2-html-container {
    font-family: var(--font-primary) !important;
    color: var(--color-text) !important;
    font-size: 1rem !important;
}

.swal2-confirm {
    background-color: var(--color-primary) !important;
    border-radius: 6px !important;
    padding: 0.75rem 2rem !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    border: none !important;
    box-shadow: var(--shadow-md) !important;
}

.swal2-confirm:hover {
    background-color: var(--color-primary-dark) !important;
    box-shadow: var(--shadow-lg) !important;
}

.swal2-icon.swal2-success,
.swal2-icon.swal2-error {
    border-width: 2px !important;
}

/* Resultados en Modal */
.result-container {
    margin: 1.5rem 0;
}

.result-code {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-primary);
    background: var(--color-bg);
    padding: 1rem 1.25rem;
    border-radius: 6px;
    border: 2px solid var(--color-primary);
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
    letter-spacing: 1.5px;
    text-align: center;
}

.result-description {
    color: var(--color-text);
    margin: 1rem 0;
    line-height: 1.6;
}

.btn-copy {
    background-color: var(--color-accent);
    color: white;
    border: none;
    padding: 0.625rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.btn-copy:hover {
    background-color: #059669;
    box-shadow: var(--shadow-md);
}

.result-footer {
    font-size: 0.875rem;
    color: var(--color-text-light);
    margin-top: 1rem;
}

.result-footer a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.result-footer a:hover {
    text-decoration: underline;
}

/* Ocultar <br> innecesarios */
br {
    display: none;
}

/* ====================================
   RESPONSIVE DESIGN
   ==================================== */

/* Main Content - Contenedor principal sin estilos de masthead */
.main-content {
    width: 100%;
    min-height: calc(100vh - 100px);
    padding: 2rem 0;
    position: relative;
}

.content-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* Contenedor principal - ancho completo */
.container-fluid {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
    overflow-x: hidden;
}

.tab-content {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.tab-content .container {
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
}

/* Prevenir scroll horizontal */
body {
    overflow-x: hidden;
    position: relative;
}

html {
    overflow-x: hidden;
}

/* Tablets medianas y mayores (768px+) */
@media (min-width: 768px) {
    .content-wrapper {
        padding: 0 2rem;
    }

    .form-card {
        padding: 2rem;
        margin: 2rem auto;
    }

    .form-card-header h1 {
        font-size: 2rem;
    }

    .form-card-header i {
        font-size: 3rem;
    }

    .nav-tabs .nav-link {
        min-width: 150px;
        padding: 1rem 2rem;
        font-size: 1rem;
    }

    footer {
        position: fixed;
        bottom: 10px;
        left: 19px;
    }

    .social-icons {
        display: flex !important;
    }
}

/* Desktop (992px+) */
@media (min-width: 992px) {
    .content-wrapper {
        padding: 0 2rem;
    }

    .form-card {
        max-width: 600px;
        padding: 2.5rem;
    }

    .nav-tabs .nav-link {
        padding: 1.25rem 2.5rem;
    }
}

/* Large Desktop (1200px+) */
@media (min-width: 1200px) {
    .form-card {
        max-width: 650px;
    }
}

/* Mobile - Pantallas pequeñas (hasta 767px) */
@media (max-width: 767px) {
    /* Header */
    .main-header {
        padding: 1rem 0;
    }

    .header-title {
        font-size: 1.25rem;
        gap: 0.5rem;
        flex-direction: column;
    }

    .header-title i {
        font-size: 1.5rem;
    }

    .header-subtitle {
        font-size: 0.8125rem;
    }

    /* Body y contenedores principales */
    body {
        font-size: 15px;
    }

    .content-wrapper {
        padding: 0 0.5rem;
    }

    .container-fluid {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* Formulario Card */
    .form-card {
        padding: 1.25rem;
        margin: 1rem 0.5rem;
        border-radius: 12px;
        box-shadow: var(--shadow-lg);
    }

    .form-card-header {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }

    .form-card-header i {
        font-size: 2.5rem;
        margin-bottom: 0.75rem;
    }

    .form-card-header h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .form-card-header .text-muted {
        font-size: 0.9rem;
    }

    /* Navegación por pestañas */
    .nav-tabs {
        margin-bottom: 1.5rem;
        border-bottom: 2px solid var(--color-border);
        gap: 0;
    }

    .nav-tabs .nav-link {
        flex: 1;
        text-align: center;
        min-width: auto;
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
        white-space: nowrap;
    }

    /* Formularios */
    .form-modern .form-group {
        margin-bottom: 1.25rem;
    }

    .form-modern .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.375rem;
    }

    .form-control-modern,
    .form-select-modern {
        padding: 0.625rem 0.875rem;
        font-size: 0.95rem;
    }

    /* Botones */
    .btn-modern {
        font-size: 1rem;
        padding: 0.875rem;
    }

    /* Banner */
    .banner-container {
        margin: 1.5rem 0;
        padding: 0.75rem;
    }

    /* Footer */
    footer {
        position: relative;
        text-align: center;
        left: 0;
        bottom: 0;
        width: 100%;
        padding: 1rem;
        background: var(--color-white);
        margin-top: 2rem;
        font-size: 0.75rem;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
    }

    /* Iconos sociales - Mover arriba derecha en mobile */
    .social-icons {
        position: fixed;
        top: 80px;
        right: 10px;
        z-index: 99;
        transform: none;
    }

    .social-icons .d-flex {
        flex-direction: column !important;
    }

    .social-icons .btn {
        margin: 0.25rem 0 !important;
        padding: 0.5rem 0.625rem;
        font-size: 0.9rem;
    }

    /* Leyenda de campos requeridos */
    .form-required-legend {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
        margin-bottom: 1.25rem;
    }

    /* Alertas */
    .alert {
        font-size: 0.875rem;
        padding: 0.875rem 1rem;
    }

    /* SweetAlert responsive */
    .swal2-popup {
        width: calc(100% - 2rem) !important;
        padding: 1.5rem !important;
    }

    .swal2-title {
        font-size: 1.5rem !important;
    }

    .swal2-html-container {
        font-size: 0.95rem !important;
    }

    .result-code {
        font-size: 1.5rem;
        padding: 0.75rem;
        letter-spacing: 1px;
    }
}

/* Pantallas muy pequeñas (hasta 375px) */
@media (max-width: 375px) {
    .main-header {
        padding: 0.75rem 0;
    }

    .header-title {
        font-size: 1.125rem;
    }

    .header-subtitle {
        font-size: 0.75rem;
    }

    body {
        font-size: 14px;
    }

    .form-card {
        padding: 1rem;
        margin: 0.75rem 0.25rem;
    }

    .form-card-header h1 {
        font-size: 1.35rem;
    }

    .form-card-header i {
        font-size: 2.25rem;
    }

    .nav-tabs .nav-link {
        padding: 0.625rem 0.375rem;
        font-size: 0.8rem;
    }

    .btn-modern {
        font-size: 0.95rem;
        padding: 0.75rem;
    }

    .form-control-modern,
    .form-select-modern {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    .social-icons .btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.85rem;
        margin: 0.125rem 0 !important;
    }
}

/* Pantallas extra pequeñas (hasta 320px) */
@media (max-width: 320px) {
    .main-header {
        padding: 0.625rem 0;
    }

    .header-title {
        font-size: 1rem;
    }

    .header-title i {
        font-size: 1.25rem;
    }

    .header-subtitle {
        font-size: 0.6875rem;
    }

    .form-card {
        padding: 0.75rem;
        margin: 0.5rem 0.125rem;
        border-radius: 8px;
    }

    .form-card-header {
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }

    .form-card-header h1 {
        font-size: 1.25rem;
    }

    .form-card-header i {
        font-size: 2rem;
    }

    .nav-tabs .nav-link {
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
    }

    .form-modern .form-group {
        margin-bottom: 1rem;
    }

    .btn-modern {
        font-size: 0.875rem;
        padding: 0.625rem;
    }
}

/* Modo landscape en móviles */
@media (max-height: 600px) and (orientation: landscape) {
    .main-header {
        padding: 0.5rem 0;
    }

    .header-title {
        font-size: 1rem;
        gap: 0.375rem;
    }

    .header-title i {
        font-size: 1.125rem;
    }

    .header-subtitle {
        font-size: 0.75rem;
        margin-top: 0.25rem;
    }

    .main-content {
        min-height: auto;
        padding: 1rem 0;
    }

    .form-card {
        margin: 1rem auto;
    }

    .form-card-header {
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }

    .form-card-header i {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

    .form-card-header h1 {
        font-size: 1.35rem;
    }

    .form-modern .form-group {
        margin-bottom: 1rem;
    }

    .nav-tabs {
        margin-bottom: 1rem;
    }

    footer {
        position: relative;
        margin-top: 1rem;
        padding: 0.75rem;
    }
}

/* Tablets en landscape (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .form-card {
        max-width: 700px;
        margin: 1.5rem auto;
    }

    .content-wrapper {
        padding: 0 1.5rem;
    }
}

/* iPads y tablets en portrait */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .form-card {
        max-width: 600px;
        padding: 2rem;
    }

    .content-wrapper {
        padding: 0 1.5rem;
    }

    .nav-tabs .nav-link {
        padding: 1rem 1.5rem;
    }
}

/* Touch targets (mínimo 44x44px según WCAG) */
@media (pointer: coarse) {
    .btn,
    .nav-link,
    .form-control,
    .form-select {
        min-height: 44px;
    }

    .social-icons .btn {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Alto contraste para accesibilidad */
@media (prefers-contrast: high) {
    .form-control-modern,
    .form-select-modern {
        border-width: 3px;
    }

    .nav-tabs .nav-link.active {
        border-bottom-width: 4px;
    }
}

/* Reducir animaciones para usuarios con preferencias de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Modo oscuro (opcional - si el sistema lo prefiere) */
@media (prefers-color-scheme: dark) {
    /* Mantener diseño claro por ahora, pero preparado para modo oscuro futuro */
}

/* ====================================
   SOBRESCRITURA FINAL DE FONDOS
   ==================================== */
/* Asegurar fondo gris en todo el documento */
html,
html body {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    background-color: #f8fafc !important;
    background-image: none !important;
    background-attachment: fixed !important;
}

/* Eliminar cualquier imagen bg.jpg */
body[style*="background"] {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    background-image: none !important;
}

/* ELIMINAR EL PSEUDO-ELEMENTO AZUL DEL BODY */
body::before {
    display: none !important;
    background-color: transparent !important;
    background: none !important;
}
