/* ============================================
   Variables CSS para temas claro y oscuro
   ============================================ */

:root {
    /* Tema claro (por defecto) */
    --bg-primary: #f0f9ff;
    --bg-secondary: #ffffff;
    --bg-gradient-start: #e0f2fe;
    --bg-gradient-end: #f0f9ff;

    --text-primary: #0c4a6e;
    --text-secondary: #075985;
    --text-muted: #0891b2;

    --cyan-light: #67e8f9;
    --cyan-main: #06b6d4;
    --cyan-dark: #0e7490;
    --cyan-accent: #22d3ee;

    --shadow-sm: 0 2px 8px rgba(6, 182, 212, 0.1);
    --shadow-md: 0 4px 16px rgba(6, 182, 212, 0.15);
    --shadow-lg: 0 8px 32px rgba(6, 182, 212, 0.2);

    --button-bg: linear-gradient(135deg, #06b6d4, #0891b2);
    --button-hover: linear-gradient(135deg, #0891b2, #0e7490);
    --button-text: #ffffff;
}

/* Tema oscuro (manual con checkbox) */
.theme-toggle-checkbox:checked~.container {
    --bg-primary: #0a1929;
    --bg-secondary: #0f2942;
    --bg-gradient-start: #237ad8;
    --bg-gradient-end: #6791c9;

    --text-primary: #e0f2fe;
    --text-secondary: #bae6fd;
    --text-muted: #67e8f9;

    --cyan-light: #22d3ee;
    --cyan-main: #06b6d4;
    --cyan-dark: #67e8f9;
    --cyan-accent: #0891b2;

    --shadow-sm: 0 2px 8px rgba(34, 211, 238, 0.15);
    --shadow-md: 0 4px 16px rgba(34, 211, 238, 0.2);
    --shadow-lg: 0 8px 32px rgba(34, 211, 238, 0.25);

    --button-bg: linear-gradient(135deg, #0891b2, #06b6d4);
    --button-hover: linear-gradient(135deg, #0e7490, #0891b2);
}

/* Preferencia del sistema (detección automática) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0a1929;
        --bg-secondary: #0f2942;
        --bg-gradient-start: #086e7a;
        --bg-gradient-end: #004950;

        --text-primary: #e0f2fe;
        --text-secondary: #bae6fd;
        --text-muted: #67e8f9;

        --cyan-light: #22d3ee;
        --cyan-main: #06b6d4;
        --cyan-dark: #67e8f9;
        --cyan-accent: #0891b2;

        --shadow-sm: 0 2px 8px rgba(34, 211, 238, 0.15);
        --shadow-md: 0 4px 16px rgba(34, 211, 238, 0.2);
        --shadow-lg: 0 8px 32px rgba(34, 211, 238, 0.25);

        --button-bg: linear-gradient(95deg, #05979e, #2a9fa5);
        --button-hover: linear-gradient(135deg, #0e7490, #0891b2);
    }

    /* Cuando el checkbox está marcado en modo oscuro del sistema, volver a tema claro */
    .theme-toggle-checkbox:checked~.container {
        --bg-primary: #f0f9ff;
        --bg-secondary: #ffffff;
        --bg-gradient-start: #e0f2fe;
        --bg-gradient-end: #f0f9ff;

        --text-primary: #004950;
        --text-secondary: #075985;
        --text-muted: #0891b2;

        --cyan-light: #67e8f9;
        --cyan-main: #06b6d4;
        --cyan-dark: #0e7490;
        --cyan-accent: #22d3ee;

        --shadow-sm: 0 2px 8px #087386;
        --shadow-md: 0 4px 16px #689da7;
        --shadow-lg: 0 8px 32px #087386;

        --button-bg: linear-gradient(95deg, #05979e, #2a9fa5);
        --button-hover: linear-gradient(135deg, #0891b2, #0e7490);
    }

    .logo-img-light {
        display: none;
    }

    .logo-img-dark {
        display: inline-block;
    }

    .theme-toggle-checkbox:checked~.container .logo-img-light {
        display: inline-block;
    }

    .theme-toggle-checkbox:checked~.container .logo-img-dark {
        display: none;
    }
}

/* ============================================
   Reset y estilos base
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* ============================================
   Checkbox oculto para toggle de tema
   ============================================ */

.theme-toggle-checkbox {
    display: none;
}

/* ============================================
   Botón de cambio de tema
   ============================================ */

.theme-toggle-btn {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    border: 2px solid var(--cyan-main);
}

.theme-toggle-btn:hover {
    transform: scale(1.1);
}

.theme-toggle-btn svg {
    width: 24px;
    height: 24px;
    color: var(--cyan-main);
    transition: all 0.3s ease;
}

.sun-icon {
    display: block;
    position: absolute;
}

.moon-icon {
    display: none;
    position: absolute;
}

/* Cambiar iconos según el estado del checkbox */
.theme-toggle-checkbox:checked~.container .theme-toggle-btn .sun-icon {
    display: none;
}

.theme-toggle-checkbox:checked~.container .theme-toggle-btn .moon-icon {
    display: block;
}

@media (prefers-color-scheme: dark) {
    .sun-icon {
        display: none;
    }

    .moon-icon {
        display: block;
    }

    .theme-toggle-checkbox:checked~.container .theme-toggle-btn .sun-icon {
        display: block;
    }

    .theme-toggle-checkbox:checked~.container .theme-toggle-btn .moon-icon {
        display: none;
    }
}

/* ============================================
   Contenedor principal
   ============================================ */

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    transition: background 0.5s ease;
    position: relative;
}

/* Patrón de fondo decorativo */
.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}



/* ============================================
   Contenido principal
   ============================================ */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    animation: fadeIn 1.2s ease-out;
    height: 100vh;
}

.title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.2;
    animation: slideInUp 0.8s ease-out;
}


.cta-button {
    padding: 1.2rem 3rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--button-text);
    background: var(--button-bg);
    border-radius: 50px;
    text-decoration: none;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 6rem;
    animation: slideInUp 1.2s ease-out;
}

.logo-img {
    width: 14em;
    height: 14em;
    border-radius: 50%;
    object-fit: cover;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.cta-button:hover::before {
    width: 300px;
    height: 300px;
}

.cta-button:hover {
    transform: translateY(-3px);
}

.cta-button:active {
    transform: translateY(-1px);
}

/* ============================================
   Footer con logo
   ============================================ */

.footer {
    padding-bottom: 1rem;
    transition: background 0.5s ease;
}

.logo-container {
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
    animation: fadeInUp 1.4s ease-out;
}

.logo-img-light,
.logo-img-dark {
    height: 10em;
    transition: opacity 0.3s ease;
}

.logo-img-light {
    display: inline-block;
}

.logo-img-dark {
    display: none;
}

/* Hide light logo and show dark logo when dark mode is active via toggle */
.theme-toggle-checkbox:checked~.container .logo-img-light {
    display: none;
}

.theme-toggle-checkbox:checked~.container .logo-img-dark {
    display: inline-block;
}

.company-name {
    font-size: 2rem;
    font-weight: 800;
    color: var(--cyan-main);
    letter-spacing: 2px;
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ============================================
   Animaciones
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .theme-toggle-btn {
        top: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }


    .main-content {
        padding: 1.5rem;
    }

    .title {
        margin-bottom: 0.75rem;
    }

    .cta-button {
        padding: 1rem 2.5rem;
        font-size: 1.1rem;
    }

    .footer {
        padding: 2rem 1rem;
    }
}

@media (max-width: 480px) {
    .theme-toggle-btn {
        width: 40px;
        height: 40px;
    }

    .theme-toggle-btn svg {
        width: 20px;
        height: 20px;
    }

    .cta-button {
        padding: 0.9rem 2rem;
        font-size: 1rem;
    }
}

/* ============================================
   Mejoras de accesibilidad
   ============================================ */

.cta-button:focus,
.theme-toggle-btn:focus {
    outline: 3px solid var(--cyan-accent);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}