/* ==========================================
   GUÍA NIE ESPAÑA - STYLE.CSS
   Diseño responsive, limpio y profesional (tema rojo)
   ========================================== */

:root {
    --primary: #c62828;
    --primary-dark: #8e0000;
    --secondary: #f5f7fa;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #dbe3ea;
    --white: #ffffff;
    --success: #0f766e;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);

    --container: 1100px;
    --radius: 14px;
}

/* RESET */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        sans-serif;
    line-height: 1.7;
    color: var(--text);
    background: #f8fafc;
}

/* TIPOGRAFÍA */

h1,
h2,
h3,
h4 {
    line-height: 1.25;
    margin-top: 0;
    color: #111827;
}

h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 1rem;
}

h2 {
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    margin-bottom: 1.2rem;
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 0.8rem;
}

p {
    margin: 0 0 1.25rem;
}

ul,
ol {
    padding-left: 1.4rem;
}

li {
    margin-bottom: 0.6rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: 0.25s ease;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* CONTENEDOR */

.container {
    width: min(100% - 2rem, var(--container));
    margin-inline: auto;
}

/* HEADER */

.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    padding: 1rem 0;
}

.logo {
    display: inline-block;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
}

.logo:hover {
    text-decoration: none;
}

/* BREADCRUMB */

.breadcrumb {
    margin-top: 0.75rem;
    font-size: 0.95rem;
    color: var(--muted);
}

.breadcrumb a {
    color: var(--primary);
}

/* MAIN */

main {
    padding: 2rem 0 4rem;
}

/* HERO */

.hero-card {
    background: linear-gradient(
        135deg,
        #ffffff 0%,
        #fff1f1 100%
    );
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

/* SECCIONES */

.content-section {
    background: var(--white);
    padding: 2rem;
    margin-bottom: 1.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.content-section h2 {
    position: relative;
    padding-bottom: 0.8rem;
}

.content-section h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 70px;
    height: 4px;
    border-radius: 20px;
    background: var(--primary);
}

/* TARJETAS */

.card {
    background: #fff5f5;
    border: 1px solid #f3c2c2;
    border-radius: 12px;
    padding: 1.4rem;
    margin: 1.25rem 0;
    transition: 0.25s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(198, 40, 40, 0.12);
}

.card h3 {
    color: var(--primary);
}

/* TABLAS */

.table-responsive {
    overflow-x: auto;
    margin-top: 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 650px;
}

thead {
    background: var(--primary);
    color: white;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border: 1px solid var(--border);
}

tbody tr:nth-child(even) {
    background: #fff7f7;
}

tbody tr:hover {
    background: #ffe9e9;
}

/* LISTAS DESTACADAS */

.content-section ul li::marker {
    color: var(--primary);
}

/* FAQ */

.faq-section .card {
    background: #fff;
}

.faq-section h3 {
    margin-bottom: 0.5rem;
}

/* ADSENSE */

div:has(> .adsbygoogle),
.ad-container,
.adsense-container {
    margin: 2rem 0;
}

article > .adsense,
article > .ad-slot {
    min-height: 250px;
}

body *:has(> comment) {
    display: block;
}

/* CAJAS DE INFORMACIÓN */

.notice,
.info-box {
    background: #fff1f1;
    border-left: 5px solid var(--primary);
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

/* FOOTER */

.site-footer {
    background: #111827;
    color: rgba(255,255,255,0.85);
    padding: 3rem 0;
    margin-top: 3rem;
}

.site-footer h3 {
    color: white;
    margin-bottom: 1rem;
}

.site-footer ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    display: grid;
    gap: 0.7rem;
}

.site-footer a {
    color: rgba(255,255,255,0.85);
}

.site-footer a:hover {
    color: white;
}

.site-footer p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* BOTONES */

.btn,
button {
    display: inline-block;
    padding: 0.9rem 1.2rem;
    border-radius: 10px;
    border: none;
    background: var(--primary);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: 0.25s ease;
}

.btn:hover,
button:hover {
    background: var(--primary-dark);
    text-decoration: none;
}

/* TABLA DE CONTENIDOS OPCIONAL */

.toc {
    background: #fff5f5;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.toc ul {
    margin: 0;
}

.toc li {
    margin-bottom: 0.5rem;
}

/* MOBILE */

@media (max-width: 768px) {

    .hero-card,
    .content-section {
        padding: 1.4rem;
    }

    .site-header {
        position: relative;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    table {
        min-width: 600px;
    }
}

/* DESKTOP GRANDE */

@media (min-width: 1200px) {

    .hero-card,
    .content-section {
        padding: 2.5rem;
    }
}

/* MEJORAS DE LEGIBILIDAD */

article {
    max-width: 900px;
    margin: auto;
}

article p,
article li {
    font-size: 1.05rem;
}

article img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

/* ACCESIBILIDAD */

:focus-visible {
    outline: 3px solid #c62828;
    outline-offset: 2px;
}

/* SELECCIÓN DE TEXTO */

::selection {
    background: rgba(198, 40, 40, 0.15);
}
/* =====================================
   COMPATIBILIDAD CON HTML ACTUAL NIE
   ===================================== */


.header{
    background:var(--white);
    border-bottom:1px solid var(--border);
    position:sticky;
    top:0;
    z-index:100;
}


.header .container{
    padding:1rem 0;
    display:flex;
    justify-content:space-between;
    align-items:center;
}


.header .logo{
    color:var(--primary);
    font-size:1.35rem;
    font-weight:800;
}



.menu{
    list-style:none;
    display:flex;
    gap:20px;
    flex-wrap:wrap;
}


.menu a{
    color:var(--text);
    font-weight:600;
}



.hero{
    background:linear-gradient(
        135deg,
        #ffffff,
        #fff1f1
    );
    border:1px solid var(--border);
    border-radius:var(--radius);
    padding:2rem;
    box-shadow:var(--shadow);
    margin-bottom:2rem;
}


.hero-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:40px;
    align-items:center;
}


.hero-image img{
    width:100%;
    border-radius:14px;
}



.cards-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(250px,1fr));
    gap:20px;
}



.footer{
    background:#111827;
    color:white;
    padding:3rem 0;
}



.footer-links{
    display:flex;
    flex-wrap:wrap;
    gap:15px;
}



.footer a{
    color:white;
}



/* MOVIL */

@media(max-width:768px){


.header .container{
    flex-direction:column;
    gap:15px;
}


.menu{
    flex-direction:column;
    width:100%;
}


.menu a{
    display:block;
    padding:10px;
    background:#fff1f1;
    border-radius:8px;
}


.hero-grid{
    grid-template-columns:1fr;
}


.hero{
    padding:1.4rem;
}


.cards-grid{
    grid-template-columns:1fr;
}


.btn{
    width:100%;
    text-align:center;
}

}
.btn-secondary{
background:#fff;
}
.btn-secondary{
background:#eef4ff;
border:1px solid #c7d7f5;
color:#0f4fa8;
}