/* Reset and Base Styles - Optimized for performance */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #FF6F00 0%, #FFA726 100%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Login Screen Styles */
.login-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.logo-section {
    margin-bottom: 30px;
}

.logo-icon {
    font-size: 3rem;
    color: #FF6F00;
    margin-bottom: 15px;
}

.logo-section h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 5px;
}

.logo-section p {
    color: #718096;
    font-size: 1rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group i {
    position: absolute;
    left: 15px;
    color: #a0aec0;
    z-index: 1;
}

.input-group input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f7fafc;
}

.input-group input:focus {
    outline: none;
    border-color: #FF6F00;
    box-shadow: 0 0 0 3px rgba(255, 111, 0, 0.1);
    background: white;
}

.btn-primary {
    background: linear-gradient(135deg, #FF6F00 0%, #FFA726 100%);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 111, 0, 0.3);
}

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

.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #feb2b2;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

/* Dashboard Styles */
#dashboard-screen {
    display: block;
    padding: 0;
    background: #f7fafc;
}

.dashboard-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-left i {
    font-size: 1.5rem;
    color: #FF6F00;
}

.header-left h1 {
    font-size: 1.2rem;
    color: #2d3748;
    font-weight: 700;
    white-space: nowrap;
}

.btn-logout {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: #c53030;
    transform: translateY(-1px);
}

.dashboard-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.sectors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.sector-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.sector-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.sector-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #FF6F00 0%, #FFA726 100%);
}

.sector-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #FF6F00 0%, #FFA726 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.sector-icon i {
    font-size: 1.5rem;
    color: white;
}

.sector-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
}

.sector-card p {
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.card-footer {
    display: flex;
    justify-content: flex-end;
    color: #a0aec0;
}

.card-footer i {
    transition: all 0.3s ease;
}

.sector-card:hover .card-footer i {
    color: #FF6F00;
    transform: translateX(3px);
}

/* Navigation Tabs */
.dashboard-nav {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border-top: 1px solid #e2e8f0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    justify-content: center;
}

.nav-tab {
    background: transparent;
    border: none;
    padding: 20px 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: #718096;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    flex: 1;
    min-width: 200px;
    justify-content: center;
}

.nav-tab:hover {
    color: #FF6F00;
    background: rgba(255, 111, 0, 0.05);
}

.nav-tab.active {
    color: #FF6F00;
    border-bottom-color: #FF6F00;
    background: rgba(255, 111, 0, 0.05);
}

.nav-tab i {
    font-size: 1.1rem;
}

.whatsapp-support {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%) !important;
    color: white !important;
    border-radius: 12px;
    margin: 10px 5px;
    padding: 12px 20px;
    transition: all 0.3s ease;
    min-width: 180px;
}

.whatsapp-support:hover {
    background: linear-gradient(135deg, #128C7E 0%, #25D366 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.3);
}

.whatsapp-support:active {
    transform: translateY(0);
}

/* Section Content */
.section-content {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Tutorial Section Styles */
.tutorial-container {
    max-width: 1200px;
    margin: 0 auto;
}

.tutorial-container h2 {
    text-align: center;
    font-size: 2.2rem;
    color: #2d3748;
    margin-bottom: 10px;
}

.tutorial-description {
    text-align: center;
    color: #718096;
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 30px;
}

.video-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.video-card h3 {
    color: #2d3748;
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.video-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
    margin-bottom: 15px;
    border-radius: 12px;
    overflow: hidden;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-card p {
    color: #718096;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Consultoria Section Styles */
.consultoria-container {
    max-width: 800px;
    margin: 0 auto;
}

.consultoria-hero {
    text-align: center;
    margin-bottom: 50px;
}

.consultoria-hero h2 {
    font-size: 2.4rem;
    color: #2d3748;
    margin-bottom: 15px;
}

.consultoria-subtitle {
    font-size: 1.2rem;
    color: #718096;
}

.consultoria-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

.consultoria-benefits {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.consultoria-benefits h3 {
    color: #2d3748;
    font-size: 1.4rem;
    margin-bottom: 20px;
}

.consultoria-benefits ul {
    list-style: none;
    padding: 0;
}

.consultoria-benefits li {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 1rem;
    color: #4a5568;
}

.consultoria-benefits li i {
    color: #FF6F00;
    font-size: 1.2rem;
}

.consultoria-cta {
    background: linear-gradient(135deg, #FF6F00 0%, #FFA726 100%);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    color: white;
}

.consultoria-cta h3 {
    font-size: 1.6rem;
    margin-bottom: 15px;
}

.consultoria-cta p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.btn-consultoria {
    background: white;
    color: #FF6F00;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-consultoria:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* WhatsApp Floating Button */
.whatsapp-floating {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
}

.whatsapp-floating:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.6);
}

.whatsapp-floating i {
    color: white;
    font-size: 1.8rem;
}

.tooltip {
    position: absolute;
    bottom: 75px;
    right: 0;
    background: #2d3748;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 20px;
    border: 5px solid transparent;
    border-top-color: #2d3748;
}

.whatsapp-floating:hover .tooltip {
    opacity: 1;
    transform: translateY(0);
}

/* Loading Animation */
.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-primary.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Smooth transitions for screen changes */
.screen {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.screen.hidden {
    opacity: 0;
}

/* Responsive Design - Mobile First Approach */
@media (max-width: 768px) {
    .login-container {
        padding: 30px 25px;
        margin: 20px;
    }
    
    .logo-section h1 {
        font-size: 1.5rem;
    }
    
    .header-content {
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .header-left {
        gap: 8px;
    }
    
    .header-left h1 {
        font-size: 1rem;
    }
    
    .sectors-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .sector-card {
        padding: 25px;
    }
    
    .dashboard-main {
        padding: 30px 15px;
    }
    
    .nav-container {
        padding: 0 15px;
        justify-content: stretch;
    }
    
    .nav-tab {
        padding: 15px 20px;
        font-size: 0.9rem;
        min-width: auto;
        flex: 1;
    }
    
    .whatsapp-support {
        margin: 5px 0;
        min-width: auto;
        flex-basis: 100%;
        margin-top: 10px;
    }
    
    .tutorial-container h2 {
        font-size: 1.8rem;
    }
    
    .videos-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .video-card {
        padding: 20px;
    }
    
    .consultoria-hero h2 {
        font-size: 1.8rem;
    }
    
    .consultoria-subtitle {
        font-size: 1rem;
    }
    
    .consultoria-benefits,
    .consultoria-cta {
        padding: 25px;
    }
    
    .whatsapp-floating {
        width: 55px;
        height: 55px;
        bottom: 20px;
        right: 20px;
    }
    
    .whatsapp-floating i {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 25px 20px;
    }
    
    .sector-card {
        padding: 20px;
    }
    
    .sector-icon {
        width: 50px;
        height: 50px;
    }
    
    .sector-icon i {
        font-size: 1.2rem;
    }
    
    .header-left i {
        font-size: 1.2rem;
    }
    
    .nav-tab {
        padding: 12px 15px;
        font-size: 0.8rem;
    }
    
    .whatsapp-support {
        font-size: 0.75rem;
        padding: 10px 15px;
    }
    
    .nav-tab i {
        font-size: 1rem;
    }
    
    .tutorial-container h2 {
        font-size: 1.5rem;
    }
    
    .videos-grid {
        grid-template-columns: 1fr;
    }
    
    .consultoria-hero h2 {
        font-size: 1.5rem;
    }
    
    .consultoria-benefits {
        padding: 20px;
    }
    
    .consultoria-cta {
        padding: 30px 20px;
    }
    
    .btn-consultoria {
        padding: 12px 25px;
        font-size: 1rem;
    }
}

/* Print styles */
@media print {
    .whatsapp-floating,
    .btn-logout {
        display: none !important;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}