/* ===== PALETA DE COLORES ===== */
:root {
    --primary-teal: #2C7A7B;
    --primary-dark-teal: #1E5A5B;
    --accent-lime: #B6D7A8;
    --light-mint: #E2F0D9;
    --soft-gray: #F0F4F0;
    --text-charcoal: #2D3E3F;
    --white-pure: #FFFFFF;
    --stone-gray: #6B7A78;
    --highlight-sand: #FEF9E7;
    --error-red: #dc3545;
    --success-green: #28a745;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.2);
    --transition-default: all 0.3s ease;
}

/* ===== RESET Y ESTILOS BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background: var(--primary-teal);
    font-family: 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    line-height: 1.6;
    color: var(--text-charcoal);
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.slides-container {
    max-width: 1200px;
    width: 100%;
    background: var(--white-pure);
    border-radius: clamp(20px, 4vw, 40px) clamp(20px, 4vw, 40px) clamp(15px, 3vw, 30px) clamp(15px, 3vw, 30px);
    box-shadow: 0 20px 35px rgba(25, 60, 50, 0.5);
    overflow: hidden;
    position: relative;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== HEADER ===== */
.pres-header {
    background: var(--primary-dark-teal);
    color: var(--white-pure);
    padding: 1rem clamp(1rem, 4vw, 2rem);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    border-bottom: 4px solid var(--accent-lime);
}

.company-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
}

.pres-header h2 {
    font-weight: 400;
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    background: var(--primary-teal);
    padding: 0.4rem 1.2rem;
    border-radius: 40px;
    letter-spacing: 1px;
}

.pres-header .codigo {
    font-family: monospace;
    background: var(--primary-dark-teal);
    padding: 0.4rem 1.2rem;
    border-radius: 30px;
    border: 1px solid var(--accent-lime);
    font-size: clamp(0.8rem, 2vw, 1rem);
}

/* ===== BARRA DE NAVEGACIÓN ===== */
.nav-controls {
    background: var(--light-mint);
    padding: 0.8rem clamp(1rem, 4vw, 2rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    border-bottom: 1px solid var(--accent-lime);
}

.nav-buttons {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    background: var(--primary-teal);
    border: none;
    color: white;
    font-size: 1.3rem;
    width: clamp(40px, 8vw, 48px);
    height: clamp(40px, 8vw, 48px);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-default);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.nav-btn:hover:not(:disabled) {
    background: var(--primary-dark-teal);
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.nav-btn:focus-visible {
    outline: 3px solid var(--accent-lime);
    outline-offset: 2px;
}

.nav-btn:disabled {
    background: var(--stone-gray);
    cursor: not-allowed;
    opacity: 0.6;
}

.page-indicator {
    font-weight: 600;
    background: white;
    padding: 0.4rem 1.6rem;
    border-radius: 40px;
    color: var(--primary-dark-teal);
    border: 1px solid var(--primary-teal);
    font-size: clamp(0.9rem, 2.5vw, 1rem);
}

/* ===== BOTÓN DE DESCARGA ===== */
.download-btn {
    background: var(--primary-dark-teal);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.6rem 1.4rem;
    border-radius: 40px;
    cursor: pointer;
    font-size: clamp(0.85rem, 2.5vw, 0.95rem);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-default);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    border: 2px solid transparent;
}

.download-btn:hover {
    background: var(--primary-teal);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.download-btn:focus-visible {
    outline: 3px solid var(--accent-lime);
    outline-offset: 2px;
}

.download-btn:active {
    transform: translateY(0);
}

.download-text-mobile {
    display: none;
}

/* ===== ÁREA DE DIAPOSITIVA ===== */
.slide-view {
    padding: clamp(1.5rem, 5vw, 2.5rem) clamp(1.5rem, 5vw, 2.8rem);
    min-height: 450px;
    background: var(--white-pure);
}

.slide-content {
    max-width: 1000px;
    margin: 0 auto;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Títulos */
.slide-view .slide-title {
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    font-weight: 700;
    color: var(--primary-dark-teal);
    border-left: 14px solid var(--accent-lime);
    padding-left: 1.5rem;
    margin-bottom: 2rem;
    line-height: 1.2;
    word-break: break-word;
}

/* Grid de principios */
.principios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
    gap: 1.8rem;
    margin-top: 1.8rem;
}

.principio-card {
    background: var(--light-mint);
    padding: 1.6rem 1.2rem;
    border-radius: 30px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--accent-lime);
    transition: var(--transition-default);
    text-align: center;
}

.principio-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.principio-card i {
    font-size: 2.5rem;
    color: var(--primary-teal);
    margin-bottom: 0.8rem;
}

/* Listas */
.bullet-list {
    list-style: none;
}

.bullet-list li {
    margin-bottom: 0.9rem;
    font-size: clamp(1rem, 3vw, 1.15rem);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    word-break: break-word;
}

.bullet-list li i {
    color: var(--primary-teal);
    font-size: 1.4rem;
    min-width: 28px;
    flex-shrink: 0;
}

/* Tarjetas legales */
.legal-card {
    background: var(--light-mint);
    padding: 1.5rem;
    border-radius: 30px;
    margin: 1.2rem 0;
    border-left: 12px solid var(--primary-teal);
}

.legal-card p {
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Tablas */
.table-responsive {
    overflow-x: auto;
    margin: 1rem 0;
    border-radius: 30px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white-pure);
    border-radius: 30px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    min-width: 500px;
}

th {
    background: var(--primary-teal);
    color: white;
    font-weight: 600;
    padding: 14px 10px;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
}

td {
    border-bottom: 1px solid var(--accent-lime);
    padding: 16px 12px;
    vertical-align: top;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: var(--light-mint);
}

/* Badges */
.badge {
    background: var(--accent-lime);
    color: var(--text-charcoal);
    font-weight: 700;
    padding: 0.2rem 1.2rem;
    border-radius: 50px;
    display: inline-block;
    margin-bottom: 1rem;
}

/* Footer note */
.footer-note {
    margin-top: 2rem;
    font-style: italic;
    background: var(--light-mint);
    padding: 1rem 2rem;
    border-radius: 50px;
    display: inline-block;
    color: var(--primary-dark-teal);
    font-size: clamp(0.9rem, 2.5vw, 1rem);
}

/* Firma genérica */
.firma-generica {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    border-top: 2px dashed var(--stone-gray);
    padding-top: 2rem;
    color: var(--text-charcoal);
    font-weight: 500;
    flex-wrap: wrap;
    gap: 1rem;
}

.firma-generica span {
    text-align: center;
    flex: 1;
}

/* Footer de la presentación */
.pres-footer {
    background: var(--soft-gray);
    text-align: center;
    padding: 1rem;
    color: var(--stone-gray);
    font-size: 0.9rem;
    border-top: 1px solid var(--accent-lime);
}

/* ===== LOADER ===== */
.pdf-loader {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 122, 123, 0.95);
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
    font-size: clamp(1.2rem, 4vw, 2rem);
    backdrop-filter: blur(4px);
    flex-direction: column;
    gap: 1rem;
}

.pdf-loader.active {
    display: flex;
}

.spinner {
    border: 8px solid var(--light-mint);
    border-top: 8px solid var(--primary-dark-teal);
    border-radius: 50%;
    width: clamp(60px, 15vw, 80px);
    height: clamp(60px, 15vw, 80px);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-message {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--primary-dark-teal);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    font-weight: 500;
    max-width: 90%;
    text-align: center;
}

.toast-message.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-message.error {
    background: var(--error-red);
}

.toast-message.success {
    background: var(--success-green);
}

/* ===== MEDIA QUERIES ===== */
@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }

    .pres-header {
        flex-direction: column;
        text-align: center;
    }

    .nav-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-buttons {
        justify-content: center;
    }

    .download-btn {
        justify-content: center;
    }

    .download-text {
        display: none;
    }

    .download-text-mobile {
        display: inline;
    }

    .slide-title {
        font-size: 1.8rem;
        border-left-width: 10px;
    }

    .principios-grid {
        gap: 1rem;
    }

    .principio-card {
        padding: 1.2rem;
    }

    .firma-generica {
        flex-direction: column;
        gap: 1.5rem;
    }

    .legal-card p {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .slide-view {
        padding: 1rem;
    }

    .slide-title {
        font-size: 1.5rem;
        padding-left: 1rem;
    }

    .bullet-list li {
        font-size: 0.95rem;
    }

    .page-indicator {
        padding: 0.4rem 1rem;
    }

    .badge {
        font-size: 0.8rem;
    }

    .footer-note {
        padding: 0.8rem 1rem;
        font-size: 0.85rem;
    }
}

/* ===== ACCESIBILIDAD ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== SOPORTE PARA IMPRESIÓN ===== */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .slides-container {
        box-shadow: none;
        border-radius: 0;
    }

    .pres-header,
    .nav-controls,
    .pres-footer,
    .download-btn,
    .pdf-loader,
    .toast-message {
        display: none !important;
    }

    .slide-view {
        padding: 0.5in;
    }

    .slide-content {
        page-break-after: always;
    }
}