/* =========================================================================
   Red&Bit - Design System & Styles
   Premium Dark Theme Web Interface
   ========================================================================= */

:root {
    /* Brand Colors */
    --primary: #EB3C01;
    --primary-light: #ff5722;
    --primary-dark: #b82d00;
    --primary-glow: rgba(235, 60, 1, 0.4);

    /* Backgrounds & Surfaces */
    --bg-base: #07070a;
    --bg-darker: #040406;
    --bg-light: #f8f9fa;
    --bg-light-alt: #ffffff;
    --bg-panel: rgba(20, 20, 25, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-dark: rgba(0, 0, 0, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.03);

    /* Typography Colors */
    --text-main: #fcfcfd;
    --text-muted: #a0a0ab;
    --text-dark: #6e6e7a;
    --text-light-main: #1a1a24;
    --text-light-muted: #52525b;

    /* Structural */
    --container-max: 1200px;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;

    /* Timing */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* =========================================================================
   Reset & Base Styles
   ========================================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--text-dark);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Selections */
::selection {
    background-color: var(--primary);
    color: #fff;
}

/* Layout Utilities */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

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

.text-primary {
    color: var(--primary);
}

.bg-darker {
    background-color: var(--bg-darker);
}

.bg-light-alt {
    background-color: var(--bg-light-alt) !important;
}

.section-padding {
    padding: 6rem 0;
}

/* Light Theme Section Modifiers */
.light-section {
    background-color: var(--bg-light);
    color: var(--text-light-main);
}

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

.light-section .section-desc {
    color: var(--text-light-muted);
}

.light-section .glass-card {
    background: #ffffff;
    border: 1px solid var(--glass-border-dark);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

.light-section .glass-card::before {
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.02), transparent);
}

.light-section .card h3 {
    color: var(--text-light-main);
}

.light-section .card p {
    color: var(--text-light-muted);
}

.light-section .card:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08), inset 0 0 0 1px rgba(235, 60, 1, 0.2);
}

.light-section .feature-list strong {
    color: var(--text-light-main);
}

.light-section .feature-list p {
    color: var(--text-light-muted);
}

.light-section .input-field {
    background: #ffffff;
    border: 1px solid var(--glass-border-dark);
    color: var(--text-light-main);
}

.light-section .input-field::placeholder {
    color: var(--text-light-muted);
}

.light-section .input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(235, 60, 1, 0.1);
}

.text-gradient {
    background: linear-gradient(135deg, #fff 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =========================================================================
   Typography
   ========================================================================= */
h1,
h2,
h3,
h4 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.section-title {
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    margin-bottom: 1rem;
}

.section-desc {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 3rem;
}

/* =========================================================================
   Components
   ========================================================================= */
/* Environment Glows */
.ambient-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.15;
}

.glow-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
}

.glow-2 {
    bottom: -20%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--primary-dark) 0%, transparent 60%);
}

/* Glassmorphism */
.glass-card {
    background: var(--bg-panel);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-highlight), transparent);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-base);
    cursor: pointer;
    border: none;
    font-family: inherit;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.5rem 1.2rem;
    font-size: 0.9rem;
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(235, 60, 1, 0.2);
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--primary-glow);
}

.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-muted);
}

/* =========================================================================
   Navbar
   ========================================================================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 1.2rem 0;
    transition: var(--transition-base);
}

.navbar.has-glass {
    background: rgba(7, 7, 10, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.05em;
}

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 2.5rem;
}

.nav-links a:not(.btn) {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color var(--transition-fast);
}

.nav-links a:not(.btn):hover {
    color: var(--primary);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
}

.mobile-menu-btn span {
    width: 24px;
    height: 2px;
    background-color: var(--text-main);
    border-radius: 2px;
}

/* =========================================================================
   Hero Section
   ========================================================================= */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: rgba(235, 60, 1, 0.1);
    border: 1px solid rgba(235, 60, 1, 0.2);
    color: var(--primary);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hero-title {
    font-size: clamp(3rem, 5vw, 4.5rem);
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 500px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

/* CSS Tech Sphere Animation */
.tech-sphere-container {
    position: relative;
    width: 400px;
    height: 400px;
    margin: 0 auto;
    perspective: 1000px;
}

.tech-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 1px solid rgba(235, 60, 1, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transform-style: preserve-3d;
}

.ring-1 {
    width: 100%;
    height: 100%;
    animation: rotateX 15s linear infinite;
    border-top: 2px solid var(--primary);
}

.ring-2 {
    width: 80%;
    height: 80%;
    animation: rotateY 12s linear infinite reverse;
    border-right: 2px solid var(--primary);
}

.ring-3 {
    width: 60%;
    height: 60%;
    animation: rotateZ 10s linear infinite;
    border-bottom: 2px solid var(--primary);
}

.tech-core {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20%;
    height: 20%;
    background: var(--primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 40px var(--primary);
    animation: corePulse 3s ease-in-out infinite;
}

@keyframes rotateX {
    0% {
        transform: translate(-50%, -50%) rotateX(0deg) rotateY(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotateX(360deg) rotateY(180deg);
    }
}

@keyframes rotateY {
    0% {
        transform: translate(-50%, -50%) rotateY(0deg) rotateZ(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotateY(360deg) rotateZ(180deg);
    }
}

@keyframes rotateZ {
    0% {
        transform: translate(-50%, -50%) rotateZ(0deg) rotateX(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotateZ(360deg) rotateX(180deg);
    }
}

@keyframes corePulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 30px var(--primary-glow);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: 0 0 60px var(--primary);
    }
}

/* =========================================================================
   Services Section
   ========================================================================= */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    padding: 2.5rem;
    transition: var(--transition-base);
}

.card:hover {
    transform: translateY(-10px);
    border-color: rgba(235, 60, 1, 0.3);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(235, 60, 1, 0.1);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    display: inline-block;
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #fff;
}

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

/* =========================================================================
   Processes Section (Split layout)
   ========================================================================= */
.align-center {
    align-items: center;
}

.feature-list {
    list-style: none;
    margin-top: 2rem;
}

.feature-list li {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: flex-start;
}

.check-icon {
    background: rgba(235, 60, 1, 0.15);
    color: var(--primary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
    font-weight: bold;
}

.feature-list strong {
    color: #fff;
    display: block;
    margin-bottom: 0.2rem;
}

.feature-list p {
    color: var(--text-muted);
}

/* Code Window UI */
.code-window {
    border-radius: var(--radius-md);
    padding: 0;
}

.window-header {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--glass-border);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red {
    background: #ff5f56;
}

.dot.yellow {
    background: #ffbd2e;
}

.dot.green {
    background: #27c93f;
}

.window-title {
    margin-left: auto;
    margin-right: auto;
    color: var(--text-dark);
    font-size: 0.85rem;
    font-family: monospace;
}

.window-body {
    padding: 1.5rem;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9rem;
    line-height: 1.7;
    color: #e5e5e5;
}

.window-body code {
    display: block;
}

.keyword {
    color: var(--primary);
}

.function {
    color: #569cd6;
}

.class-name {
    color: #4ec9b0;
}

.string {
    color: #ce9178;
}

.cursor {
    animation: blink 1s step-end infinite;
    color: var(--primary);
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* =========================================================================
   Contact / CTA
   ========================================================================= */
.border-primary {
    border: 1px solid rgba(235, 60, 1, 0.3);
}

.cta-content {
    padding: 4rem 2rem;
    max-width: 700px;
    margin: 0 auto;
}

.subscribe-form {
    display: flex;
    gap: 1rem;
    margin-top: 2.5rem;
}

.input-field {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    padding: 1rem 1.5rem;
    border-radius: 50px;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: var(--transition-base);
}

.input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(235, 60, 1, 0.1);
}

/* =========================================================================
   Footer
   ========================================================================= */
.footer {
    border-top: 1px solid var(--glass-border);
    padding: 4rem 0 2rem;
    background: var(--bg-darker);
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand p {
    color: var(--text-muted);
    margin-top: 1rem;
    max-width: 300px;
}

.footer-links h4 {
    margin-bottom: 1.5rem;
    color: #fff;
}

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

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
    color: var(--text-dark);
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.social-links a:hover {
    color: #fff;
}

/* =========================================================================
   Animations & Responsive
   ========================================================================= */
/* Animations */
.fade-in-up,
.fade-in-left,
.fade-in-right {
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s ease-out;
}

.fade-in-up {
    transform: translateY(40px);
}

.fade-in-left {
    transform: translateX(-40px);
}

.fade-in-right {
    transform: translateX(40px);
}

.scroll-trigger.visible {
    opacity: 1;
    transform: translate(0);
}

.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
}

.delay-4 {
    transition-delay: 0.4s;
}

/* Responsive Adjustments */
@media (max-width: 900px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .hide-mobile {
        display: none;
    }

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

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .subscribe-form {
        flex-direction: column;
    }

    .btn-lg {
        width: 100%;
    }

    .hero-actions {
        flex-direction: column;
    }
}

/* <- Aquí cierro el media query de mobile que había quedado abierto */

/* =========================================================================
   Chatbot Widget Styles
   ========================================================================= */
.chat-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 999;
    font-family: 'Outfit', sans-serif;
}

.chat-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(235, 60, 1, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
    background: var(--primary-light);
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 450px;
    background: var(--bg-panel);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform-origin: bottom right;
}

.chat-window.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.9);
}

.chat-header {
    background: rgba(235, 60, 1, 0.1);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.chat-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #fff;
}

.chat-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.chat-close-btn:hover {
    color: var(--primary);
}

.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 85%;
    padding: 0.8rem 1.2rem;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
    animation: fadeIn 0.3s ease;
}

.bot-message {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--glass-border);
}

.user-message {
    background: var(--primary);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-input-area {
    display: flex;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--glass-border);
    gap: 0.5rem;
}

#chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 0.8rem 1.2rem;
    color: #fff;
    outline: none;
    font-family: inherit;
}

#chat-input:focus {
    border-color: var(--primary);
}

.chat-send-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 0 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-send-btn:hover {
    background: var(--primary-light);
}

.quick-replies-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
    animation: fadeIn 0.4s ease;
}

.quick-reply-btn {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-base);
    font-family: inherit;
}

.quick-reply-btn:hover {
    background: var(--primary);
    color: white;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .chat-window {
        width: 300px;
        right: -10px;
    }
}