/* ==========================================
   SUPREMO CONSEJO GRADO 33° - ESTILOS
   ========================================== */

/* Variables CSS */
:root {
    /* Colores Primarios */
    --color-primary: #6b2d8f;
    --color-secondary: #8e44ad;
    --color-accent: #9b59b6;
    --color-dark-purple: #4a1e5f;
    --color-light-purple: #a772c4;

    /* Colores Complementarios */
    --color-dark: #1a1a2e;
    --color-medium-dark: #2c3e50;
    --color-light: #ecf0f1;
    --color-gold: #d4af37;
    --color-gold-light: #f4d03f;
    --color-white: #ffffff;

    /* Gradientes */
    --gradient-primary: linear-gradient(135deg, #6b2d8f 0%, #8e44ad 50%, #9b59b6 100%);
    --gradient-dark: linear-gradient(135deg, #1a1a2e 0%, #2c3e50 100%);
    --gradient-gold: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
    --gradient-overlay: linear-gradient(135deg, rgba(107, 45, 143, 0.95) 0%, rgba(142, 68, 173, 0.90) 100%);

    /* Sombras */
    --shadow-sm: 0 2px 15px rgba(107, 45, 143, 0.15);
    --shadow-md: 0 5px 25px rgba(107, 45, 143, 0.25);
    --shadow-lg: 0 10px 40px rgba(107, 45, 143, 0.35);
    --shadow-xl: 0 20px 60px rgba(107, 45, 143, 0.45);

    /* Tipografías */
    --font-title: 'Cinzel', serif;
    --font-body: 'Cormorant Garamond', serif;
    --font-system: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

    /* Transiciones */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.4s ease;
    --transition-slow: 0.6s ease;
}

/* Reset y Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    line-height: 1.7;
    color: var(--color-dark);
    background: var(--color-light);
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
}

/* Particles background - prevent overflow */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    overflow: hidden;
}

.container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    overflow-x: hidden;
}

/* Touch-friendly elements */
button, a, input, select, textarea {
    -webkit-tap-highlight-color: rgba(107, 45, 143, 0.2);
    touch-action: manipulation;
}

button, a {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Mejora para scroll en móviles */
@media (hover: none) and (pointer: coarse) {
    * {
        -webkit-overflow-scrolling: touch;
    }

    button:active, a:active {
        opacity: 0.8;
    }
}

img {
    max-width: 100%;
    height: auto;
}

/* ==========================================
   HEADER
   ========================================== */

.header {
    background: linear-gradient(135deg, rgba(107, 45, 143, 0.95) 0%, rgba(142, 68, 173, 0.95) 100%);
    padding: 1.2rem 0;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all var(--transition-normal);
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.header.scrolled {
    padding: 0.8rem 0;
    background: rgba(107, 45, 143, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 1.5rem;
}

/* Logo */
.logo-container {
    flex: 0 0 auto;
}

.logo-wrapper {
    position: relative;
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.6)) contrast(1.1) saturate(1.1);
    transition: all var(--transition-slow);
    position: relative;
    z-index: 2;
    border-radius: 50%;
    clip-path: circle(48% at 50% 50%);
    background: radial-gradient(circle, rgba(212,175,55,0.1) 0%, transparent 70%);
    padding: 3px;
    animation: logo-breathe 4s ease-in-out infinite;
}

.logo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--color-gold) 0%, transparent 70%);
    opacity: 0.2;
    transition: opacity var(--transition-slow);
    animation: pulse-glow 3s infinite;
    border-radius: 50%;
}

.logo-wrapper:hover .logo {
    transform: scale(1.08);
    filter: drop-shadow(0 0 25px rgba(212, 175, 55, 1)) contrast(1.1) saturate(1.1);
}

.logo-wrapper:hover .logo-glow {
    opacity: 0.4;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.2; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.4; transform: translate(-50%, -50%) scale(1.1); }
}

@keyframes logo-breathe {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.6)) contrast(1.1) saturate(1.1);
    }
    50% {
        transform: scale(1.03);
        filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.8)) contrast(1.1) saturate(1.1);
    }
}

/* Navegación */
.nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-list a {
    color: var(--color-white);
    text-decoration: none;
    font-weight: 600;
    font-family: var(--font-title);
    transition: all var(--transition-normal);
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-list a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left var(--transition-slow);
}

.nav-list a:hover::before {
    left: 100%;
}

.nav-list a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.nav-list a i,
.nav-list a img.icon-eagle {
    margin-right: 0.4rem;
    vertical-align: middle;
    line-height: 1;
}

.btn-login {
    background: var(--gradient-gold) !important;
    color: var(--color-dark) !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

.btn-login:hover {
    background: var(--color-white) !important;
    transform: translateY(-3px) scale(1.05) !important;
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.5) !important;
}

/* Redes Sociales Header */
.social-header {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.social-header a {
    color: var(--color-white);
    font-size: 1.6rem;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.social-header a::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--color-gold);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all var(--transition-normal);
}

.social-header a:hover::before {
    width: 100%;
    height: 100%;
}

.social-header a:hover {
    transform: translateY(-5px) rotate(10deg) scale(1.2);
}

.social-header a i {
    position: relative;
    z-index: 1;
}

/* ==========================================
   HERO SECTION
   ========================================== */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-white);
    overflow: hidden;
    perspective: 1000px;
}

/* Fondo con Águila */
.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.hero-eagle-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../images/aguila-bicefala.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.15;
    filter: brightness(1.3) contrast(1.2) sepia(0.3) hue-rotate(260deg);
    animation: eagle-float 20s ease-in-out infinite;
}

@keyframes eagle-float {
    0%, 100% { transform: scale(1) translateY(0); }
    50% { transform: scale(1.05) translateY(-20px); }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-overlay);
    z-index: 2;
}

.geometric-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 15px, rgba(255, 255, 255, 0.02) 15px, rgba(255, 255, 255, 0.02) 30px),
        repeating-linear-gradient(-45deg, transparent, transparent 15px, rgba(255, 255, 255, 0.02) 15px, rgba(255, 255, 255, 0.02) 30px);
    animation: pattern-move 30s linear infinite;
}

@keyframes pattern-move {
    0% { transform: translate(0, 0); }
    100% { transform: translate(60px, 60px); }
}

.hero-content {
    position: relative;
    z-index: 4;
    padding: 3rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-text-wrapper {
    animation: hero-appear 1.5s ease;
}

@keyframes hero-appear {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title {
    font-family: var(--font-title);
    font-size: 4.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    text-shadow: 0 5px 30px rgba(0, 0, 0, 0.7);
    letter-spacing: 3px;
    line-height: 1.2;
}

.title-line {
    display: block;
    animation: title-slide-in 1s ease;
}

.title-line-1 {
    animation-delay: 0.3s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.title-line-2 {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation-delay: 0.6s;
    opacity: 0;
    animation-fill-mode: forwards;
    font-size: 5rem;
}

@keyframes title-slide-in {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.hero-subtitle {
    font-family: var(--font-title);
    font-size: 2rem;
    font-weight: 500;
    margin-bottom: 2rem;
    text-shadow: 0 3px 20px rgba(0, 0, 0, 0.6);
    letter-spacing: 1.5px;
    line-height: 1.5;
}

.subtitle-line {
    display: block;
    animation: subtitle-fade-in 1s ease;
    font-style: italic;
}

.subtitle-line:first-child {
    animation-delay: 0.9s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.subtitle-line:last-child {
    animation-delay: 1.2s;
    opacity: 0;
    animation-fill-mode: forwards;
}

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

.hero-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 2rem 0;
    animation: divider-expand 1s ease 1.5s both;
    min-height: 50px;
}

@keyframes divider-expand {
    from {
        opacity: 0;
        transform: scaleX(0);
    }
    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

.divider-line {
    width: 120px;
    height: 2px;
    background: var(--gradient-gold);
    flex-shrink: 0;
    align-self: center;
    margin: 0 1.5rem;
}

.hero-divider i {
    font-size: 1.5rem;
    color: var(--color-gold);
    animation: star-rotate 4s linear infinite;
}

.hero-divider-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.6));
    animation: icon-pulse 3s ease-in-out infinite;
    display: block;
    flex-shrink: 0;
    margin: 0 0 0 48px;
    padding: 0;
    align-self: center;
}

@keyframes star-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes icon-pulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.6));
    }
    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.9));
    }
}

.hero-date {
    font-size: 1.4rem;
    font-weight: 600;
    font-family: var(--font-title);
    color: var(--color-gold-light);
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.5);
    animation: date-pulse 2s ease-in-out infinite;
    letter-spacing: 1px;
}

@keyframes date-pulse {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 1; transform: scale(1.02); }
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll-bounce 2s infinite;
}

@keyframes scroll-bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

.mouse {
    width: 30px;
    height: 50px;
    border: 3px solid var(--color-white);
    border-radius: 20px;
    position: relative;
    margin: 0 auto 10px;
}

.wheel {
    width: 6px;
    height: 10px;
    background: var(--color-gold);
    border-radius: 3px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: wheel-scroll 2s infinite;
}

@keyframes wheel-scroll {
    0% { opacity: 1; top: 8px; }
    100% { opacity: 0; top: 28px; }
}

.arrow {
    text-align: center;
}

.arrow span {
    display: block;
    width: 10px;
    height: 10px;
    border-bottom: 3px solid var(--color-white);
    border-right: 3px solid var(--color-white);
    transform: rotate(45deg);
    margin: -6px auto;
    animation: arrow-move 2s infinite;
}

.arrow span:nth-child(2) {
    animation-delay: 0.2s;
}

@keyframes arrow-move {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* ==========================================
   SECTION TITLES
   ========================================== */

.section-title {
    text-align: center;
    font-family: var(--font-title);
    font-size: 2.8rem;
    color: var(--color-primary);
    margin-bottom: 4rem;
    position: relative;
    padding-bottom: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 0 2px 20px rgba(107, 45, 143, 0.15);
}

.section-title.light {
    color: var(--color-white);
}

.title-icon {
    display: inline-block;
    margin-right: 1rem;
    color: var(--color-gold);
    font-size: 3rem;
    vertical-align: middle;
    animation: icon-bounce 2s infinite;
}

@keyframes icon-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.title-underline {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.title-underline::before,
.title-underline::after {
    content: '';
    position: absolute;
    top: -8px;
    width: 12px;
    height: 12px;
    background: var(--color-gold);
    border-radius: 50%;
}

.title-underline::before {
    left: -20px;
}

.title-underline::after {
    right: -20px;
}

.title-underline.light {
    background: var(--gradient-gold);
}

/* Background Pattern for Sections */
.section-bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.03;
    background-image:
        radial-gradient(circle at 20% 50%, var(--color-primary) 1px, transparent 1px),
        radial-gradient(circle at 80% 50%, var(--color-primary) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 0;
}

.section-bg-pattern.dark {
    opacity: 0.1;
    background-image:
        radial-gradient(circle at 20% 50%, var(--color-gold) 1px, transparent 1px),
        radial-gradient(circle at 80% 50%, var(--color-gold) 1px, transparent 1px);
}

/* ==========================================
   RITO ESCOCÉS SECTION
   ========================================== */

.rito-section {
    padding: 6rem 0;
    background: var(--color-white);
    position: relative;
}

/* Imagen de fondo para todas las secciones */
.hero::before,
.rito-section::before,
.grados-section::before,
.historia-section::before,
.autoridades-section::before,
.area-reservada-section::before,
.contacto-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/deus-meumque-jus.png');
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0.15;
    z-index: 0;
    pointer-events: none;
}

.rito-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    position: relative;
    z-index: 1;
}

.rito-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(107, 45, 143, 0.1);
    transition: all var(--transition-slow);
    border: 1px solid rgba(107, 45, 143, 0.1);
    position: relative;
    overflow: hidden;
}

.rito-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform var(--transition-slow);
}

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

.rito-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 60px rgba(107, 45, 143, 0.2);
    border-color: rgba(155, 89, 182, 0.3);
}

.rito-card.full-width {
    grid-column: 1 / -1;
}

.card-icon {
    font-size: 4rem;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    text-align: center;
    position: relative;
    display: inline-block;
    width: 100%;
}

.icon-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, var(--color-accent) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-slow);
    border-radius: 50%;
}

.rito-card:hover .icon-bg {
    opacity: 0.15;
    animation: icon-pulse 2s infinite;
}

@keyframes icon-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
}

.rito-card h3 {
    color: var(--color-primary);
    font-family: var(--font-title);
    font-size: 1.8rem;
    margin-bottom: 1.2rem;
    text-align: center;
    font-weight: 700;
}

.rito-card p {
    color: var(--color-medium-dark);
    text-align: justify;
    line-height: 1.9;
    font-size: 1.1rem;
}

.card-shine {
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transform: rotate(45deg);
    transition: all 0.7s;
    opacity: 0;
}

.rito-card:hover .card-shine {
    right: -150%;
    opacity: 1;
}

/* ==========================================
   GRADOS SECTION
   ========================================== */

.grados-section {
    padding: 6rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%, #f0f2f5 100%);
    position: relative;
    overflow: hidden;
}

.grados-intro {
    text-align: center;
    max-width: 900px;
    margin: 0 auto 4rem;
    font-size: 1.3rem;
    color: var(--color-medium-dark);
    line-height: 1.8;
}

.grados-groups {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    position: relative;
    z-index: 1;
}

.grado-group {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 28px;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(107, 45, 143, 0.15);
    border: 2px solid rgba(107, 45, 143, 0.2);
    transition: all var(--transition-slow);
    position: relative;
    overflow: hidden;
}

.grado-group::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(107, 45, 143, 0.05), transparent);
    transition: left 0.8s;
}

.grado-group:hover::before {
    left: 100%;
}

.grado-group:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 20px 60px rgba(107, 45, 143, 0.25);
}

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

.group-header h3 {
    font-family: var(--font-title);
    font-size: 2.2rem;
    color: var(--color-primary);
    margin-bottom: 0.8rem;
    font-weight: 700;
}

.group-header h3 i {
    margin-right: 1rem;
    color: var(--color-gold);
}

.group-subtitle {
    font-size: 1.3rem;
    color: var(--color-accent);
    font-style: italic;
    font-weight: 600;
}

.grados-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.2rem;
}

.grado-item {
    background: rgba(248, 249, 250, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 1.2rem 1.5rem;
    border-radius: 16px;
    border-left: 4px solid var(--color-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-medium-dark);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.grado-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.grado-item:hover::before {
    opacity: 0.1;
}

.grado-item:hover {
    transform: translateX(8px) translateY(-2px);
    box-shadow: 0 8px 24px rgba(107, 45, 143, 0.2);
    border-left-width: 6px;
}

.grado-item.special {
    background: linear-gradient(135deg, rgba(232, 213, 242, 0.95) 0%, rgba(243, 232, 255, 0.95) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-left-color: var(--color-accent);
    font-weight: 700;
    color: var(--color-primary);
    box-shadow: 0 6px 20px rgba(155, 89, 182, 0.25);
    border: 1px solid rgba(155, 89, 182, 0.2);
}


/* ==========================================
   HISTORIA SECTION
   ========================================== */

.historia-section {
    padding: 6rem 0;
    background: var(--color-white);
    position: relative;
}

.historia-intro {
    max-width: 1000px;
    margin: 0 auto 4rem;
    padding: 2.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    border-left: 5px solid var(--color-primary);
}

.historia-intro h3 {
    color: var(--color-primary);
    font-family: var(--font-title);
    font-size: 2rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    text-align: center;
}

.historia-intro p {
    color: var(--color-medium-dark);
    font-size: 1.2rem;
    line-height: 2;
    text-align: justify;
}

.timeline {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--gradient-primary);
    transform: translateX(-50%);
}

.timeline-item {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
    position: relative;
    align-items: center;
}

.timeline-marker {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 25px;
    height: 25px;
    background: var(--color-gold);
    border: 5px solid var(--color-white);
    border-radius: 50%;
    box-shadow: 0 0 0 5px var(--color-primary);
    z-index: 2;
    animation: marker-pulse 2s infinite;
}

@keyframes marker-pulse {
    0%, 100% {
        box-shadow: 0 0 0 5px var(--color-primary);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(107, 45, 143, 0.5);
    }
}

.timeline-date {
    text-align: right;
    padding: 1.5rem 2rem;
    background: var(--gradient-primary);
    color: var(--color-white);
    border-radius: 15px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
}

.timeline-item:nth-child(even) .timeline-date {
    grid-column: 3;
    text-align: left;
}

.timeline-date:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.timeline-date .year {
    display: block;
    font-family: var(--font-title);
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
}

.timeline-date .month {
    display: block;
    font-size: 1.1rem;
    opacity: 0.9;
    font-style: italic;
}

.timeline-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(107, 45, 143, 0.12),
                inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    border: 2px solid rgba(107, 45, 143, 0.15);
    grid-column: 3;
}

.timeline-item:nth-child(even) .timeline-content {
    grid-column: 1;
}

.timeline-content:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 50px rgba(107, 45, 143, 0.2),
                0 8px 24px rgba(0, 0, 0, 0.08),
                inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border-color: rgba(212, 175, 55, 0.5);
}

.timeline-content h3 {
    color: var(--color-primary);
    font-family: var(--font-title);
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.timeline-content p {
    line-height: 1.9;
    color: var(--color-medium-dark);
    font-size: 1.1rem;
}

/* ==========================================
   AUTORIDADES SECTION
   ========================================== */

.autoridades-section {
    padding: 6rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
}

.autoridades-intro {
    text-align: center;
    max-width: 900px;
    margin: 0 auto 4rem;
    font-size: 1.3rem;
    color: var(--color-medium-dark);
    line-height: 1.8;
}

.autoridades-section-title {
    font-family: var(--font-title);
    font-size: 2.5rem;
    color: var(--color-primary);
    text-align: center;
    margin: 3rem 0 2rem;
    font-weight: 700;
}

.autoridades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    position: relative;
    z-index: 1;
}

.autoridad-card {
    background: linear-gradient(145deg, rgba(107, 45, 143, 0.95), rgba(142, 68, 173, 0.95));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--color-white);
    padding: 2.5rem 2rem;
    border-radius: 28px;
    text-align: center;
    box-shadow: 0 15px 45px rgba(107, 45, 143, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform-style: preserve-3d;
}

.autoridad-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: card-rotate 6s linear infinite;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.autoridad-card:hover::before {
    opacity: 1;
}

@keyframes card-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.autoridad-card:hover {
    transform: translateY(-12px) scale(1.03) rotateX(5deg);
    box-shadow: 0 25px 70px rgba(107, 45, 143, 0.4),
                0 10px 30px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.autoridad-card:hover .autoridad-icon {
    transform: translateY(-5px) scale(1.1) rotateY(360deg);
    box-shadow: 0 15px 45px rgba(212, 175, 55, 0.4);
}

.autoridad-card:hover .icon-autoridad {
    transform: scale(1.1);
    filter: brightness(12) contrast(2.2) drop-shadow(0 8px 24px rgba(255, 255, 255, 0.7));
}

.autoridad-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: var(--color-gold);
    position: relative;
    display: inline-block;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    background: linear-gradient(145deg, rgba(212, 175, 55, 0.15), rgba(244, 208, 63, 0.1));
    border-radius: 50%;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(212, 175, 55, 0.2),
                inset 0 2px 8px rgba(255, 255, 255, 0.1);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    border: 2px solid rgba(212, 175, 55, 0.2);
}

.autoridad-icon i {
    position: relative;
    z-index: 2;
}

.icon-autoridad {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: brightness(10) contrast(2) drop-shadow(0 4px 12px rgba(255, 255, 255, 0.5));
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.autoridad-icon-removed {
    display: none;
}

/* Iconos de águila bicéfala */
img.icon-eagle {
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    display: inline-block;
    vertical-align: middle;
}

.autoridad-icon img.icon-eagle,
.title-icon img.icon-eagle {
    width: 5rem;
    height: 5rem;
}

.title-icon img.icon-eagle {
    width: 3rem;
    height: 3rem;
    margin-bottom: 0.3rem;
}

nav img.icon-eagle {
    width: 1.94rem;
    height: 1.94rem;
    margin-right: -0.3rem;
    display: inline-block;
    flex-shrink: 0;
    vertical-align: middle;
    position: relative;
    top: 0;
}

.group-header h3 img.icon-eagle {
    width: 2.2rem;
    height: 2.2rem;
    vertical-align: middle;
    margin-right: 0.8rem;
    position: relative;
    top: 0;
}

.icon-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, var(--color-gold) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-slow);
    border-radius: 50%;
}

.autoridad-card:hover .icon-glow {
    opacity: 0.4;
    animation: glow-pulse 2s infinite;
}

@keyframes glow-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.4; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.6; }
}

.autoridad-card h3 {
    font-family: var(--font-title);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.autoridad-info,
.autoridad-nombre {
    opacity: 0.95;
    font-style: italic;
    font-size: 1.1rem;
    position: relative;
    z-index: 1;
}

.autoridad-nombre {
    font-weight: 600;
    font-size: 1.25rem;
}

.card-decoration {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--gradient-gold);
}

/* ==========================================
   ÁREA RESERVADA SECTION
   ========================================== */

.area-reservada-section {
    padding: 6rem 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #2c3e50 50%, #1a1a2e 100%);
    position: relative;
    overflow: hidden;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 3.5rem;
    border-radius: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    max-width: 550px;
    width: 100%;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(212, 175, 55, 0.3);
}

.login-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(107, 45, 143, 0.05), transparent);
    animation: login-rotate 8s linear infinite;
}

@keyframes login-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 1;
}

.lock-icon {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.lock-icon i {
    font-size: 5rem;
    color: var(--color-primary);
    animation: lock-shake 5s infinite;
}

@keyframes lock-shake {
    0%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(-10deg); }
    20%, 40% { transform: rotate(10deg); }
    50% { transform: rotate(0deg); }
}

.lock-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, var(--color-primary) 0%, transparent 70%);
    opacity: 0.2;
    animation: lock-pulse 3s infinite;
    border-radius: 50%;
}

@keyframes lock-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.2; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.4; }
}

.login-header h3 {
    color: var(--color-primary);
    font-family: var(--font-title);
    font-size: 2.3rem;
    margin-bottom: 0.8rem;
    font-weight: 700;
}

.login-header p {
    color: var(--color-medium-dark);
    font-size: 1.1rem;
    opacity: 0.9;
}

.form-group {
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.form-group label {
    display: block;
    color: var(--color-dark);
    font-weight: 700;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    font-family: var(--font-title);
}

.form-group label i {
    color: var(--color-primary);
    margin-right: 0.6rem;
}

.form-group input {
    width: 100%;
    padding: 1.2rem 1.5rem;
    border: 2px solid rgba(107, 45, 143, 0.15);
    border-radius: 16px;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    font-family: var(--font-body);
    background: rgba(248, 249, 250, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 4px rgba(107, 45, 143, 0.1),
                0 8px 24px rgba(107, 45, 143, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.btn-submit {
    width: 100%;
    padding: 1.3rem 2rem;
    background: linear-gradient(145deg, rgba(107, 45, 143, 0.95), rgba(142, 68, 173, 0.95));
    color: var(--color-white);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: var(--font-title);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 8px 32px rgba(107, 45, 143, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    z-index: 1;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-text {
    position: relative;
    z-index: 2;
}

.btn-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-submit:hover .btn-ripple {
    width: 500px;
    height: 500px;
}

.btn-submit:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 50px rgba(107, 45, 143, 0.4),
                0 8px 24px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    background: linear-gradient(145deg, rgba(142, 68, 173, 0.98), rgba(155, 89, 182, 0.98));
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-submit:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 5px 20px rgba(107, 45, 143, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.login-message {
    margin-top: 1.5rem;
    padding: 1.2rem;
    border-radius: 15px;
    text-align: center;
    font-weight: 700;
    display: none;
    position: relative;
    z-index: 1;
    animation: message-slide-in 0.5s ease;
}

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

.login-message.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 2px solid #28a745;
    display: block;
}

.login-message.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 2px solid #dc3545;
    display: block;
}

/* ==========================================
   CONTACTO SECTION
   ========================================== */

.contacto-section {
    padding: 6rem 0;
    background: var(--color-white);
    position: relative;
}

.contacto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 3rem;
    position: relative;
    z-index: 1;
}

.contacto-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 3rem 2rem;
    border-radius: 28px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(107, 45, 143, 0.1);
    transition: all var(--transition-slow);
    border: 1px solid rgba(107, 45, 143, 0.15);
    position: relative;
    overflow: hidden;
}

.contacto-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.contacto-card:hover::before {
    opacity: 0.05;
}

.contacto-card:hover {
    transform: translateY(-12px) scale(1.03) rotate(-1deg);
    box-shadow: 0 20px 60px rgba(107, 45, 143, 0.2),
                0 10px 30px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border-color: rgba(155, 89, 182, 0.3);
}

.contacto-icon {
    font-size: 4.5rem;
    color: var(--color-primary);
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

.icon-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    border: 3px solid var(--color-primary);
    border-radius: 50%;
    opacity: 0;
    transition: all var(--transition-slow);
}

.contacto-card:hover .icon-circle {
    opacity: 0.3;
    transform: translate(-50%, -50%) scale(1.2) rotate(180deg);
}

.contacto-card h3 {
    color: var(--color-primary);
    font-family: var(--font-title);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.contacto-card p {
    color: var(--color-medium-dark);
    line-height: 1.6;
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
    position: relative;
    z-index: 1;
    font-weight: 600;
}

.contacto-card a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-normal);
    font-weight: 600;
}

.contacto-card a:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

.card-border {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform var(--transition-slow);
}

.contacto-card:hover .card-border {
    transform: scaleX(1);
}

/* ==========================================
   FOOTER
   ========================================== */

.footer {
    background: var(--gradient-primary);
    color: var(--color-white);
    padding: 4rem 0 2rem;
    position: relative;
    overflow: hidden;
}

.footer-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--gradient-gold);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 3rem;
    position: relative;
    z-index: 1;
}

.footer-logo {
    flex: 0 0 auto;
}

.footer-logo .logo-wrapper {
    width: 100px;
    height: 100px;
}

.footer-info {
    flex: 1;
    text-align: center;
    min-width: 300px;
}

.footer-info h3 {
    font-family: var(--font-title);
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
    font-weight: 800;
    letter-spacing: 2px;
}

.footer-subtitle {
    font-size: 1.2rem;
    margin: 0.5rem 0;
    opacity: 0.95;
    font-style: italic;
}

.footer-divider {
    width: 150px;
    height: 3px;
    background: var(--gradient-gold);
    margin: 1.5rem auto;
}

.footer-copy,
.footer-date {
    margin: 0.8rem 0;
    opacity: 0.9;
}

.footer-date {
    font-weight: 700;
    color: var(--color-gold-light);
    font-size: 1.1rem;
}

.footer-social {
    flex: 0 0 auto;
    text-align: center;
}

.footer-social h4 {
    margin-bottom: 1.5rem;
    font-family: var(--font-title);
    font-size: 1.3rem;
}

.social-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.social-link {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-white);
    text-decoration: none;
}

.social-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all var(--transition-normal);
}

.social-link.facebook::before {
    background: #1877f2;
}

.social-link.instagram::before {
    background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%);
}

.social-link:hover::before {
    width: 100%;
    height: 100%;
}

.social-link:hover {
    transform: translateY(-8px) scale(1.15) rotate(360deg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.social-link i {
    position: relative;
    z-index: 1;
}

.social-tooltip {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-dark);
    color: var(--color-white);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-normal);
}

.social-link:hover .social-tooltip {
    opacity: 1;
    bottom: -35px;
}

/* ==========================================
   SCROLL TO TOP BUTTON
   ========================================== */

.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(145deg, rgba(107, 45, 143, 0.95), rgba(142, 68, 173, 0.95));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--color-white);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(107, 45, 143, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    opacity: 0;
    visibility: hidden;
    z-index: 999;
}

.scroll-top.show {
    opacity: 1;
    visibility: visible;
    animation: bounce-in 0.6s ease;
}

@keyframes bounce-in {
    0% { transform: scale(0) rotate(0deg); }
    50% { transform: scale(1.2) rotate(180deg); }
    100% { transform: scale(1) rotate(360deg); }
}

.scroll-top:hover {
    transform: translateY(-8px) scale(1.15) rotate(360deg);
    box-shadow: 0 15px 50px rgba(107, 45, 143, 0.4),
                0 8px 24px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    background: linear-gradient(145deg, rgba(212, 175, 55, 0.95), rgba(244, 208, 63, 0.95));
    color: var(--color-dark);
    border-color: rgba(212, 175, 55, 0.3);
}

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

@media (max-width: 1024px) {
    .hero-title {
        font-size: 3.5rem;
    }

    .title-line-2 {
        font-size: 4rem;
    }

    .hero-subtitle {
        font-size: 1.7rem;
    }

    .timeline::before {
        left: 30px;
    }

    .timeline-item {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding-left: 80px;
    }

    .timeline-marker {
        left: 30px;
    }

    .timeline-date,
    .timeline-content {
        grid-column: 1 !important;
        text-align: left !important;
    }

    .timeline-date .year {
        font-size: 1.8rem;
    }

    .timeline-content h3 {
        font-size: 1.5rem;
    }
}

/* Overlay para menú móvil */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* Botón hamburguesa para móviles */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background: var(--color-white);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

@media (max-width: 768px) {
    * {
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }

    html {
        overflow-x: hidden !important;
        width: 100vw !important;
    }

    body {
        max-width: 100vw !important;
        overflow-x: hidden !important;
        width: 100vw !important;
        position: relative !important;
    }

    .container {
        padding: 0 1rem !important;
        max-width: 100vw !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }

    /* Prevenir overflow en todas las secciones */
    section {
        max-width: 100vw !important;
        overflow-x: hidden !important;
        width: 100% !important;
    }

    img {
        max-width: 100% !important;
        height: auto !important;
    }

    .header {
        padding: 0.5rem 0 !important;
        position: sticky !important;
        width: 100vw !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    .header .container {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 0.5rem !important;
        padding: 0.3rem 0.8rem !important;
        flex-wrap: nowrap !important;
        max-width: 100vw !important;
        width: 100% !important;
    }

    .logo-container {
        flex-shrink: 0 !important;
    }

    .logo-wrapper {
        width: 45px !important;
        height: 45px !important;
    }

    .mobile-menu-toggle {
        display: flex !important;
        flex-shrink: 0 !important;
    }

    /* FORZAR ocultar nav y social-header del header en móvil */
    .header > .container > .nav,
    .header > .container > .social-header,
    .header .nav:not(.active),
    .header .social-header:not(.active) {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    /* Menú lateral deslizante */
    .nav {
        display: block;
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: linear-gradient(135deg, rgba(107, 45, 143, 0.98) 0%, rgba(142, 68, 173, 0.98) 100%);
        backdrop-filter: blur(20px);
        padding: 5rem 1.5rem 2rem;
        transition: left 0.4s ease;
        overflow-y: auto;
        z-index: 1000;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    }

    .nav.active {
        left: 0;
        display: block;
    }

    .nav-list {
        display: flex;
        flex-direction: column;
        gap: 0.8rem;
        width: 100%;
        padding: 0;
    }

    .nav-list li {
        width: 100%;
        list-style: none;
    }

    .nav-list a {
        display: flex;
        align-items: center;
        width: 100%;
        text-align: left;
        padding: 1rem 1.2rem;
        font-size: 1rem;
        border-radius: 12px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
        min-height: 44px;
    }

    /* Social header dentro del menú lateral */
    .social-header {
        display: flex;
        position: fixed;
        bottom: 2rem;
        left: -100%;
        width: 280px;
        justify-content: center;
        gap: 2rem;
        transition: left 0.4s ease;
        z-index: 1000;
    }

    .social-header.active {
        left: 0;
        display: flex;
    }

    .hero {
        min-height: 80vh;
        padding: 3rem 1rem 2rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .hero-content {
        padding: 2rem 1rem;
    }

    .hero-title {
        font-size: 2.2rem;
        line-height: 1.3;
    }

    .title-line-2 {
        font-size: 2.8rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
        line-height: 1.6;
    }

    .hero-divider-icon {
        width: 40px;
        height: 40px;
        margin: 0 0 0 32px;
    }

    .divider-line {
        width: 80px;
        margin: 0 1rem;
    }

    .hero-date {
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .title-icon {
        font-size: 2rem;
    }

    .rito-content {
        gap: 1.5rem;
    }

    .rito-card {
        padding: 2rem 1.5rem;
    }

    .rito-card h3 {
        font-size: 1.5rem;
    }

    .rito-card p {
        font-size: 1rem;
    }

    .grados-section {
        padding: 3rem 0;
    }

    .grado-group {
        padding: 2rem 1.5rem;
        margin-bottom: 2rem;
    }

    .grados-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .grados-grid.supreme {
        grid-template-columns: 1fr;
    }

    .grado-item {
        padding: 1rem 1.2rem;
        font-size: 0.95rem;
        border-radius: 12px;
    }

    .grado-item:hover {
        transform: translateX(5px) translateY(-1px);
    }

    .timeline {
        padding-left: 60px;
    }

    .timeline::before {
        left: 20px;
    }

    .timeline-marker {
        left: 20px;
        width: 20px;
        height: 20px;
    }

    .timeline-item {
        padding-left: 60px;
        margin-bottom: 2.5rem;
    }

    .timeline-date {
        padding: 0.6rem 1rem;
        margin-bottom: 0.8rem;
    }

    .timeline-date .year {
        font-size: 1.5rem;
    }

    .timeline-date .month {
        font-size: 0.95rem;
    }

    .timeline-content {
        padding: 1.5rem;
    }

    .timeline-content h3 {
        font-size: 1.4rem;
    }

    .timeline-content p {
        font-size: 1rem;
    }

    .autoridades-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .autoridad-card {
        padding: 2rem 1.5rem;
    }

    .autoridad-card h3 {
        font-size: 1.4rem;
    }

    .login-box {
        padding: 2.5rem 1.5rem;
    }

    .login-header h3 {
        font-size: 1.8rem;
    }

    .login-header p {
        font-size: 1rem;
    }

    .contacto-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .contacto-card {
        padding: 2rem 1.5rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        align-items: center;
        gap: 2rem;
    }

    .footer-logo .logo-wrapper {
        width: 80px;
        height: 80px;
    }

    .footer-info h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 15px;
    }

    .container {
        padding: 0 0.875rem;
    }

    .logo-wrapper {
        width: 65px;
        height: 65px;
    }

    .nav-list a {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
        margin-bottom: 0.25rem;
    }

    .hero {
        min-height: 75vh;
        padding: 2.5rem 0.875rem 2rem;
    }

    .hero-content {
        padding: 1.5rem 0.5rem;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .title-line-2 {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-divider-icon {
        width: 35px;
        height: 35px;
        margin: 0 0 0 27px;
    }

    .divider-line {
        width: 60px;
        margin: 0 0.8rem;
    }

    .hero-date {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.6rem;
    }

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

    .rito-card {
        padding: 1.5rem 1rem;
    }

    .rito-card h3 {
        font-size: 1.3rem;
    }

    .rito-card p {
        font-size: 0.95rem;
    }

    .grado-item {
        padding: 1rem;
        font-size: 0.85rem;
    }

    .timeline {
        padding-left: 50px;
    }

    .timeline::before {
        left: 15px;
    }

    .timeline-marker {
        left: 15px;
        width: 18px;
        height: 18px;
        border: 3px solid var(--color-white);
    }

    .timeline-item {
        padding-left: 50px;
        margin-bottom: 2rem;
    }

    .timeline-date {
        padding: 0.5rem 0.8rem;
    }

    .timeline-date .year {
        font-size: 1.3rem;
    }

    .timeline-date .month {
        font-size: 0.85rem;
    }

    .timeline-content {
        padding: 1.2rem;
    }

    .timeline-content h3 {
        font-size: 1.2rem;
    }

    .timeline-content p {
        font-size: 0.9rem;
    }

    .autoridad-card {
        padding: 1.5rem 1rem;
    }

    .autoridad-card h3 {
        font-size: 1.2rem;
    }

    .login-box {
        padding: 2rem 1.2rem;
    }

    .login-header h3 {
        font-size: 1.5rem;
    }

    .login-header p {
        font-size: 0.9rem;
    }

    .form-group input {
        padding: 0.9rem;
        font-size: 0.95rem;
    }

    .btn-submit {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }

    .contacto-card {
        padding: 1.5rem 1rem;
    }

    .contacto-card h3 {
        font-size: 1.3rem;
    }

    .contacto-card p {
        font-size: 0.95rem;
    }

    .footer-logo .logo-wrapper {
        width: 70px;
        height: 70px;
    }

    .footer-info h3 {
        font-size: 1.3rem;
    }

    .footer-subtitle {
        font-size: 1rem;
    }

    .scroll-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
    }
}

/* ==========================================
   AOS ANIMATIONS
   ========================================== */

[data-aos] {
    pointer-events: auto;
}

/* ==========================================
   UTILITIES
   ========================================== */

.text-center {
    text-align: center;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

/* ==========================================
   FOOTER MODERN STYLES (Copiado de styles-modern.css)
   ========================================== */

.social-modern {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.social-link-modern {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #6b2d8f 0%, #8e44ad 50%, #a855f7 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(107, 45, 143, 0.12);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-link-modern:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 32px rgba(107, 45, 143, 0.16);
}

/* Footer Modern */
.footer-modern {
    padding: 4rem 0 2rem;
    background: linear-gradient(135deg, #2d1b3d 0%, #1e1b4b 50%, #1a1a2e 100%);
    color: white;
    text-align: center;
}

.footer-content-modern {
    max-width: 600px;
    margin: 0 auto;
}

.footer-logo-modern {
    width: 120px !important;
    height: 120px !important;
    object-fit: cover;
    margin: 0 auto 1.5rem auto;
    display: block;
    border-radius: 50%;
    box-shadow: 0 8px 32px rgba(107, 45, 143, 0.3);
}

.footer-content-modern h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #b8860b 0%, #d4af37 50%, #f4d03f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-content-modern p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
    margin-bottom: 0.5rem;
}

.footer-date-modern {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.footer-social-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    color: #d4af37;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.footer-modern .social-modern {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 1rem;
}
