/* ===== COMPONENTES - CODEMETRIA ===== */

/* ---- Loader ---- */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-loader);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

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

.loader-logo {
    width: 110px;
    height: 110px;
    margin: 0 auto var(--space-xl);
    animation: loaderPulse 0.8s ease-in-out infinite;
    border-radius: var(--radius-md);
    filter: drop-shadow(0 0 20px rgba(var(--primary-rgb), 0.4));
}

.loader-bar {
    width: 220px;
    height: 3px;
    background: rgba(var(--primary-rgb), 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.loader-progress {
    width: 0%;
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    animation: loading 0.5s ease-in-out forwards;
    box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.5);
}

@keyframes loading {
    0% {
        width: 0%;
    }

    50% {
        width: 70%;
    }

    100% {
        width: 100%;
    }
}

@keyframes loaderPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
        filter: drop-shadow(0 0 20px rgba(var(--primary-rgb), 0.4));
    }

    50% {
        transform: scale(1.08);
        opacity: 0.85;
        filter: drop-shadow(0 0 30px rgba(var(--primary-rgb), 0.6));
    }
}

/* ---- Botones ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.8rem 1.85rem;
    font-family: var(--font-primary);
    font-size: var(--fs-sm);
    font-weight: 600;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.02em;
}

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

.btn:active::after {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-glow-sm);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow-lg);
    filter: brightness(1.1);
}

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

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid rgba(var(--primary-rgb), 0.25);
    backdrop-filter: blur(10px);
}

.btn-outline:hover {
    background: rgba(var(--primary-rgb), 0.08);
    border-color: var(--primary);
    color: var(--primary-light);
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(var(--primary-rgb), 0.15);
}

.btn-lg {
    padding: 1.05rem 2.5rem;
    font-size: var(--fs-base);
}

.btn-sm {
    padding: 0.5rem 1.25rem;
    font-size: var(--fs-xs);
}

/* ---- Cards de Servicio ---- */
.service-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-glow);
    opacity: 0;
    transition: opacity var(--transition-base);
    pointer-events: none;
}

.service-card:hover {
    transform: translateY(-8px);
    border-color: rgba(var(--primary-rgb), 0.25);
    box-shadow: var(--shadow-lg), 0 0 40px rgba(var(--primary-rgb), 0.08);
}

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

.service-card:hover::after {
    opacity: 1;
}

.service-icon {
    width: 64px;
    height: 64px;
    background: rgba(var(--primary-rgb), 0.08);
    border: 1px solid rgba(var(--primary-rgb), 0.12);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-lg);
    font-size: var(--fs-xl);
    color: var(--primary-light);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.service-card:hover .service-icon {
    background: var(--gradient-primary);
    color: white;
    transform: scale(1.1) rotate(-3deg);
    box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.3);
    border-color: transparent;
}

.service-card h3 {
    margin-bottom: var(--space-sm);
    font-size: var(--fs-lg);
    position: relative;
    z-index: 1;
}

.service-card p {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
    line-height: 1.7;
    position: relative;
    z-index: 1;
}

.service-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--primary-light);
    font-size: var(--fs-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
    z-index: 1;
}

.service-link:hover {
    gap: var(--space-md);
    color: var(--secondary);
}

/* ---- Cards de Proyecto ---- */
.project-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: rgba(var(--primary-rgb), 0.25);
    box-shadow: var(--shadow-lg), 0 0 40px rgba(var(--primary-rgb), 0.08);
}

.project-image {
    height: 220px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-card-large .project-image {
    height: 300px;
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: flex-end;
    padding: var(--space-lg);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-tags {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.tag {
    padding: var(--space-xs) var(--space-md);
    background: rgba(var(--primary-rgb), 0.8);
    color: white;
    font-size: var(--fs-xs);
    font-weight: 500;
    border-radius: var(--radius-full);
    backdrop-filter: blur(10px);
}

.project-info {
    padding: var(--space-xl);
}

.project-info h3 {
    margin-bottom: var(--space-sm);
    font-size: var(--fs-lg);
}

.project-info p {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--primary-light);
    font-size: var(--fs-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.project-link:hover {
    gap: var(--space-md);
    color: var(--secondary);
}

/* ---- Showcase Projects (Index) ---- */
.showcase-projects {
    display: flex;
    flex-direction: column;
    gap: var(--space-3xl);
}

.showcase-card {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.showcase-card:hover {
    border-color: rgba(var(--primary-rgb), 0.25);
    box-shadow: var(--shadow-lg), 0 0 60px rgba(var(--primary-rgb), 0.08);
    transform: translateY(-4px);
}

.showcase-card--reverse {
    direction: rtl;
}

.showcase-card--reverse>* {
    direction: ltr;
}

.showcase-image {
    position: relative;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.showcase-image img {
    max-width: 55%;
    max-height: 55%;
    object-fit: contain;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.showcase-card:hover .showcase-image img {
    transform: scale(1.05);
}

.showcase-image--cover img {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: none;
}

.showcase-tags {
    position: absolute;
    bottom: var(--space-lg);
    left: var(--space-lg);
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.4s ease;
}

.showcase-card:hover .showcase-tags {
    opacity: 1;
    transform: translateY(0);
}

.showcase-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-3xl);
    position: relative;
}

.showcase-number {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: var(--space-md);
}

.showcase-info h3 {
    font-size: var(--fs-2xl);
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.showcase-info p {
    font-size: var(--fs-base);
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: var(--space-xl);
}

/* ---- Proceso ---- */
.process-step {
    display: flex;
    align-items: flex-start;
    gap: var(--space-xl);
    padding: var(--space-2xl);
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.process-step::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.process-step:hover {
    border-color: rgba(var(--primary-rgb), 0.25);
    transform: translateX(8px);
    box-shadow: var(--shadow-md);
}

.process-step:hover::after {
    opacity: 1;
}

.step-number {
    font-family: var(--font-heading);
    font-size: var(--fs-3xl);
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    flex-shrink: 0;
}

.step-content h3 {
    margin-bottom: var(--space-sm);
}

.step-content p {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    margin-bottom: 0;
}

/* ---- Testimonios ---- */
.testimonial-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    position: relative;
}

.testimonial-card::before {
    content: '\201C';
    position: absolute;
    top: var(--space-lg);
    right: var(--space-xl);
    font-size: 4rem;
    font-family: Georgia, serif;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.15;
    line-height: 1;
}

.testimonial-card:hover {
    border-color: rgba(var(--primary-rgb), 0.25);
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.testimonial-stars {
    color: #FFD700;
    margin-bottom: var(--space-lg);
    font-size: var(--fs-sm);
    display: flex;
    gap: 2px;
}

.testimonial-text {
    font-size: var(--fs-base);
    font-style: italic;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: var(--space-xl);
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.author-avatar {
    width: 48px;
    height: 48px;
    background: rgba(var(--primary-rgb), 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    font-size: var(--fs-lg);
}

.testimonial-author strong {
    display: block;
    color: var(--text-primary);
    font-size: var(--fs-sm);
}

.testimonial-author span {
    font-size: var(--fs-xs);
    color: var(--text-muted);
}

/* ---- CTA Section ---- */
.cta-section {
    background: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(var(--primary-rgb), 0.06) 0%, transparent 50%),
        radial-gradient(circle at 70% 50%, rgba(var(--secondary-rgb), 0.04) 0%, transparent 50%);
    animation: ctaFloat 15s ease-in-out infinite alternate;
}

@keyframes ctaFloat {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(-30px, -20px);
    }
}

.cta-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.cta-content h2 {
    font-size: var(--fs-3xl);
    margin-bottom: var(--space-lg);
}

.cta-content p {
    font-size: var(--fs-md);
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto var(--space-2xl);
}

.cta-buttons {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* ---- Formulario ---- */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    color: var(--text-primary);
    font-size: var(--fs-sm);
    font-weight: 500;
    margin-bottom: var(--space-sm);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.95rem 1.3rem;
    background: rgba(var(--primary-rgb), 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: var(--fs-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.08);
    background: rgba(var(--primary-rgb), 0.06);
}

.form-group textarea {
    resize: vertical;
    min-height: 140px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237878A0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

.form-group select option {
    background: #141432;
    color: #FFFFFF;
    padding: 0.5rem;
}

/* ---- Pricing / Planes ---- */
.pricing-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    backdrop-filter: blur(10px);
}

.pricing-card.featured {
    border-color: rgba(var(--primary-rgb), 0.4);
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(var(--primary-rgb), 0.1);
}

.pricing-card.featured::before {
    content: 'Popular';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-xs) var(--space-lg);
    background: var(--gradient-primary);
    color: white;
    font-size: var(--fs-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
}

.pricing-card:hover {
    transform: translateY(-8px);
    border-color: rgba(var(--primary-rgb), 0.25);
    box-shadow: var(--shadow-lg);
}

.pricing-card.featured:hover {
    transform: scale(1.05) translateY(-8px);
}

.pricing-card h3 {
    margin-bottom: var(--space-md);
}

.pricing-price {
    font-family: var(--font-heading);
    font-size: var(--fs-4xl);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.pricing-price span {
    font-size: var(--fs-base);
    font-weight: 400;
    color: var(--text-muted);
}

.pricing-description {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-xl);
}

.pricing-features {
    text-align: left;
    margin-bottom: var(--space-xl);
}

.pricing-features li {
    padding: var(--space-sm) 0;
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.pricing-features li i {
    color: var(--primary-light);
    font-size: var(--fs-xs);
}

/* ---- Team ---- */
.team-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.team-card:hover {
    transform: translateY(-8px);
    border-color: rgba(var(--primary-rgb), 0.25);
    box-shadow: var(--shadow-lg);
}

.team-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(var(--primary-rgb), 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-lg);
    font-size: var(--fs-3xl);
    color: var(--primary-light);
}

.team-card h3 {
    margin-bottom: var(--space-xs);
    font-size: var(--fs-lg);
}

.team-role {
    color: var(--primary-light);
    font-size: var(--fs-sm);
    font-weight: 500;
    margin-bottom: var(--space-md);
}

.team-card p {
    font-size: var(--fs-sm);
    color: var(--text-muted);
}

.team-social {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.team-social a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: var(--fs-sm);
    transition: all var(--transition-fast);
}

.team-social a:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ---- Page Hero ---- */
.page-hero {
    padding: calc(var(--space-5xl) + 80px) 0 var(--space-4xl);
    background: var(--gradient-hero);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(var(--primary-rgb), 0.1) 0%, transparent 60%),
        radial-gradient(circle at 70% 80%, rgba(var(--secondary-rgb), 0.06) 0%, transparent 50%);
}

.page-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(var(--primary-rgb), 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--primary-rgb), 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
}

.page-hero .container {
    position: relative;
    z-index: 1;
}

.page-hero h1 {
    font-size: var(--fs-4xl);
    margin-bottom: var(--space-lg);
}

.page-hero p {
    font-size: var(--fs-md);
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
    font-size: var(--fs-sm);
}

.breadcrumb a {
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.breadcrumb a:hover {
    color: var(--primary-light);
}

.breadcrumb span {
    color: var(--primary-light);
}

.breadcrumb i {
    color: var(--text-muted);
    font-size: var(--fs-xs);
}

/* ---- Legal Pages ---- */
.legal-content {
    max-width: 800px;
    margin: 0 auto;
}

.legal-section {
    margin-bottom: var(--space-2xl);
}

.legal-section h2 {
    font-family: var(--font-heading);
    font-size: var(--fs-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-color);
}

.legal-section p {
    font-size: var(--fs-md);
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: var(--space-sm);
}

.legal-section ul {
    list-style: none;
    padding: 0;
    margin: var(--space-sm) 0;
}

.legal-section ul li {
    position: relative;
    padding-left: var(--space-lg);
    margin-bottom: var(--space-xs);
    font-size: var(--fs-md);
    color: var(--text-secondary);
    line-height: 1.7;
}

.legal-section ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
}

.legal-section a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.legal-section a:hover {
    color: var(--primary);
    text-decoration: underline;
}