/* internet/css/main.css - Sistema de diseño del Portal ISP iTeck */

:root {
    /* Tema Claro */
    --light-bg: #f8fafc;
    --light-surface: #ffffff;
    --light-border: #e2e8f0;
    --light-text: #0f172a;
    --light-text-muted: #64748b;
    
    /* Tema Oscuro (Defecto) */
    --dark-bg: #090e1a;
    --dark-surface: #111827;
    --dark-border: #1f2937;
    --dark-text: #f9fafb;
    --dark-text-muted: #9ca3af;

    /* Colores de Marca */
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.15);
    --secondary: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    /* Transiciones */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Clases de Tema */
body.theme-light {
    --bg: var(--light-bg);
    --surface: var(--light-surface);
    --border: var(--light-border);
    --text: var(--light-text);
    --text-muted: var(--light-text-muted);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
}

body.theme-dark {
    --bg: var(--dark-bg);
    --surface: var(--dark-surface);
    --border: var(--dark-border);
    --text: var(--dark-text);
    --text-muted: var(--dark-text-muted);
    --shadow: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
}

/* Reset general */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Accesibilidad: Skip Link y Focus */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    z-index: 100;
    transition: top 0.2s ease;
}
.skip-link:focus {
    top: 0;
}
*:focus-visible {
    outline: 3px solid var(--secondary);
    outline-offset: 4px;
}

/* Header & Nav */
.main-header {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1.5rem;
    position: relative;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    color: var(--text);
    flex-shrink: 0;
}

.brand-logo-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    background: transparent;
    object-fit: cover;
}

.brand-logo-text {
    display: flex;
    flex-direction: column;
}

.logo-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: 1.5px;
    line-height: 1.1;
}

.logo-tag {
    font-size: 0.62rem;
    letter-spacing: 3px;
    color: var(--primary);
    font-weight: 700;
    margin-top: -2px;
}

/* Nav Drawer (Desktop vs Mobile) */
.nav-drawer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-grow: 1;
    margin-left: 2rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.3rem;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    transition: color var(--transition-fast);
    padding: 0.3rem 0;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-btn-alt {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff !important;
    padding: 0.5rem 1.1rem;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.88rem;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.nav-btn-alt:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.4);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.portal-clientes-btn {
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    color: #000 !important;
    padding: 0.5rem 0.9rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 800;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.25);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.portal-clientes-btn:hover {
    box-shadow: 0 0 25px rgba(0, 242, 254, 0.6);
    transform: translateY(-1px);
}

.portal-clientes-btn svg {
    width: 14px;
    height: 14px;
}

/* Mobile Nav Toggle (Hamburguesa) */
.mobile-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 40px;
    height: 38px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 8px;
    cursor: pointer;
    z-index: 110;
    transition: background var(--transition-fast);
}

.mobile-nav-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
}

.hamburger-bar {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-nav-toggle.open .hamburger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-nav-toggle.open .hamburger-bar:nth-child(2) {
    opacity: 0;
}

.mobile-nav-toggle.open .hamburger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.5rem;
    border-radius: 8px;
    transition: color var(--transition-fast);
}

.theme-toggle:hover {
    color: var(--text);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

.admin-login-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    border: 1px solid var(--border);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    transition: var(--transition-fast);
}

.admin-login-link:hover {
    border-color: var(--text);
    color: var(--text);
}

/* Hero Section */
.hero {
    padding: 5rem 1.5rem;
    text-align: center;
    background: radial-gradient(circle at top, var(--primary-glow) 0%, transparent 60%);
    position: relative;
    overflow: hidden;
}

.hero-container {
    max-width: 800px;
    margin: 0 auto;
}

.badge {
    display: inline-block;
    background: var(--primary-glow);
    color: var(--primary);
    padding: 0.35rem 1rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.hero h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.hero-ctas {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 0.8rem 1.6rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: background var(--transition-fast);
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.8rem 1.6rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* General Layout sections */
.section {
    padding: 5rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 3rem;
}

/* Packages and Tables (Requisitos_PáginaWeb Point 5) */
.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.package-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

.package-card.featured {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.15);
}

.package-header {
    margin-bottom: 1.5rem;
}

.package-type {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.package-card h3 {
    font-size: 1.8rem;
    font-family: 'Outfit', sans-serif;
    margin-bottom: 0.5rem;
}

.package-speed {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 1rem;
    font-family: 'Outfit', sans-serif;
}

.package-speed span {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
}

.package-price {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.package-price span {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-muted);
}

.package-details {
    list-style: none;
    margin-bottom: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.package-details li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.package-details svg {
    color: var(--success);
    width: 16px;
    height: 16px;
}

.tariff-folio {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Interactive Table for tariffs transparency */
.table-container {
    overflow-x: auto;
    margin-top: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.tariff-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.tariff-table th, .tariff-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.tariff-table th {
    background-color: rgba(255, 255, 255, 0.02);
    font-weight: 600;
}

.tariff-table tr:hover {
    background-color: rgba(255, 255, 255, 0.01);
}

/* Link IFT Visor Legend (Requisitos_PáginaWeb Point 6) */
.ift-link-box {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.ift-link-box a {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 600;
}

/* Interactive SVG Map (Requisitos_PáginaWeb Point 8) */
.map-container {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.map-svg {
    max-width: 600px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.1));
}

.map-state {
    fill: rgba(59, 130, 246, 0.1);
    stroke: var(--border);
    stroke-width: 1.5;
    transition: fill 0.3s ease;
}

.map-state.active {
    fill: rgba(59, 130, 246, 0.35);
    stroke: var(--primary);
    cursor: pointer;
}

.map-state.active:hover {
    fill: rgba(59, 130, 246, 0.55);
}

.map-pin {
    fill: var(--secondary);
    stroke: #fff;
    stroke-width: 1;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.coverage-details {
    margin-top: 1.5rem;
    text-align: center;
}

/* Forms */
.form-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 3rem;
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background-color: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
}

.form-input:focus {
    border-color: var(--primary);
    outline: none;
}

.btn-submit {
    width: 100%;
    background-color: var(--primary);
    color: white;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.btn-submit:hover {
    background-color: #2563eb;
}

/* Legal content pages */
.legal-container {
    max-width: 900px;
    margin: 0 auto;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 3.5rem;
}

.legal-section {
    margin-bottom: 3rem;
}

.legal-section h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--primary-glow);
    padding-bottom: 0.5rem;
}

.legal-section p, .legal-section li {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.legal-section ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

/* Footer & Security Justice box */
.main-footer {
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    padding: 4rem 1.5rem 2rem;
    margin-top: auto;
}

.footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    margin-bottom: 1.5rem;
}

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

.footer-col li {
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

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

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

.security-justice-box {
    max-width: 1200px;
    margin: 0 auto 3rem;
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    padding: 2rem;
}

.security-justice-box h4 {
    font-family: 'Outfit', sans-serif;
    color: var(--error);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.security-justice-box p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    border-top: 1px solid var(--border);
    padding-top: 2rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.web-credits {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    opacity: 0.6;
}

/* Responsiveness & Mobile Overhaul */
@keyframes slideDownNav {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 992px) {
    .mobile-nav-toggle {
        display: flex;
    }

    .nav-drawer {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--surface);
        border-bottom: 1px solid var(--border);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 1.5rem;
        flex-direction: column;
        gap: 1.2rem;
        margin-left: 0;
        z-index: 100;
    }

    .nav-drawer.active {
        display: flex;
        animation: slideDownNav 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .nav-menu {
        flex-direction: column;
        width: 100%;
        gap: 0.8rem;
        align-items: stretch;
    }

    .nav-link {
        font-size: 1.05rem;
        padding: 0.6rem 0.8rem;
        border-radius: 8px;
        text-align: center;
        background: rgba(255, 255, 255, 0.02);
    }

    .nav-link:hover {
        background: rgba(0, 242, 254, 0.08);
    }

    .nav-btn-alt {
        width: 100%;
        text-align: center;
        padding: 0.75rem;
        font-size: 1rem;
    }

    .header-actions {
        flex-direction: column;
        width: 100%;
        gap: 0.8rem;
        margin-top: 0.5rem;
        border-top: 1px solid var(--border);
        padding-top: 1rem;
    }

    .portal-clientes-btn {
        width: 100% !important;
        justify-content: center;
        padding: 0.75rem !important;
        font-size: 0.95rem !important;
        margin-right: 0 !important;
    }

    .admin-login-link {
        width: 100%;
        text-align: center;
        padding: 0.6rem;
    }

    .hero {
        padding: 3.5rem 1rem 2rem;
    }

    .hero h1 {
        font-size: clamp(1.8rem, 6vw, 2.5rem);
        line-height: 1.2;
    }

    .hero p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .hero-ctas {
        flex-direction: column;
        gap: 0.8rem;
        align-items: stretch;
        max-width: 380px;
        margin: 0 auto;
    }

    .hero-ctas .btn-primary, 
    .hero-ctas .btn-secondary {
        width: 100%;
        text-align: center;
        justify-content: center;
        padding: 0.85rem 1.5rem;
        font-size: 1rem;
    }

    .packages-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        max-width: 450px;
        margin: 0 auto 3rem;
    }

    .package-card {
        padding: 1.8rem 1.5rem;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .legal-container {
        padding: 1rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .security-justice-box {
        padding: 1.2rem;
    }

    /* Redes sociales flotantes en móvil: compactas y bien ubicadas */
    .social-floating-bar {
        right: 12px !important;
        bottom: 20px !important;
        gap: 8px !important;
    }

    .social-floating-btn {
        width: 42px !important;
        height: 42px !important;
        border-radius: 10px !important;
    }

    .social-floating-btn svg {
        width: 18px !important;
        height: 18px !important;
    }
}
