/* ==========================================================================
   DESIGN SYSTEM - MUNICIPALIDAD DE ERCILLA (PORTAL ARAUCANÍA CONECTADA)
   ========================================================================== */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&family=Noto+Color+Emoji&display=swap');

/* Base Root Variables - Light Mode Default */
:root {
    /* Color Palette - Blue & Green Theme */
    --primary-h: 215;
    --primary-s: 75%;
    --primary-l: 22%; /* Municipal Civic Blue (#0f2b5c) */
    --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
    --primary-light: hsl(var(--primary-h), var(--primary-s), calc(var(--primary-l) + 12%));
    --primary-dark: hsl(var(--primary-h), var(--primary-s), calc(var(--primary-l) - 6%));
    
    --secondary-h: 158;
    --secondary-s: 64%;
    --secondary-l: 22%; /* Araucanía Forest Green (#0d5238) */
    --secondary: hsl(var(--secondary-h), var(--secondary-s), var(--secondary-l));
    --secondary-light: hsl(var(--secondary-h), var(--secondary-s), calc(var(--secondary-l) + 15%));

    --accent-h: 160;
    --accent-s: 84%;
    --accent-l: 39%; /* Vibrant Emerald Green (#059669) */
    --accent: hsl(var(--accent-h), var(--accent-s), var(--accent-l));
    --accent-hover: hsl(var(--accent-h), var(--accent-s), calc(var(--accent-l) + 8%));
    --accent-glow: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.35);

    /* Backgrounds & Text Colors (Light Theme) */
    --bg-main: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 0.98);
    --bg-nav: rgba(255, 255, 255, 0.8);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #ffffff;
    --border-color: rgba(226, 232, 240, 0.8);
    --border-glow: rgba(5, 150, 105, 0.12);
    --input-bg: #ffffff;
    
    /* Accessibility */
    --font-scale: 1;

    /* Shadows & Effects */
    --shadow-sm: 0 2px 8px -2px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 12px 20px -8px rgba(15, 23, 42, 0.12);
    --shadow-lg: 0 20px 32px -12px rgba(15, 23, 42, 0.16);
    --glass-blur: blur(12px);
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Variables Override */
[data-theme="dark"] {
    --bg-main: #0b0f19;
    --bg-card: rgba(20, 29, 47, 0.65);
    --bg-card-hover: rgba(26, 38, 62, 0.85);
    --bg-nav: rgba(11, 15, 25, 0.8);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: rgba(51, 65, 85, 0.5);
    --border-glow: rgba(16, 185, 129, 0.15);
    --input-bg: #151f32;
    --shadow-md: 0 12px 24px -8px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 40px -12px rgba(0, 0, 0, 0.65);
}

/* Basic Reset & Font Settings */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: calc(16px * var(--font-scale));
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', 'Inter', 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.25;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

/* Glassmorphism Global Class */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    border-radius: var(--border-radius-md);
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border var(--transition-smooth), background-color var(--transition-smooth);
}

.glass-panel:hover {
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-lg);
    border-color: rgba(var(--accent-h), var(--accent-s), var(--accent-l), 0.3);
}

/* Interactive Button Global Class */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #0284c7, #059669); /* Blue to Emerald Green gradient */
    color: var(--text-light);
    font-weight: 600;
    padding: 12px 28px;
    border-radius: var(--border-radius-sm);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.35);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #0369a1, #10b981);
    box-shadow: 0 6px 22px rgba(16, 185, 129, 0.45);
    filter: brightness(1.05);
}

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

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    color: var(--text-main);
    font-weight: 600;
    padding: 11px 27px;
    border-radius: var(--border-radius-sm);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.btn-secondary:hover {
    background-color: var(--border-color);
    border-color: var(--text-muted);
}

/* ==========================================================================
   HEADER & ACCESSIBILITY BAR
   ========================================================================== */
.top-accessibility-bar {
    background: linear-gradient(90deg, #0075ff 0%, #5ebd3e 100%);
    color: #ffffff;
    font-size: 0.85rem;
    padding: 7px 4%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    z-index: 1000;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.top-nav-links {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.top-nav-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.82rem;
    opacity: 0.95;
    transition: opacity var(--transition-fast), transform var(--transition-fast), color var(--transition-fast);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

.top-nav-links a:hover {
    opacity: 1;
    color: #ffffff;
    transform: translateY(-1px);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.85);
    text-decoration: underline;
}

.top-tools-group {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
}

.top-social-icons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-social-icons a {
    color: #ffffff;
    font-size: 1.05rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: transform var(--transition-fast), background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.top-social-icons a:hover {
    transform: translateY(-2px) scale(1.1);
    background: #ffffff;
    color: #0075ff;
    border-color: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.accessibility-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.accessibility-controls span {
    opacity: 0.9;
    font-weight: 600;
}

.acc-btn {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #ffffff;
    border-radius: 4px;
    padding: 2px 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.75rem;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.acc-btn:hover {
    background: #ffffff;
    color: #0075ff;
    border-color: #ffffff;
    text-shadow: none;
}

.theme-toggle-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    opacity: 0.85;
    transition: opacity var(--transition-fast), transform var(--transition-fast), text-shadow var(--transition-fast);
}

.theme-toggle-btn:hover {
    opacity: 1;
    transform: scale(1.15) rotate(15deg);
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.85);
}

/* Main Navigation Bar */
.main-header {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 999;
    padding: 9px 4%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-nav);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    transition: padding var(--transition-smooth), background-color var(--transition-smooth), border-color var(--transition-smooth);
}

.main-header.scrolled {
    padding: 6px 4%;
    box-shadow: var(--shadow-md);
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.brand-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
    transition: height var(--transition-smooth);
}

.main-header.scrolled .brand-logo {
    height: 40px;
}

.brand-text h2 {
    font-size: 1.15rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

[data-theme="dark"] .brand-text h2 {
    background: linear-gradient(135deg, #10b981, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-text p {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
}

.nav-menu {
    display: flex;
    gap: clamp(12px, 1.4vw, 24px);
    list-style: none;
    align-items: center;
    flex-wrap: nowrap;
    margin: 0 0 0 auto;
    padding: 0;
}

.nav-item {
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-link {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-main);
    position: relative;
    padding: 6px 2px;
    white-space: nowrap;
    display: inline-block;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
    transition: width var(--transition-fast);
}

.nav-link:hover {
    color: var(--accent);
}

.nav-link:hover::after,
.nav-item.active .nav-link::after {
    width: 100%;
}

.nav-item.active .nav-link {
    color: var(--accent);
}

.menu-toggle-btn {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.6rem;
    color: var(--text-main);
    cursor: pointer;
}

/* ==========================================================================
   HERO / BANNER SECTION WITH DRONE VIDEO
   ========================================================================== */
.hero-section {
    position: relative;
    padding: 95px 0 10px 0;
    min-height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-align: center;
}

.hero-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden; /* Evita que el escalado del vídeo desborde */
}

.hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.015); /* Elimina el borde gris/blanco por redondeo de píxeles */
    border: none;
    outline: none;
    display: block;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: linear-gradient(180deg, 
        rgba(15, 43, 92, 0.4) 0%, 
        rgba(13, 71, 32, 0.6) 50%, 
        var(--bg-main) 100%);
    transition: background var(--transition-smooth);
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 800px;
    padding: 0 20px;
    color: var(--text-light);
}

.hero-tag {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: var(--accent);
    color: var(--text-light);
    padding: 6px 16px;
    border-radius: 50px;
    display: inline-block;
    margin-bottom: 18px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    animation: fadeInUp 0.8s ease forwards;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-light);
    margin-bottom: 18px;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    animation: fadeInUp 1s cubic-bezier(0.1, 1, 0.1, 1) forwards;
}

.hero-content p {
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 25px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    animation: fadeInUp 1.2s cubic-bezier(0.1, 1, 0.1, 1) forwards;
    opacity: 0.95;
}

.hero-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    animation: fadeInUp 1.4s cubic-bezier(0.1, 1, 0.1, 1) forwards;
}

/* ==========================================================================
   SPA VIEWS LAYOUT
   ========================================================================== */
.view-section {
    display: none;
    opacity: 0;
    width: 100%;
    transition: opacity var(--transition-smooth) ease;
}

.view-section.active-view {
    display: block;
    opacity: 1;
    animation: fadeInView 0.5s ease-out forwards;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 80px 5%;
}

.section-header {
    text-align: center;
    margin-bottom: 45px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 50px;
    background: rgba(5, 150, 105, 0.12);
    color: var(--accent, #059669);
    border: 1px solid rgba(5, 150, 105, 0.3);
    margin-bottom: 12px;
}

.section-header h2 {
    font-size: 2.25rem;
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-top: 10px;
}

/* ==========================================================================
   TRAMITES DIGITALES (DIGITAL PROCEDURES) GRID
   ========================================================================== */
.procedures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

@media (min-width: 1024px) {
    .procedures-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) and (min-width: 600px) {
    .procedures-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 599px) {
    .procedures-grid {
        grid-template-columns: 1fr;
    }
}

.procedure-card {
    padding: 30px 24px;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
}

.procedure-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius-sm);
    background: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 20px;
    transition: transform var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}

[data-theme="dark"] .procedure-icon-wrapper {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.procedure-card:hover .procedure-icon-wrapper {
    transform: scale(1.1) rotate(5deg);
    background: var(--accent);
    color: var(--text-light);
}

.procedure-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
    min-height: 2.7rem;
    display: flex;
    align-items: center;
}

.procedure-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    flex-grow: 1;
    margin-bottom: 20px;
    line-height: 1.5;
}

.procedure-link {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
}

.procedure-link svg {
    transition: transform var(--transition-fast);
}

.procedure-card:hover .procedure-link svg {
    transform: translateX(4px);
}

/* ==========================================================================
   OIRS VIRTUAL REDESIGN (WIZARD STEPS & DASHBOARD)
   ========================================================================== */
.oirs-wizard-container {
    max-width: 1260px;
    width: 100%;
    margin: 0 auto;
    padding: 35px 30px;
}

#oirs-form,
#oirs-track-panel,
#public-notice-panel {
    max-width: 760px;
    margin: 0 auto;
}

.oirs-header {
    text-align: center;
    margin-bottom: 30px;
}

.oirs-header h3 {
    font-size: 1.75rem;
    margin-bottom: 8px;
}

.oirs-header p {
    color: var(--text-muted);
}

/* Progress Bar */
.wizard-progress-bar {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: 45px;
}

.wizard-progress-bar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--border-color);
    transform: translateY(-50%);
    z-index: 1;
}

.progress-track {
    position: absolute;
    top: 50%;
    left: 0;
    width: 0%;
    height: 3px;
    background-color: var(--accent);
    transform: translateY(-50%);
    z-index: 1;
    transition: width var(--transition-smooth);
}

.progress-step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--bg-main);
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    position: relative;
    z-index: 2;
    transition: border-color var(--transition-smooth), background-color var(--transition-smooth), color var(--transition-smooth);
}

.progress-step.step-active {
    border-color: var(--accent);
    background-color: var(--bg-main);
    color: var(--accent);
}

.progress-step.step-completed {
    border-color: var(--accent);
    background-color: var(--accent);
    color: var(--text-light);
}

.step-label {
    position: absolute;
    top: 38px;
    white-space: nowrap;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.progress-step.step-active .step-label {
    color: var(--text-main);
}

/* Wizard Steps Panel */
.wizard-step-panel {
    display: none;
    animation: fadeInView 0.4s ease-out forwards;
}

.wizard-step-panel.step-panel-active {
    display: block;
}

/* Form Styles & High-Contrast Input Fields */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: var(--text-main);
}

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="url"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: 13px 16px;
    border-radius: var(--border-radius-sm);
    border: 2px solid #94a3b8 !important; /* Alto contraste visual para los bordes */
    background-color: var(--input-bg, #ffffff) !important;
    color: var(--text-main, #0f172a) !important;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: #64748b !important;
    opacity: 0.9;
    font-weight: 500;
}

.form-control:hover,
input:hover,
select:hover,
textarea:hover {
    border-color: #475569 !important;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none !important;
    border-color: var(--accent, #059669) !important;
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.25), inset 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    background-color: #ffffff !important;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    border: 2px solid #475569 !important;
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .form-control::placeholder,
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: #94a3b8 !important;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    background-color: #0f172a !important;
    border-color: #10b981 !important;
}

/* Password Visibility Toggle */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 48px !important;
}

.password-toggle-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    font-size: 1.05rem;
    padding: 6px 8px;
    border-radius: 6px;
    transition: color 0.2s ease, background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.password-toggle-btn:hover {
    color: var(--accent, #059669);
    background-color: rgba(5, 150, 105, 0.08);
}

.password-toggle-btn:active {
    transform: translateY(-50%) scale(0.92);
}

[data-theme="dark"] .password-toggle-btn {
    color: #94a3b8;
}

[data-theme="dark"] .password-toggle-btn:hover {
    color: #10b981;
    background-color: rgba(16, 185, 129, 0.12);
}

/* Selection Cards Grid */
.selection-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 10px;
}

.select-card {
    padding: 24px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-md);
    cursor: pointer;
    text-align: center;
    transition: border-color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast);
}

.select-card input[type="radio"] {
    display: none;
}

.select-card i {
    font-size: 2rem;
    margin-bottom: 12px;
    color: var(--text-muted);
    display: block;
    transition: color var(--transition-fast);
}

.select-card h4 {
    font-size: 1.05rem;
    margin-bottom: 6px;
}

.select-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.select-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.select-card.card-selected {
    border-color: var(--accent);
    background-color: var(--accent-glow);
}

.select-card.card-selected i {
    color: var(--accent);
}

/* Wizard Navigation Buttons */
.wizard-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    padding-top: 25px;
}

/* Summary Box */
.summary-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-color: var(--bg-main);
    border-radius: var(--border-radius-sm);
    padding: 24px;
    border: 1px solid var(--border-color);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.summary-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.summary-label {
    font-weight: 600;
    color: var(--text-muted);
}

.summary-value {
    font-weight: 500;
    text-align: right;
    max-width: 60%;
    word-break: break-all;
}

/* Success Step Screen */
.success-screen {
    text-align: center;
    padding: 30px 0;
}

.success-icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: rgba(16, 185, 129, 0.15);
    color: #10b981;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 25px;
    animation: scaleUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.success-screen h3 {
    font-size: 1.8rem;
    color: #10b981;
    margin-bottom: 12px;
}

.success-screen p {
    margin-bottom: 30px;
    color: var(--text-muted);
}

.ticket-box {
    background: var(--bg-main);
    border: 1px dashed var(--accent);
    border-radius: var(--border-radius-sm);
    padding: 20px;
    margin-bottom: 30px;
    display: inline-block;
}

.ticket-number {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--accent);
}

/* ==========================================================================
   SECTIONS: LA MUNICIPALIDAD & CONCEJO
   ========================================================================== */
.info-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.info-content h3 {
    font-size: 1.75rem;
    margin-bottom: 20px;
    color: var(--primary);
}

[data-theme="dark"] .info-content h3 {
    color: #10b981;
}

.info-content p {
    margin-bottom: 20px;
    color: var(--text-muted);
}

.info-image-wrapper {
    position: relative;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.info-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

/* Member Cards Grid */
.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.member-card {
    text-align: center;
    padding: 40px 20px 30px;
}

.member-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--border-color);
    margin: 0 auto 20px;
    box-shadow: var(--shadow-md);
}

.member-card h3 {
    font-size: 1.3rem;
    margin-bottom: 6px;
}

.member-role {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.member-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ==========================================================================
   TRANSPARENCIA PAGE LAYOUT
   ========================================================================== */
.transparency-dashboard {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

@media (max-width: 1150px) {
    .transparency-dashboard {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media (max-width: 650px) {
    .transparency-dashboard {
        grid-template-columns: 1fr;
    }
}

.transparency-dashboard-centered {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    align-items: stretch;
}

.transparency-dashboard-centered .transparency-card {
    flex: 0 1 calc(33.333% - 18px);
    min-width: 280px;
    max-width: 380px;
    min-height: 420px;
    box-sizing: border-box;
}

@media (max-width: 991px) {
    .transparency-dashboard-centered .transparency-card {
        flex: 0 1 calc(50% - 14px);
        max-width: 400px;
        min-height: 410px;
    }
}

@media (max-width: 640px) {
    .transparency-dashboard-centered .transparency-card {
        flex: 1 1 100%;
        max-width: 100%;
        min-height: auto;
    }
}

.transparency-card {
    padding: 35px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 420px;
    box-sizing: border-box;
    border-radius: var(--border-radius-md);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.transparency-card:hover {
    transform: translateY(-4px);
}

.transparency-icon {
    font-size: 2.75rem;
    color: var(--primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
}

[data-theme="dark"] .transparency-icon {
    color: #10b981;
}

.transparency-card h3 {
    font-size: 1.22rem;
    font-weight: 700;
    margin-bottom: 14px;
    min-height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.35;
}

.transparency-card p {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-bottom: 25px;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.55;
}

.transparency-card .btn-primary {
    margin-top: auto;
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    box-sizing: border-box;
}

/* ==========================================================================
   FOOTER, CONTACT & SOCIAL PLUGINS
   ========================================================================== */
.footer-container {
    background: linear-gradient(90deg, #0075ff 0%, #5ebd3e 100%);
    color: var(--text-light);
    padding: 80px 5% 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    position: relative;
    z-index: 10;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 1.3fr;
    gap: 40px;
    max-width: 1300px;
    margin: 0 auto 50px;
}

.footer-col h3 {
    color: var(--text-light);
    font-size: 1.25rem;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 35px;
    height: 3px;
    background: #ffffff;
    border-radius: 2px;
}

.footer-brand h2 {
    font-size: 1.5rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

.footer-brand p {
    font-size: 0.9rem;
    color: #ffffff;
    opacity: 0.9;
    margin-bottom: 25px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-icon {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: background-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.social-icon:hover {
    background-color: #ffffff;
    color: #0075ff;
    transform: translateY(-3px);
}

.contact-info-list {
    list-style: none;
}

.contact-info-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
    font-size: 0.9rem;
    color: #ffffff;
    opacity: 0.92;
}

.contact-info-list li i,
.contact-info-list li svg {
    margin-top: 4px;
    color: #ffffff;
    opacity: 0.95;
    flex-shrink: 0;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    font-size: 0.92rem;
    color: #ffffff;
    opacity: 0.9;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: opacity var(--transition-fast), transform var(--transition-fast), text-shadow var(--transition-fast);
}

.footer-links a:hover {
    opacity: 1;
    color: #ffffff;
    font-weight: 700;
    transform: translateX(6px);
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
}

.footer-links a i,
.footer-links a svg {
    font-size: 0.8rem;
    color: #ffffff;
    opacity: 0.85;
}

/* Maps and FB Embeds */
.footer-embeds-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer-map-container {
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    height: 180px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.fb-plugin-container {
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    height: 200px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 30px;
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.88rem;
    color: #ffffff;
    opacity: 0.9;
}

/* ==========================================================================
   ANIMATIONS & RESPONSIVENESS
   ========================================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInView {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

/* Scroll Animation Hooks */
.scroll-animate {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-animate.animated {
    opacity: 1;
    transform: translateY(0);
}

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 1240px) {
    .main-header {
        padding: 12px 20px;
    }

    .menu-toggle-btn {
        display: block;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #ffffff;
        border-bottom: 2px solid var(--border-color);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.22);
        flex-direction: column;
        align-items: center;
        padding: 24px 20px;
        gap: 10px;
        display: none;
        z-index: 1000;
    }

    [data-theme="dark"] .nav-menu {
        background-color: #0f172a;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.65);
    }

    .nav-menu.mobile-open {
        display: flex;
        animation: slideDownMenu 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .nav-menu li {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .nav-menu .nav-link {
        width: 100%;
        max-width: 400px;
        padding: 12px 18px;
        border-radius: 12px;
        font-weight: 700;
        font-size: 0.95rem;
        text-align: center;
        background: rgba(0, 0, 0, 0.03);
        border: 1px solid rgba(0, 0, 0, 0.06);
        color: var(--text-main);
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    .nav-menu .nav-link::after {
        display: none;
    }

    [data-theme="dark"] .nav-menu .nav-link {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .nav-menu .nav-link:hover,
    .nav-menu .nav-item.active .nav-link {
        background: rgba(5, 150, 105, 0.12);
        color: var(--accent);
        border-color: rgba(5, 150, 105, 0.3);
    }

    .nav-menu .btn-primary {
        width: 100% !important;
        max-width: 400px !important;
        padding: 12px 20px !important;
        font-size: 0.92rem !important;
        justify-content: center !important;
        border-radius: 12px !important;
        margin-top: 4px;
    }
}

@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    .transparency-dashboard {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    html {
        font-size: calc(15px * var(--font-scale));
    }
    
    .top-accessibility-bar {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 10px 14px;
        gap: 8px;
    }

    .top-nav-links {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        width: 100%;
    }

    .top-nav-links a {
        font-size: 0.72rem;
        font-weight: 600;
        letter-spacing: -0.15px;
        background: rgba(255, 255, 255, 0.15);
        padding: 6px 6px;
        border-radius: 20px;
        border: 1px solid rgba(255, 255, 255, 0.25);
        white-space: nowrap;
        backdrop-filter: blur(4px);
        justify-content: center;
        text-align: center;
        gap: 4px;
    }

    .top-tools-group {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        gap: 8px;
        margin-left: 0;
    }

    .top-social-icons {
        gap: 8px;
    }

    .top-social-icons a {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }

    .accessibility-controls {
        gap: 6px;
    }

    .acc-label {
        display: none; /* Ocultar texto 'Accesibilidad:' en móvil para ganar espacio */
    }

    .acc-btn {
        padding: 4px 10px;
        font-size: 0.8rem;
        border-radius: 6px;
        touch-action: manipulation;
        min-width: 32px;
        min-height: 32px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .theme-toggle-btn {
        font-size: 1.1rem;
        padding: 4px 8px;
        touch-action: manipulation;
        min-width: 32px;
        min-height: 32px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .hero-content h1 {
        font-size: 2.25rem;
    }

    .hero-content p {
        font-size: 1.1rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .info-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .info-image-wrapper {
        order: -1;
    }

    .selection-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .oirs-wizard-container {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .top-accessibility-bar {
        padding: 8px 10px;
        gap: 6px;
    }

    .top-nav-links {
        gap: 4px;
    }

    .top-nav-links a {
        font-size: 0.64rem;
        padding: 5px 2px;
        gap: 3px;
        letter-spacing: -0.2px;
    }

    .top-social-icons a {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }

    .acc-btn {
        padding: 2px 6px;
        font-size: 0.72rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .transparency-dashboard {
        grid-template-columns: 1fr;
    }

    .wizard-progress-bar {
        display: none; /* Hide progress steps on micro-mobile to fit wizard */
    }
    
    .progress-step {
        display: none;
    }
}

/* ==========================================
   DIRECTIVOS & DEPARTAMENTOS STYLES
   ========================================== */
.directivos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-top: 40px;
}

@media (max-width: 900px) {
    .directivos-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 580px) {
    .directivos-grid {
        grid-template-columns: 1fr;
    }
}
.directivo-card {
    padding: 30px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.directivo-avatar-wrapper {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast);
}
.directivo-card:hover .directivo-avatar-wrapper {
    transform: scale(1.05) rotate(5deg);
}
.directivo-card h4 {
    font-size: 1.1rem;
    margin-bottom: 6px;
    color: var(--text-main);
}
.directivo-role {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.depts-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 40px;
    justify-content: center; /* Centra las tarjetas de la última fila */
}
.dept-card {
    padding: 40px 25px;
    background-size: cover;
    background-position: center 15%; /* Alinea las cabezas hacia arriba para evitar cortes */
    position: relative;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    color: #ffffff;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
    flex: 1 1 300px;
    max-width: 100%;
}
@media (min-width: 768px) {
    .dept-card {
        max-width: calc(50% - 15px); /* 2 columnas en tablets */
    }
}
@media (min-width: 1024px) {
    .dept-card {
        max-width: calc(33.333% - 20px); /* 3 columnas en pantallas grandes */
    }
}
.dept-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.72) 100%);
    z-index: 1;
    transition: background var(--transition-fast);
}
.dept-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}
.dept-card:hover::before {
    background: linear-gradient(180deg, transparent 40%, rgba(0, 78, 170, 0.85) 100%);
}
.dept-content {
    position: relative;
    z-index: 2;
}
.dept-content h3 {
    color: #ffffff;
    font-size: 1.18rem;
    font-weight: 700;
    margin-bottom: 5px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
}
.dept-email {
    font-size: 0.84rem;
    font-weight: 600;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
    transition: color var(--transition-fast), transform var(--transition-fast);
}
.dept-email i,
.dept-email svg {
    color: #38bdf8;
    font-size: 0.85rem;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
    transition: transform var(--transition-fast);
}
.dept-email:hover {
    color: #38bdf8;
    text-decoration: underline;
    transform: translateX(3px);
}
.dept-email:hover i,
.dept-email:hover svg {
    transform: scale(1.15);
}

.social-news-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 40px;
    align-items: stretch;
}
@media (max-width: 991px) {
    .social-news-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   ACCESSIBILITY KEYBOARD FOCUS & PRINT STYLES (WCAG 2.1 AA)
   ========================================================================== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
    border-radius: var(--border-radius-sm);
}

@media print {
    .top-accessibility-bar,
    .menu-toggle-btn,
    .theme-toggle-btn,
    .wizard-nav,
    footer {
        display: none !important;
    }
    
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    
    .glass-panel {
        border: 1px solid #cccccc !important;
        box-shadow: none !important;
        background: #ffffff !important;
    }
}

/* ==========================================================================
   MODAL DE PREVISUALIZACIÓN DE PDF OIRS
   ========================================================================== */
.pdf-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeInView 0.3s ease-out;
}

.pdf-modal-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 920px;
    height: 85vh;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    margin: auto;
    animation: scaleUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pdf-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
}

.pdf-modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    display: flex;
    align-items: center;
}

.pdf-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 5px;
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.pdf-modal-close:hover {
    color: #ef4444;
    transform: scale(1.1);
}

.pdf-modal-body {
    flex: 1;
    min-height: 0;
    background: #525659;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pdf-modal-body iframe {
    width: 100%;
    height: 100%;
    flex: 1;
    min-height: 0;
    border: none;
}

.pdf-modal-footer {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    align-items: center;
    padding: 14px 24px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.02);
    flex-shrink: 0;
}

/* ==========================================================================
   BOTÓN FLOTANTE DE EMERGENCIAS 24/7
   ========================================================================== */
#emergency-float-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9998;
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    padding: 14px 22px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.5);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: pulseEmergency 2s infinite;
}

#emergency-float-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 15px 35px rgba(239, 68, 68, 0.7);
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
}

#emergency-float-btn i {
    font-size: 1.3rem;
}

@keyframes pulseEmergency {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* ==========================================================================
   TARJETAS Y MÓDULO DE NOTICIAS DINÁMICAS
   ========================================================================== */
.news-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-width: 420px;
    width: 100%;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.news-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.news-card-img-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.news-card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
    transition: transform 0.5s ease;
}

.news-card:hover .news-card-img-wrapper img {
    transform: scale(1.08);
}

.news-card-category {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(15, 43, 92, 0.85);
    backdrop-filter: blur(6px);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-card-date {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.news-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 10px;
    line-height: 1.35;
}

.news-card-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
    flex-grow: 1;
    margin-bottom: 15px;
}

/* ==========================================================================
   ACORDEÓN FAQ
   ========================================================================== */
.faq-item:hover {
    border-color: var(--accent) !important;
    background: rgba(255, 255, 255, 0.03) !important;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

/* ==========================================================================
   FORMULARIO DE ACCESO INSTITUCIONAL (FIJO Y ESTABLE)
   ========================================================================== */
#oirs-admin-login {
    width: 100% !important;
    max-width: 440px !important;
    margin: 25px auto 0 !important;
    padding: 32px 30px !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
}

@media (max-width: 480px) {
    #oirs-admin-login,
    html.is-gestion-portal #oirs-admin-login {
        padding: 24px 18px !important;
        margin: 15px auto 0 !important;
        border-radius: 14px !important;
    }
    #gestion-header-box {
        gap: 10px !important;
        padding-bottom: 10px !important;
        margin-bottom: 15px !important;
    }
    #gestion-header-box img {
        width: 44px !important;
        height: 44px !important;
    }
    #gestion-header-title {
        font-size: 1.15rem !important;
    }
    #gestion-header-sub {
        font-size: 0.78rem !important;
    }
}

@media (max-width: 640px) {
    #public-news-cards-container {
        grid-template-columns: 1fr !important;
        gap: 18px !important;
    }
    .news-card {
        max-width: 100% !important;
    }
    .news-card-img-wrapper {
        height: 185px !important;
    }
    .news-card-title {
        font-size: 1.02rem !important;
    }
}

/* ==========================================================================
   REPRODUCTOR DE VIDEO VERTICAL (REELS / SHORTS)
   ========================================================================== */
.embedded-vertical-reel {
    aspect-ratio: 9 / 16;
}

@media (max-width: 480px) {
    .embedded-vertical-reel {
        max-width: 100% !important;
        height: 480px !important;
    }
}

/* ==========================================================================
   CUSTOM MUNICIPAL TOAST NOTIFICATIONS
   ========================================================================== */
#muni-toast-container {
    position: fixed;
    top: 25px;
    right: 25px;
    z-index: 99999999 !important;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 440px;
    width: calc(100% - 50px);
    pointer-events: none;
}

@media (max-width: 640px) {
    #muni-toast-container {
        top: 15px;
        right: 15px;
        left: 15px;
        width: calc(100% - 30px);
        max-width: 100%;
    }
}

.muni-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 12px;
    background: #0f172a;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.45;
    position: relative;
    overflow: hidden;
    animation: toastSlideIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transition: all 0.3s ease;
}

.muni-toast.toast-success {
    border-color: rgba(16, 185, 129, 0.5);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(6, 78, 59, 0.95));
    box-shadow: 0 15px 35px -5px rgba(16, 185, 129, 0.3), 0 8px 20px rgba(0, 0, 0, 0.5);
}

.muni-toast.toast-error {
    border-color: rgba(239, 68, 68, 0.5);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(127, 29, 29, 0.95));
    box-shadow: 0 15px 35px -5px rgba(239, 68, 68, 0.3), 0 8px 20px rgba(0, 0, 0, 0.5);
}

.muni-toast.toast-warning {
    border-color: rgba(245, 158, 11, 0.5);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(120, 53, 15, 0.95));
    box-shadow: 0 15px 35px -5px rgba(245, 158, 11, 0.3), 0 8px 20px rgba(0, 0, 0, 0.5);
}

.muni-toast.toast-info {
    border-color: rgba(56, 189, 248, 0.5);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(12, 74, 110, 0.95));
    box-shadow: 0 15px 35px -5px rgba(56, 189, 248, 0.3), 0 8px 20px rgba(0, 0, 0, 0.5);
}

.muni-toast-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.muni-toast-content {
    flex: 1;
    word-break: break-word;
}

.muni-toast-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    cursor: pointer;
    padding: 2px;
    margin-left: 8px;
    flex-shrink: 0;
    transition: color 0.2s, transform 0.2s;
}

.muni-toast-close:hover {
    color: #ffffff;
    transform: scale(1.15);
}

.muni-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: rgba(255, 255, 255, 0.5);
    animation: toastProgress linear forwards;
}

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

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

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* ==========================================================================
   MODO FIESTAS PATRIAS / DIECIOCHERO (CHILE)
   ========================================================================== */
.dieciocho-garland-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 12px;
    display: flex;
    justify-content: space-around;
    pointer-events: none;
    z-index: 100;
    overflow: hidden;
}

.dieciocho-pennant {
    width: 14px;
    height: 13px;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    transform-origin: top center;
    animation: pennantSway 3s ease-in-out infinite alternate;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    flex-shrink: 0;
}

.dieciocho-pennant:nth-child(even) {
    animation-delay: -1.2s;
    animation-duration: 2.6s;
}
.dieciocho-pennant:nth-child(3n) {
    animation-delay: -0.7s;
    animation-duration: 3.3s;
}

.dieciocho-pennant.blue {
    background: #0033a0;
}
.dieciocho-pennant.white {
    background: #ffffff;
    border-top: 1px solid #cbd5e1;
}
.dieciocho-pennant.red {
    background: #d52b1e;
}
.dieciocho-pennant.flag {
    background: linear-gradient(to bottom, #ffffff 0%, #ffffff 50%, #d52b1e 50%, #d52b1e 100%);
    position: relative;
}
.dieciocho-pennant.flag::before {
    content: '★';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 50%;
    background: #0033a0;
    color: #ffffff;
    font-size: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

@keyframes pennantSway {
    0% {
        transform: rotate(-8deg) skewX(-2deg);
    }
    100% {
        transform: rotate(8deg) skewX(2deg);
    }
}

.dieciocho-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(0, 0, 0, 0.3);
    color: #ffffff;
    padding: 3px 14px;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    animation: badgePulse 2.5s infinite ease-in-out;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9);
    white-space: nowrap;
    margin: 0 10px;
}

@keyframes badgePulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(213, 43, 30, 0.5);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 4px 14px rgba(0, 51, 160, 0.7);
        transform: scale(1.03);
    }
}

/* Ambientación en Modo Activo */
body.theme-fiestas-patrias .main-header {
    border-bottom: 3.5px solid #d52b1e;
}

body.theme-fiestas-patrias .top-accessibility-bar {
    background: linear-gradient(135deg, #0033a0 0%, #024ebb 25%, #ffffff 48%, #ffffff 52%, #d52b1e 75%, #b91c1c 100%) !important;
}

body.theme-fiestas-patrias .top-accessibility-bar a,
body.theme-fiestas-patrias .top-accessibility-bar .acc-label,
body.theme-fiestas-patrias .top-accessibility-bar .acc-btn,
body.theme-fiestas-patrias .top-accessibility-bar .theme-toggle-btn {
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.85);
}

/* Footer Patrio en Modo Fiestas Patrias */
body.theme-fiestas-patrias .footer-container {
    background: linear-gradient(135deg, #002b80 0%, #0033a0 28%, #1e40af 45%, #d52b1e 72%, #991b1b 100%) !important;
    border-top: 3.5px solid #d52b1e !important;
}

body.theme-fiestas-patrias .footer-col h3::after {
    background: #ffd700 !important;
}

/* Botón Interruptor Dieciochero en Panel Admin */
.btn-dieciocho-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.84rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: #ffffff;
    color: #0f172a;
    border: 2px solid #cbd5e1;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

[data-theme="dark"] .btn-dieciocho-toggle {
    background: #1e293b;
    color: #f8fafc;
    border-color: #475569;
}

.btn-dieciocho-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-color: #d52b1e;
}

.btn-dieciocho-toggle.active {
    background: linear-gradient(135deg, #0033a0 0%, #d52b1e 100%) !important;
    color: #ffffff !important;
    border: 2px solid #ffd700 !important;
    box-shadow: 0 4px 14px rgba(213, 43, 30, 0.45) !important;
    animation: dieciochoBtnGlow 2.5s infinite alternate;
}

@keyframes dieciochoBtnGlow {
    0% {
        box-shadow: 0 2px 10px rgba(0, 51, 160, 0.4);
    }
    100% {
        box-shadow: 0 5px 18px rgba(213, 43, 30, 0.6);
    }
}

/* ==========================================================================
   PAGINACIÓN INTELIGENTE Y RESPONSIVA
   ========================================================================== */
.pagination-container {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 35px;
    flex-wrap: nowrap;
    max-width: 100%;
}

.pagination-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 6px;
    border-radius: 50%;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    border: 1.5px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    box-sizing: border-box;
}

.pagination-btn:hover:not(.active) {
    background: rgba(5, 150, 105, 0.15);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.pagination-btn.active {
    background: var(--accent) !important;
    color: #ffffff !important;
    border-color: var(--accent) !important;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
}

.pagination-ellipsis {
    padding: 0 4px;
    color: var(--text-muted);
    font-weight: 800;
    font-size: 1rem;
    user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pagination-nav-btn {
    padding: 8px 18px;
    font-size: 0.85rem;
    border-radius: 50px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

@media (max-width: 600px) {
    .pagination-container {
        gap: 4px;
        margin-top: 25px;
    }
    .pagination-btn {
        min-width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    .pagination-nav-btn {
        padding: 7px 12px;
        font-size: 0.78rem;
    }
    .pagination-nav-text {
        display: none;
    }
}

/* ==========================================================================
   BARRA DE FILTROS POR CATEGORÍA DE NOTICIAS
   ========================================================================== */
.news-filter-wrapper {
    margin-bottom: 30px;
    width: 100%;
}

.news-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.news-filter-chip {
    padding: 8px 16px;
    font-size: 0.84rem;
    font-weight: 700;
    border-radius: 50px;
    border: 1.5px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    box-sizing: border-box;
}

.news-filter-chip i {
    font-size: 0.82rem;
    color: var(--accent);
    transition: color var(--transition-fast);
}

.news-filter-chip:hover:not(.active) {
    background: rgba(5, 150, 105, 0.12);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.news-filter-chip.active {
    background: var(--accent) !important;
    color: #ffffff !important;
    border-color: var(--accent) !important;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
    transform: translateY(-1px);
}

.news-filter-chip.active i {
    color: #ffffff !important;
}

@media (max-width: 900px) {
    .news-filter-bar {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding: 4px 6px 12px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    .news-filter-chip {
        flex-shrink: 0;
        padding: 7px 13px;
        font-size: 0.8rem;
    }
}

/* ==========================================================================
   MODAL DE RESTABLECER CONTRASEÑA CON CAPTCHA ANTI-BOTS
   ========================================================================== */
.recovery-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100002;
    padding: 16px;
    box-sizing: border-box;
}

.recovery-modal-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    width: 100%;
    max-width: 480px;
    padding: 32px 30px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.35);
    color: #0f172a;
    box-sizing: border-box;
    position: relative;
    animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.recovery-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
    line-height: 1.25;
}

.recovery-subtitle {
    font-size: 0.92rem;
    color: #64748b;
    line-height: 1.5;
    margin: 0 0 24px 0;
}

.recovery-input-group {
    margin-bottom: 20px;
}

.recovery-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.recovery-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.recovery-input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 1.1rem;
    pointer-events: none;
    z-index: 5;
}

.recovery-input-wrapper input.recovery-input,
.recovery-input-wrapper input[type="text"].recovery-input,
.recovery-input-wrapper input[type="email"].recovery-input,
.recovery-input-wrapper input[type="password"].recovery-input,
.recovery-modal-card input.recovery-input {
    width: 100% !important;
    padding: 13px 16px 13px 48px !important;
    border-radius: 12px !important;
    border: 1.5px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    box-sizing: border-box !important;
    transition: all var(--transition-fast) !important;
}

.recovery-modal-card input.recovery-input::placeholder {
    color: #94a3b8 !important;
    font-weight: 500 !important;
}

.recovery-modal-card input.recovery-input:focus {
    outline: none !important;
    border-color: #059669 !important;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.18) !important;
}

/* Caja de Verificación de Seguridad */
.recovery-security-box {
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 16px;
    padding: 16px 18px;
    margin-bottom: 24px;
    box-sizing: border-box;
}

.recovery-security-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.recovery-security-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.recovery-badge-antibots {
    background: #fee2e2;
    color: #dc2626;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 50px;
    letter-spacing: 0.2px;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.recovery-captcha-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.recovery-captcha-canvas-wrapper {
    flex: 1;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.04);
}

.recovery-captcha-canvas {
    width: 100%;
    height: 100%;
    cursor: default;
    user-select: none;
}

.recovery-captcha-reload-btn {
    width: 54px;
    height: 60px;
    border-radius: 12px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #64748b;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    box-sizing: border-box;
}

.recovery-captcha-reload-btn:hover {
    background: #f1f5f9;
    color: #059669;
    border-color: #059669;
    transform: rotate(30deg);
}

.recovery-help-text {
    font-size: 0.76rem;
    color: #64748b;
    margin: 6px 0 0 2px;
    display: block;
}

/* Botón Principal */
.recovery-submit-btn {
    width: 100%;
    padding: 14px 20px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #059669, #047857);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(5, 150, 105, 0.35);
}

.recovery-submit-btn:hover {
    background: linear-gradient(135deg, #047857, #065f46);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.45);
}

.recovery-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color var(--transition-fast);
}

.recovery-close-btn:hover {
    color: #0f172a;
}

/* ==========================================================================
   MODAL DE IMPORTACIÓN DE NOTICIAS DESDE FACEBOOK
   ========================================================================== */
.fb-import-modal-card {
    background: #0f172a;
    border: 1.5px solid #334155;
    border-radius: 20px;
    width: 100%;
    max-width: 860px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7);
    color: #ffffff;
    overflow: hidden;
    position: relative;
    animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.fb-import-header {
    padding: 20px 24px;
    border-bottom: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1e293b;
}

.fb-import-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
}

.fb-post-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all var(--transition-fast);
}

.fb-post-card:hover {
    border-color: #1877f2;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(24, 119, 242, 0.15);
}

.fb-post-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 10px;
    background: #0b1120;
}

.fb-post-text {
    font-size: 0.86rem;
    color: #cbd5e1;
    line-height: 1.5;
    max-height: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

.fb-post-meta {
    font-size: 0.76rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 768px) {
    .fb-import-body {
        grid-template-columns: 1fr;
        padding: 14px;
    }
}

/* ==========================================================================
   BANNER SLIDER: NOTICIAS DESTACADAS Y ANUNCIOS (PROPAGANDA COMUNAL)
   ========================================================================== */

.novedades-top-badge-wrapper {
    text-align: center;
    margin: -32px 0 16px 0;
    position: relative;
    z-index: 10;
}

.novedades-top-badge {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
    font-weight: 800;
    font-size: 0.82rem;
    padding: 6px 20px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border: 1px solid rgba(16, 185, 129, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.destacados-slider-section {
    position: relative;
    z-index: 10;
    width: 100%;
    margin: 0 0 35px 0;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.45);
    background: #080d1a;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.destacados-slider-wrapper {
    position: relative;
    width: 100%;
    height: 440px;
    overflow: hidden;
}

.destacados-loading-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.95rem;
}

.destacados-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.75s cubic-bezier(0.4, 0, 0.2, 1), transform 0.75s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(1.01);
}

.destacados-slide.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    z-index: 2;
}

/* Fondo difuminado ambiental que replica los tonos y formas de la foto */
.destacados-slide-ambient {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background-size: cover;
    background-position: center;
    filter: blur(12px) brightness(0.88) saturate(1.3);
    -webkit-filter: blur(12px) brightness(0.88) saturate(1.3);
    opacity: 0.95;
    z-index: 1;
    transform: scale(1.05);
    transition: transform 6s ease-out;
}

.destacados-slide.active .destacados-slide-ambient {
    transform: scale(1.12);
}

.destacados-slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(8, 13, 26, 0.88) 0%, rgba(8, 13, 26, 0.4) 48%, rgba(8, 13, 26, 0.1) 100%);
    z-index: 2;
}

/* Grid de 2 Columnas: Info a la izquierda, Foto Nítida Completa a la derecha */
.destacados-slide-grid {
    position: relative;
    z-index: 3;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 35px;
    padding: 35px 50px;
    align-items: center;
}

.destacados-info-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
    max-width: 580px;
}

.destacados-badges-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.destacados-badge-category {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 5px 14px;
    border-radius: 50px;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
    text-transform: uppercase;
}

.destacados-badge-date {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #e2e8f0;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.destacados-slide-title {
    color: #ffffff;
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.3;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
    cursor: pointer;
}

.destacados-slide-title:hover {
    color: #34d399;
}

.destacados-slide-snippet {
    color: rgba(241, 245, 249, 0.88);
    font-size: 0.92rem;
    line-height: 1.55;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.destacados-actions-row {
    margin-top: 4px;
}

.destacados-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.9rem;
    padding: 11px 24px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
}

.destacados-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.55);
}

/* Columna de la Foto Completa Nítida Flotante */
.destacados-media-col {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    cursor: pointer;
}

.destacados-photo-frame {
    position: relative;
    width: 100%;
    height: 100%;
    max-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
}

.destacados-photo-img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 360px;
    object-fit: contain;
    border-radius: 12px;
    display: block;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.destacados-media-col:hover .destacados-photo-img {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 20px 42px rgba(0, 0, 0, 0.75);
}

.destacados-video-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(239, 68, 68, 0.95);
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.76rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* Flechas y Controles de Navegación */
.destacados-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s, transform 0.2s, border-color 0.2s;
}

.destacados-nav-btn:hover {
    background: rgba(16, 185, 129, 0.9);
    border-color: #10b981;
    transform: translateY(-50%) scale(1.1);
}

.destacados-nav-btn.prev {
    left: 16px;
}

.destacados-nav-btn.next {
    right: 16px;
}

.destacados-dots-container {
    position: absolute;
    bottom: 14px;
    left: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.destacados-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.destacados-dot.active {
    width: 28px;
    border-radius: 20px;
    background: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

@media (max-width: 900px) {
    .destacados-slider-wrapper {
        height: auto;
        min-height: 520px;
    }
    .destacados-slide-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 25px 25px 40px;
    }
    .destacados-media-col {
        order: -1;
        max-height: 240px;
    }
    .destacados-photo-frame {
        max-height: 240px;
    }
    .destacados-photo-img {
        max-height: 240px;
    }
    .destacados-slide-title {
        font-size: 1.35rem;
    }
    .destacados-dots-container {
        left: 25px;
        bottom: 12px;
    }
}

@media (max-width: 768px) {
    .destacados-slider-section {
        margin: -10px 0 25px 0;
    }
    .destacados-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
}

/* ==========================================================================
   WIDGET: INSTAGRAM OFICIAL DE LA MUNICIPALIDAD DE ERCILLA
   ========================================================================== */

.instagram-icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: #ffffff;
    font-size: 1.15rem;
}

.instagram-follow-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(220, 39, 67, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.instagram-follow-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 39, 67, 0.45);
}

.instagram-feed-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 20px;
    gap: 16px;
}

.instagram-profile-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.instagram-avatar-wrapper {
    position: relative;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.instagram-avatar-wrapper:hover {
    transform: scale(1.05);
}

.instagram-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: contain;
    background: #0f172a;
    display: block;
}

.instagram-profile-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.instagram-handle-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.instagram-handle {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--text-main);
}

.instagram-stats-row {
    display: flex;
    gap: 16px;
    font-size: 0.82rem;
    color: var(--text-main);
    margin: 2px 0;
}

.instagram-stats-row strong {
    font-weight: 800;
    color: var(--text-main);
}

.instagram-bio-block {
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--text-main);
    margin-top: 2px;
}

.instagram-fullname {
    font-weight: 700;
    display: block;
    color: var(--text-main);
}

.instagram-bio {
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--text-muted);
    margin: 2px 0;
}

.instagram-bio-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #38bdf8;
    font-size: 0.76rem;
    font-weight: 700;
    text-decoration: none;
}

.instagram-bio-link:hover {
    text-decoration: underline;
}

/* Historias Destacadas */
.instagram-stories-bar {
    display: flex;
    gap: 14px;
    padding: 4px 0;
    margin: -4px 0 2px;
}

.instagram-story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.instagram-story-item:hover {
    transform: scale(1.06);
}

.instagram-story-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.instagram-story-circle img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: #0f172a;
    display: block;
}

.instagram-story-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
}

.instagram-cta-bar {
    width: 100%;
}

.instagram-main-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 9px 16px;
    font-size: 0.84rem;
    font-weight: 700;
    border-radius: 8px;
    color: #ffffff;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(220, 39, 67, 0.25);
    transition: transform 0.2s, box-shadow 0.2s;
}

.instagram-main-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(220, 39, 67, 0.4);
}

/* Tabs Bar */
.instagram-tabs-bar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 4px 0;
    margin: 2px 0;
}

.instagram-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.05rem;
    padding: 6px 20px;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    border-bottom: 2px solid transparent;
}

.instagram-tab-btn.active {
    color: #f09433;
    border-bottom-color: #f09433;
}

.instagram-tab-btn:hover {
    color: var(--text-main);
    transform: scale(1.1);
}

/* Grid de 6 a 9 Fotos */
.instagram-visual-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 4px;
}

.instagram-grid-item {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* Aspect 1:1 square */
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.instagram-item-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.3s ease;
}

.instagram-grid-item:hover .instagram-item-inner {
    transform: scale(1.06);
}

.instagram-post-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    color: #ffffff;
    font-size: 0.8rem;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
    z-index: 2;
}

.instagram-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.58);
    opacity: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
    padding: 6px;
    transition: opacity 0.2s ease;
    z-index: 3;
}

.instagram-grid-item:hover .instagram-item-overlay {
    opacity: 1;
}

.instagram-item-overlay i {
    font-size: 1.2rem;
}

.instagram-grid-item:hover .instagram-item-overlay {
    opacity: 1;
}


