/* ============================
   eskala — Design System Styles
   Palette: Royal Indigo (#1A0FA8), Electric Cyan (#00B4F5), Abyss (#0E191D), Frost White (#F0F4F8)
   ============================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
    /* Indigo tints */
    --es-indigo-800: #0C0860;
    --es-indigo-700: #110B84;
    --es-indigo-600: #1A0FA8;
    --es-indigo-300: #7B6FD4;
    --es-indigo-050: #EEEBFA;

    /* Cyan tints */
    --es-cyan-600: #0090C4;
    --es-cyan-500: #00B4F5;
    --es-cyan-400: #33C6F7;
    --es-cyan-050: #E5F7FE;

    /* Cool Neutrals */
    --es-neutral-900: #0E191D;
    --es-neutral-800: #162128;
    --es-neutral-700: #1E2E35;
    --es-neutral-600: #2C3F48;
    --es-neutral-500: #445662;
    --es-neutral-400: #627480;
    --es-neutral-300: #8A9EAB;
    --es-neutral-200: #B8C7D0;
    --es-neutral-100: #D9E3E8;
    --es-neutral-050: #EBF0F3;
    --es-white: #F0F4F8; /* Frost White */

    /* Functional */
    --es-success: #1F8A5B;
    --es-warning: #C8881A;
    --es-danger: #D14343;

    /* Elevation & Shadows (indigo tint) */
    --es-shadow-sm: 0 2px 8px rgba(26, 15, 168, 0.06);
    --es-shadow-md: 0 8px 24px rgba(26, 15, 168, 0.10);
    --es-shadow-lg: 0 24px 60px rgba(26, 15, 168, 0.14);
    --es-focus-glow: 0 0 0 3px rgba(0, 180, 245, 0.50);

    /* Spacing */
    --es-space-1: 4px;
    --es-space-2: 8px;
    --es-space-3: 12px;
    --es-space-4: 16px;
    --es-space-5: 24px;
    --es-space-6: 32px;
    --es-space-7: 48px;
    --es-space-8: 64px;

    /* Border Radii */
    --es-radius-sm: 6px;
    --es-radius-md: 10px;
    --es-radius-lg: 16px;
    --es-radius-xl: 24px;
    --es-radius-pill: 999px;
}

/* ============================
   Typography (eskala)
   ============================ */
html, body, p, span, div, button, input, textarea, label, li, a {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
}

h1, h2, h3, h4, h5, h6, strong, b, .font-bold, .font-extrabold, .font-semibold {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.mono, code, pre, .font-mono {
    font-family: 'JetBrains Mono', monospace !important;
}

h1 {
    font-weight: 800;
    font-size: 61px;
    letter-spacing: -0.02em;
}

h2 {
    font-weight: 700;
    font-size: 49px;
    letter-spacing: -0.02em;
}

h3 {
    font-weight: 700;
    font-size: 31px;
}

h4 {
    font-weight: 600;
    font-size: 25px;
}

.lead {
    font-weight: 400;
    font-size: 20px;
}

body {
    font-size: 16px;
    line-height: 1.55;
    background-color: var(--es-white);
    color: var(--es-neutral-900);
}

.small {
    font-size: 14px;
}

.eyebrow {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--es-cyan-500);
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    background-color: var(--es-white);
}

/* Antialiasing */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Skip link */
.skip-link:focus {
    clip: auto;
    clip-path: none;
    width: auto;
    height: auto;
    overflow: visible;
}

/* ============================
   Inline icon
   ============================ */
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25em;
    height: 1.25em;
    line-height: 1;
    vertical-align: middle;
}

.icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ============================
   Logo
   ============================ */
.header-logo {
    height: 36px;
    width: auto;
    display: block;
}

.footer-logo {
    height: 32px;
    width: auto;
    display: block;
}

/* ============================
   Focus States (WCAG 2.1 AA)
   ============================ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.service-card:focus-visible {
    outline: 3px solid var(--es-cyan-500);
    outline-offset: 3px;
    border-radius: var(--es-radius-sm);
}

/* ============================
   Reduced Motion (Accessibility)
   ============================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================
   Scroll Animations
   ============================ */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered children */
.stagger-children > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.stagger-children.is-visible > *:nth-child(1) { transition-delay: 0ms; }
.stagger-children.is-visible > *:nth-child(2) { transition-delay: 120ms; }
.stagger-children.is-visible > *:nth-child(3) { transition-delay: 240ms; }
.stagger-children.is-visible > *:nth-child(4) { transition-delay: 360ms; }

.stagger-children.is-visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* Fade from left */
.animate-from-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-from-left.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Fade from right */
.animate-from-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-from-right.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Scale up */
.animate-scale {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-scale.is-visible {
    opacity: 1;
    transform: scale(1);
}

/* ============================
   Hero Animations
   ============================ */
@keyframes heroFadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-badge { animation: heroFadeUp 0.6s 0.2s cubic-bezier(0.16, 1, 0.3, 1) both; }
.hero-title { animation: heroFadeUp 0.7s 0.35s cubic-bezier(0.16, 1, 0.3, 1) both; }
.hero-subtitle { animation: heroFadeUp 0.7s 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
.hero-buttons { animation: heroFadeUp 0.7s 0.65s cubic-bezier(0.16, 1, 0.3, 1) both; }
.hero-image { animation: heroFadeUp 0.9s 0.4s cubic-bezier(0.16, 1, 0.3, 1) both; }

/* ============================
   Nav
   ============================ */
#main-nav {
    background-color: #FFFFFF;
    border-bottom: 1px solid var(--es-neutral-100);
}

.nav-scrolled {
    box-shadow: var(--es-shadow-md) !important;
    background-color: #FFFFFF !important;
}

.nav-link {
    position: relative;
    color: var(--es-neutral-600);
    transition: color 0.3s ease;
    padding-bottom: 4px;
}

.nav-link:hover {
    color: var(--es-indigo-600);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--es-cyan-500);
    border-radius: 1px;
    transition: width 0.3s ease;
}

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

.nav-link.active {
    color: var(--es-neutral-900);
}

/* ============================
   Mobile Menu
   ============================ */
.mobile-menu {
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    background-color: #FFFFFF;
    border-left: 1px solid var(--es-neutral-100);
    box-shadow: var(--es-shadow-md);
}

.mobile-menu.is-open {
    transform: translateX(0);
}

.mobile-menu-overlay {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    background-color: rgba(14, 25, 29, 0.4);
}

.mobile-menu-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.mobile-link {
    color: var(--es-neutral-600);
    transition: color 0.2s ease;
    font-weight: 600;
}

.mobile-link:hover,
.mobile-link.active {
    color: var(--es-indigo-600);
}

/* Hamburger */
.hamburger-line {
    transition: transform 0.3s ease, opacity 0.3s ease;
    background-color: var(--es-neutral-900);
}

.hamburger.is-active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.is-active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.is-active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ============================
   Buttons (eskala)
   ============================ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--es-indigo-600);
    color: #FFFFFF;
    padding: 14px 32px;
    border-radius: var(--es-radius-xl);
    min-height: 44px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.btn-primary:hover {
    background-color: var(--es-indigo-700);
}

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

/* Primary en fondo oscuro (dark sections/components) */
.dark-section .btn-primary,
.bg-neutral-900 .btn-primary {
    background-color: var(--es-cyan-500);
    color: #0A1626;
}

.dark-section .btn-primary:hover,
.bg-neutral-900 .btn-primary:hover {
    background-color: var(--es-cyan-400);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: transparent;
    color: var(--es-indigo-600);
    padding: 12px 28px;
    border-radius: var(--es-radius-xl);
    min-height: 44px;
    font-weight: 600;
    border: 1px solid var(--es-neutral-200);
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    text-decoration: none;
}

.btn-secondary:hover {
    background-color: var(--es-indigo-050);
    border-color: var(--es-indigo-300);
}

.btn-link {
    color: var(--es-neutral-900);
    font-weight: 600;
    border-bottom: 3px solid var(--es-cyan-500);
    padding-bottom: 2px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.btn-link:hover {
    color: var(--es-indigo-600);
    border-color: var(--es-cyan-600);
}

/* ============================
   Containers / Cards
   ============================ */
.card {
    background-color: #FFFFFF;
    border-radius: var(--es-radius-md);
    border: 1px solid var(--es-neutral-100);
    box-shadow: var(--es-shadow-sm);
    padding: 32px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-featured {
    border-top: 2px solid var(--es-cyan-500);
}

.card-tinted-indigo { background-color: var(--es-indigo-050); }
.card-tinted-cyan { background-color: var(--es-cyan-050); }
.card-tinted-neutral { background-color: var(--es-neutral-050); }

/* ============================
   Icon-circle badges
   ============================ */
.icon-circle {
    width: 56px;
    height: 56px;
    border-radius: var(--es-radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.icon-circle-indigo { background-color: var(--es-indigo-050); color: var(--es-indigo-600); }
.icon-circle-cyan { background-color: var(--es-cyan-050); color: var(--es-cyan-600); }
.icon-circle-success { background-color: var(--es-cyan-050); color: var(--es-success); }
.icon-circle-warning { background-color: var(--es-neutral-050); color: var(--es-warning); }
.icon-circle-danger { background-color: var(--es-neutral-050); color: var(--es-danger); }

/* ============================
   Process Step
   ============================ */
.process-line {
    background-color: var(--es-cyan-500);
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.process-line.is-visible {
    transform: scaleX(1);
}

.process-step {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: var(--es-indigo-050);
    border: 2px solid var(--es-indigo-600);
    color: var(--es-indigo-600);
    box-shadow: var(--es-shadow-sm);
}

.process-step:hover {
    transform: scale(1.05);
    box-shadow: var(--es-shadow-md);
}

/* Mobile vertical process line */
@media (max-width: 767px) {
    .process-vertical-line {
        position: relative;
    }

    .process-vertical-line::before {
        content: '';
        position: absolute;
        top: 0;
        left: 48px;
        width: 2px;
        height: 100%;
        background-color: var(--es-indigo-050);
    }

    .process-vertical-line > * {
        position: relative;
        z-index: 1;
    }
}

/* ============================
   Form Styles
   ============================ */
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--es-neutral-900);
    margin-bottom: 7px;
}

.form-label .form-req {
    color: var(--es-danger);
    font-weight: 600;
    margin-left: 2px;
}

.form-input {
    background-color: var(--es-white);
    border: 1px solid var(--es-neutral-200);
    color: var(--es-neutral-900);
    border-radius: var(--es-radius-md);
    padding: 11px 13px;
    font-size: 15px;
    line-height: 1.5;
    width: 100%;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input::placeholder {
    color: var(--es-neutral-400);
}

.form-input:focus {
    outline: none;
    border-color: var(--es-cyan-500);
    box-shadow: 0 0 0 4px rgba(0, 180, 245, 0.18);
}

.form-input.error {
    border-color: var(--es-danger);
}

.form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(209, 67, 67, 0.18);
}

.form-success {
    animation: heroFadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.form-message {
    padding: 12px 16px;
    border-radius: var(--es-radius-md);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    animation: heroFadeUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.form-message-success {
    background-color: var(--es-cyan-050);
    color: var(--es-success);
    border: 1px solid var(--es-success);
}

.form-message-error {
    background-color: rgba(209, 67, 67, 0.08);
    color: var(--es-danger);
    border: 1px solid var(--es-danger);
}

/* Per-field inline error */
.form-field-error {
    margin-top: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--es-danger);
    line-height: 1.4;
}

/* Submit button spinner */
.form-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 10px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: form-spinner-rotate 0.7s linear infinite;
    vertical-align: -2px;
}

@keyframes form-spinner-rotate {
    to { transform: rotate(360deg); }
}

.btn-primary.is-submitting {
    cursor: wait;
    opacity: 0.85;
}

/* Success card that replaces the form */
.form-success-card {
    padding: 40px 28px;
    text-align: center;
    background-color: var(--es-cyan-050);
    border: 1px solid var(--es-success);
    border-radius: var(--es-radius-xl);
    animation: heroFadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.form-success-card__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--es-success);
    color: var(--es-white);
    border-radius: 50%;
}

.form-success-card__icon svg {
    width: 28px;
    height: 28px;
}

.form-success-card__title {
    font-size: 22px;
    font-weight: 700;
    color: var(--es-neutral-900);
    margin-bottom: 10px;
}

.form-success-card__text {
    font-size: 14px;
    color: var(--es-neutral-600);
    line-height: 1.55;
    margin-bottom: 24px;
}

.form-success-card__text a {
    color: var(--es-indigo-600);
    font-weight: 600;
    text-decoration: underline;
}

.form-success-card__again {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ============================
   Shared shadow utilities
   ============================ */
.shadow-card {
    box-shadow: 0 4px 16px rgba(14, 25, 29, 0.08);
}

.shadow-form {
    box-shadow: var(--es-shadow-sm);
}

/* ============================
   Contact form card
   Brighter than --es-white so it lifts off the section bg.
   Inputs stay --es-white (Frost White) inside for contrast.
   ============================ */
.contact-form-card {
    background-color: #FAFCFE;
    box-shadow: 0 6px 20px rgba(26, 15, 168, 0.07), 0 1px 2px rgba(26, 15, 168, 0.04);
}

/* ============================
   Service Card
   ============================ */
.service-card {
    background-color: #FFFFFF;
    border: 1px solid var(--es-neutral-100);
    border-radius: var(--es-radius-xl);
    padding: 32px;
    box-shadow: var(--es-shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    display: block;
    cursor: pointer;
    color: var(--es-neutral-900);
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--es-shadow-md);
}

.service-card .service-icon {
    transition: transform 0.3s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.08);
}

.service-card .service-arrow {
    transition: transform 0.3s ease, gap 0.3s ease;
    color: var(--es-indigo-600);
}

.service-card:hover .service-arrow {
    transform: translateX(4px);
}

/* ============================
   WhatsApp Float
   ============================ */
@keyframes whatsappPulse {
    0% { box-shadow: 0 0 0 0 rgba(31, 138, 91, 0.5); }
    70% { box-shadow: 0 0 0 15px rgba(31, 138, 91, 0); }
    100% { box-shadow: 0 0 0 0 rgba(31, 138, 91, 0); }
}

.whatsapp-float {
    animation: whatsappPulse 2.5s infinite;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: var(--es-success);
}

.whatsapp-float:hover {
    transform: scale(1.1);
    animation: none;
    box-shadow: 0 6px 20px rgba(31, 138, 91, 0.4);
}

/* ============================
   Section Divider
   ============================ */
.section-divider {
    height: 1px;
    background-color: var(--es-neutral-100);
}

/* ============================
   Selection
   ============================ */
::selection {
    background-color: var(--es-indigo-050);
    color: var(--es-neutral-900);
}

/* ============================
   Backgrounds
   ============================ */
.bg-app-white { background-color: #FFFFFF; }
.bg-app-soft { background-color: var(--es-white); }
.bg-app-indigo-light { background-color: var(--es-indigo-050); }

/* ============================
   Text utilities
   ============================ */
.text-app-ink { color: var(--es-neutral-900); }
.text-app-muted { color: var(--es-neutral-600); }
.text-app-subtle { color: var(--es-neutral-400); }
.text-app-indigo { color: var(--es-indigo-600); }
.text-app-cyan { color: var(--es-cyan-500); }
.text-app-success { color: var(--es-success); }
.text-app-warning { color: var(--es-warning); }

/* ============================
   Prose (legal pages)
   ============================ */
.prose h2 {
    color: var(--es-neutral-900);
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.prose h3 {
    color: var(--es-neutral-900);
    font-size: 1.125rem;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.prose p,
.prose li {
    color: var(--es-neutral-600);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.prose ul {
    list-style-type: disc;
    padding-left: 1.5rem;
}

.prose a {
    color: var(--es-indigo-600);
    text-decoration: underline;
}

.prose strong {
    color: var(--es-neutral-900);
    font-weight: 600;
}

/* ============================
   Responsive fine-tuning
   ============================ */
@media (max-width: 639px) {
    .hero-title {
        font-size: 1.75rem;
        line-height: 1.15;
    }
}

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

/* ============================
   Módulo Autor — Pantalla Login
   ============================ */
.autor-page { background-color: var(--es-white); }

.autor-login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 60px;
    background: radial-gradient(ellipse at 65% 0%, rgba(26,15,168,0.07) 0%, transparent 65%),
                var(--es-white);
}

.autor-login-card {
    background: #fff;
    border: 1px solid var(--es-neutral-100);
    border-radius: var(--es-radius-xl);
    box-shadow: var(--es-shadow-lg);
    padding: 52px 48px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    opacity: 0;
    transform: translateY(20px) scale(0.97);
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.autor-login-card.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

@media (max-width: 480px) {
    .autor-login-card { padding: 36px 28px; }
}

.autor-login-card__logo {
    height: 34px;
    width: auto;
    margin: 0 auto 28px;
}

.autor-login-card__title {
    font-size: 26px;
    font-weight: 800;
    color: var(--es-neutral-900);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.autor-login-card__desc {
    font-size: 15px;
    color: var(--es-neutral-400);
    margin-bottom: 32px;
    line-height: 1.65;
}

/* Google signin button */
.btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 24px;
    border: 1.5px solid var(--es-neutral-200);
    border-radius: var(--es-radius-lg);
    background: #fff;
    color: var(--es-neutral-900);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.btn-google:hover {
    border-color: var(--es-indigo-300);
    background-color: var(--es-indigo-050);
    box-shadow: var(--es-shadow-sm);
}

.btn-google:active { transform: translateY(1px); }

/* Spinner */
@keyframes spinRing {
    to { transform: rotate(360deg); }
}

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid var(--es-neutral-200);
    border-top-color: var(--es-indigo-600);
    border-radius: 50%;
    animation: spinRing 0.7s linear infinite;
    flex-shrink: 0;
}

/* ============================
   Módulo Autor — Dashboard
   ============================ */
.dashboard {
    max-width: 1060px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}

.dashboard__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 40px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--es-neutral-100);
}

.dashboard__user {
    display: flex;
    align-items: center;
    gap: 14px;
}

.dashboard__avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid var(--es-indigo-050);
    object-fit: cover;
    background: var(--es-indigo-050);
}

.dashboard__user-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--es-neutral-900);
    line-height: 1.3;
}

.dashboard__user-email {
    font-size: 13px;
    color: var(--es-neutral-400);
}

.dashboard__actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.dashboard__page-title {
    font-size: 30px;
    font-weight: 800;
    color: var(--es-neutral-900);
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.dashboard__subtitle {
    font-size: 14px;
    color: var(--es-neutral-400);
    margin-bottom: 24px;
}

/* Filter tabs */
.filter-tabs {
    display: flex;
    gap: 3px;
    margin-bottom: 24px;
    background: var(--es-neutral-050);
    padding: 4px;
    border-radius: var(--es-radius-lg);
    width: fit-content;
}

.filter-tab {
    padding: 7px 18px;
    border-radius: var(--es-radius-md);
    font-size: 13px;
    font-weight: 600;
    color: var(--es-neutral-400);
    cursor: pointer;
    border: none;
    background: transparent;
    transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
    font-family: 'Inter', sans-serif;
}

.filter-tab.active {
    background: #fff;
    color: var(--es-neutral-900);
    box-shadow: var(--es-shadow-sm);
}

/* Post card */
.post-card {
    background: #fff;
    border: 1px solid var(--es-neutral-100);
    border-radius: var(--es-radius-lg);
    padding: 22px 24px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 20px;
    transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
    box-shadow: var(--es-shadow-sm);
    margin-bottom: 10px;
}

.post-card:hover {
    box-shadow: var(--es-shadow-md);
    border-color: var(--es-neutral-200);
    transform: translateY(-1px);
}

@media (max-width: 640px) {
    .post-card { grid-template-columns: 1fr; }
}

.post-card__body { min-width: 0; }

.post-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.post-card__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--es-neutral-900);
    margin-bottom: 6px;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-card__preview {
    font-size: 13.5px;
    color: var(--es-neutral-400);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card__info {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.post-card__info-item {
    font-size: 12px;
    color: var(--es-neutral-400);
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-card__controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Status badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--es-radius-pill);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.status-badge--published {
    background: rgba(31, 138, 91, 0.12);
    color: var(--es-success);
}

.status-badge--draft {
    background: var(--es-neutral-050);
    color: var(--es-neutral-400);
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.toggle-switch__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch__track {
    width: 42px;
    height: 23px;
    background: var(--es-neutral-200);
    border-radius: var(--es-radius-pill);
    transition: background-color 0.25s ease;
    flex-shrink: 0;
    position: relative;
}

.toggle-switch__input:checked + .toggle-switch__track {
    background: var(--es-success);
}

.toggle-switch__thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 17px;
    height: 17px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.toggle-switch__input:checked ~ .toggle-switch__thumb {
    transform: translateX(19px);
}

.toggle-switch__input:focus-visible ~ .toggle-switch__track {
    outline: 3px solid var(--es-cyan-500);
    outline-offset: 2px;
}

/* Icon button */
.btn-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--es-radius-md);
    border: 1px solid var(--es-neutral-100);
    background: #fff;
    color: var(--es-neutral-400);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    font-size: 15px;
    text-decoration: none;
    flex-shrink: 0;
}

.btn-icon:hover {
    background: var(--es-indigo-050);
    color: var(--es-indigo-600);
    border-color: var(--es-indigo-300);
}

.btn-icon--danger:hover {
    background: rgba(209, 67, 67, 0.08);
    color: var(--es-danger);
    border-color: rgba(209, 67, 67, 0.3);
}

/* Button size variant */
.btn-sm {
    font-size: 13.5px;
    padding: 9px 20px;
    min-height: 38px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 72px 24px;
}

.empty-state__icon {
    font-size: 52px;
    color: var(--es-indigo-300);
    margin-bottom: 18px;
    display: block;
}

.empty-state__title {
    font-size: 20px;
    font-weight: 700;
    color: var(--es-neutral-600);
    margin-bottom: 10px;
}

.empty-state__desc {
    font-size: 15px;
    color: var(--es-neutral-400);
    margin-bottom: 28px;
}

/* Skeleton loading */
.posts-loading { display: flex; flex-direction: column; gap: 10px; }

.post-card-skeleton {
    background: #fff;
    border: 1px solid var(--es-neutral-100);
    border-radius: var(--es-radius-lg);
    height: 92px;
    position: relative;
    overflow: hidden;
}

@keyframes shimmerSlide {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.post-card-skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.7) 50%, transparent 100%);
    animation: shimmerSlide 1.4s infinite;
}

/* ============================
   Delete Modal
   ============================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(14, 25, 29, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    backdrop-filter: blur(2px);
}

.modal-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: #fff;
    border-radius: var(--es-radius-xl);
    padding: 40px;
    max-width: 416px;
    width: 100%;
    box-shadow: var(--es-shadow-lg);
    transform: scale(0.94) translateY(12px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.is-open .modal {
    transform: scale(1) translateY(0);
}

.modal__icon {
    width: 52px;
    height: 52px;
    border-radius: var(--es-radius-md);
    background: rgba(209, 67, 67, 0.1);
    color: var(--es-danger);
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.modal__title {
    font-size: 20px;
    font-weight: 800;
    color: var(--es-neutral-900);
    margin-bottom: 10px;
}

.modal__desc {
    font-size: 15px;
    color: var(--es-neutral-500);
    margin-bottom: 28px;
    line-height: 1.6;
}

.modal__actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--es-radius-lg);
    background: var(--es-danger);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.15s;
    font-family: 'Inter', sans-serif;
    min-height: 38px;
}

.btn-danger:hover    { background: #b83636; }
.btn-danger:active   { transform: translateY(1px); }
.btn-danger:disabled { opacity: 0.6; cursor: not-allowed; }

/* ============================
   Toast
   ============================ */
.toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    max-width: 360px;
    background: var(--es-neutral-900);
    color: #fff;
    padding: 13px 18px;
    border-radius: var(--es-radius-lg);
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--es-shadow-lg);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateY(16px);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    pointer-events: none;
}

.toast.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.toast--success { border-left: 4px solid var(--es-success); }
.toast--error   { border-left: 4px solid var(--es-danger); }
.toast--info    { border-left: 4px solid var(--es-cyan-500); }

/* ============================
   Category tag
   ============================ */
.category-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--es-radius-pill);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--es-indigo-050);
    color: var(--es-indigo-600);
}

/* ============================
   Editor de Artículos
   ============================ */
.editor-page {
    min-height: 100vh;
    background: var(--es-white);
    padding-top: 80px;
}

.editor-layout {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px 80px;
    display: grid;
    grid-template-columns: 1fr 288px;
    gap: 28px;
    align-items: start;
}

@media (max-width: 880px) {
    .editor-layout {
        grid-template-columns: 1fr;
    }
}

.editor-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.editor-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--es-neutral-400);
    text-decoration: none;
    padding: 7px 12px;
    border-radius: var(--es-radius-md);
    transition: background-color 0.2s, color 0.2s;
}

.editor-back-btn:hover {
    background: var(--es-neutral-050);
    color: var(--es-neutral-900);
}

.editor-mode-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px 12px;
    border-radius: var(--es-radius-pill);
    background: var(--es-indigo-050);
    color: var(--es-indigo-600);
    margin-left: auto;
}

/* Editor main card */
.editor-main {
    background: #fff;
    border: 1px solid var(--es-neutral-100);
    border-radius: var(--es-radius-xl);
    box-shadow: var(--es-shadow-sm);
    overflow: hidden;
}

.editor-form-fields { padding: 32px 32px 24px; }

@media (max-width: 640px) {
    .editor-form-fields { padding: 22px 20px 18px; }
}

.editor-field { margin-bottom: 24px; }

.editor-label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--es-neutral-400);
    margin-bottom: 9px;
}

.editor-input {
    width: 100%;
    border: 1.5px solid var(--es-neutral-100);
    border-radius: var(--es-radius-md);
    padding: 13px 15px;
    font-size: 15px;
    color: var(--es-neutral-900);
    background: var(--es-white);
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: 'Inter', sans-serif;
}

.editor-input::placeholder { color: var(--es-neutral-300); }

.editor-input:focus {
    outline: none;
    border-color: var(--es-cyan-500);
    box-shadow: var(--es-focus-glow);
}

.editor-title-input {
    font-size: 21px;
    font-weight: 700;
    border-color: transparent;
    background: var(--es-neutral-050);
    padding: 15px 16px;
    letter-spacing: -0.01em;
}

.editor-title-input:focus {
    border-color: var(--es-cyan-500);
    background: #fff;
}

/* Select */
.editor-select {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23627480' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    padding-right: 36px;
    cursor: pointer;
}

/* Toolbar */
.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 9px 12px;
    background: var(--es-neutral-050);
    border-top: 1px solid var(--es-neutral-100);
    border-bottom: 1px solid var(--es-neutral-100);
    flex-wrap: wrap;
}

.toolbar-btn {
    width: 31px;
    height: 31px;
    border-radius: var(--es-radius-sm);
    border: none;
    background: transparent;
    color: var(--es-neutral-500);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
    font-family: 'Inter', sans-serif;
}

.toolbar-btn:hover {
    background: var(--es-indigo-050);
    color: var(--es-indigo-600);
}

.toolbar-divider {
    width: 1px;
    height: 18px;
    background: var(--es-neutral-200);
    margin: 0 5px;
    flex-shrink: 0;
}

/* Content textarea */
.editor-content-area {
    display: block;
    width: 100%;
    min-height: 420px;
    padding: 22px 32px;
    font-size: 15.5px;
    line-height: 1.75;
    color: var(--es-neutral-900);
    font-family: 'Inter', sans-serif;
    border: none;
    resize: vertical;
    background: transparent;
}

@media (max-width: 640px) {
    .editor-content-area { padding: 18px 20px; }
}

.editor-content-area:focus { outline: none; }

.editor-content-area::placeholder {
    color: var(--es-neutral-300);
    line-height: 1.8;
}

.editor-word-count {
    padding: 10px 32px;
    background: var(--es-neutral-050);
    border-top: 1px solid var(--es-neutral-100);
    font-size: 12px;
    color: var(--es-neutral-400);
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .editor-word-count { padding: 10px 20px; }
}

/* Sidebar */
.editor-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 96px;
}

.sidebar-card {
    background: #fff;
    border: 1px solid var(--es-neutral-100);
    border-radius: var(--es-radius-lg);
    padding: 22px;
    box-shadow: var(--es-shadow-sm);
}

.sidebar-card__title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--es-neutral-400);
    margin-bottom: 14px;
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Hint tips card */
.tips-card {
    background: var(--es-indigo-050);
    border-color: rgba(26,15,168,0.15);
}

.tips-card .sidebar-card__title { color: var(--es-indigo-600); }

/* ============================
   Blog Shimmer Animation
   ============================ */
.blog-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.6) 50%, transparent 100%);
    animation: blogShimmerSlide 1.5s infinite;
}

@keyframes blogShimmerSlide {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ============================
   Language Switcher
   ============================ */
.lang-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border: 1px solid var(--es-neutral-200);
    border-radius: var(--es-radius-pill);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--es-neutral-500);
    text-decoration: none;
    background: transparent;
    transition: border-color 0.15s, color 0.15s;
    white-space: nowrap;
}

.lang-switch:hover,
.lang-switch:focus-visible {
    border-color: var(--es-indigo-600);
    color: var(--es-indigo-600);
}

.lang-switch:focus-visible {
    outline: 2px solid var(--es-indigo-600);
    outline-offset: 2px;
}

