/* ===================================
   Variables CSS
   =================================== */
:root {
    /* Colores Principales */
    --primary: #2C5F2D;
    --primary-light: #4A8F4C;
    --primary-dark: #1A3A1B;
    
    --secondary: #F7931E;
    --secondary-light: #FFB84D;
    --secondary-dark: #D67A0E;
    
    /* Colores de Apoyo */
    --accent: #00A8E8;
    --success: #4CAF50;
    --warning: #FFC107;
    --error: #F44336;
    --info: #2196F3;
    
    /* Neutros */
    --gray-100: #F5F5F5;
    --gray-200: #EEEEEE;
    --gray-300: #E0E0E0;
    --gray-400: #BDBDBD;
    --gray-500: #9E9E9E;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121;
    
    --white: #FFFFFF;
    --black: #000000;
    
    /* Tipografía */
    --font-primary: 'Montserrat', sans-serif;
    --font-secondary: 'Open Sans', sans-serif;
    
    /* Sombras */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.2);
    
    /* Transiciones */
    --transition: all 0.3s ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-secondary);
    color: var(--gray-900);
    background-color: var(--gray-100);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ===================================
   Layout
   =================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ===================================
   Header
   =================================== */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 1.5rem 0;
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
    color: var(--white);
}

.logo p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

/* ===================================
   Progress Bar
   =================================== */
.progress-container {
    background: var(--white);
    padding: 1.5rem 0;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.progress-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 900px;
    margin: 0 auto;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 0 0 auto;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-300);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    z-index: 2;
}

.step-label {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--gray-600);
    text-align: center;
    transition: var(--transition);
}

.progress-step.active .step-circle {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 0 0 4px rgba(44, 95, 45, 0.2);
}

.progress-step.active .step-label {
    color: var(--primary);
    font-weight: 600;
}

.progress-step.completed .step-circle {
    background: var(--success);
    color: var(--white);
}

.progress-step.completed .step-label {
    color: var(--success);
}

.progress-line {
    flex: 1;
    height: 2px;
    background: var(--gray-300);
    margin: 0 0.5rem;
    position: relative;
    top: -20px;
}

.progress-line.completed {
    background: var(--success);
}

/* ===================================
   Main Content
   =================================== */
.main-content {
    padding: 2rem 0 4rem;
    min-height: calc(100vh - 200px);
}

.step-section {
    display: none;
    animation: fadeIn 0.5s ease;
}

.step-section.active {
    display: block;
}

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

.section-title {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.section-description {
    color: var(--gray-700);
    font-size: 1.05rem;
    margin-bottom: 2rem;
}

/* ===================================
   Welcome Card
   =================================== */
.welcome-card {
    background: var(--white);
    border-radius: 12px;
    padding: 3rem;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.welcome-icon {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.welcome-card h2 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.lead {
    font-size: 1.15rem;
    color: var(--gray-700);
    margin-bottom: 2rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.info-card {
    background: var(--gray-100);
    padding: 1.5rem;
    border-radius: 8px;
    transition: var(--transition);
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.info-card i {
    font-size: 2.5rem;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.info-card h3 {
    font-size: 1.15rem;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.info-card p {
    font-size: 0.95rem;
    color: var(--gray-700);
    margin: 0;
}

.methodology-info {
    background: var(--gray-100);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: left;
    margin: 2rem 0;
}

.methodology-info h3 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.methodology-info ul {
    list-style: none;
    padding: 0;
}

.methodology-info li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.methodology-info li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
}

.time-estimate {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--info);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    margin: 1.5rem 0;
}

.time-estimate i {
    font-size: 1.25rem;
}

/* ===================================
   Form Cards
   =================================== */
.form-card {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.form-card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-header h3 {
    color: var(--primary-dark);
    margin: 0;
}

.card-description {
    color: var(--gray-600);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font-secondary);
    transition: var(--transition);
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(44, 95, 45, 0.1);
}

.form-group input.error,
.form-group select.error {
    border-color: var(--error);
}

.form-group input.success,
.form-group select.success {
    border-color: var(--success);
}

.help-text {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
}

.error-text {
    font-size: 0.85rem;
    color: var(--error);
    margin-top: 0.25rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* ===================================
   Buttons
   =================================== */
.btn-primary,
.btn-secondary,
.btn-add,
.btn-help,
.btn-remove {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
}

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

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-add {
    background: var(--secondary);
    color: var(--white);
    width: 100%;
    justify-content: center;
    margin-top: 1rem;
}

.btn-add:hover {
    background: var(--secondary-dark);
}

.btn-help {
    background: var(--info);
    color: var(--white);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-help:hover {
    background: #1976D2;
}

.btn-remove {
    background: var(--error);
    color: var(--white);
    padding: 0.5rem 1rem;
}

.btn-remove:hover {
    background: #D32F2F;
}

/* ===================================
   Form Navigation
   =================================== */
.form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--gray-200);
}

/* ===================================
   Alerts
   =================================== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.alert i {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.alert-info {
    background: #E3F2FD;
    color: #1565C0;
    border-left: 4px solid var(--info);
}

.alert-warning {
    background: #FFF3E0;
    color: #E65100;
    border-left: 4px solid var(--warning);
}

.alert-error {
    background: #FFEBEE;
    color: #C62828;
    border-left: 4px solid var(--error);
}

.alert-success {
    background: #E8F5E9;
    color: #2E7D32;
    border-left: 4px solid var(--success);
}

/* ===================================
   Results
   =================================== */
.results-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.result-card {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.result-card.total {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
}

.result-card.scope1 {
    border-left: 4px solid #FF6B6B;
}

.result-card.scope2 {
    border-left: 4px solid #4ECDC4;
}

.result-card.scope3 {
    border-left: 4px solid #95E1D3;
}

.result-icon {
    font-size: 2.5rem;
    opacity: 0.9;
}

.result-content h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1;
}

.result-unit {
    font-size: 0.9rem;
    margin: 0.25rem 0 0;
    opacity: 0.8;
}

.result-percentage {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0.5rem 0 0;
}

/* ===================================
   Charts
   =================================== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.chart-card h3 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
    text-align: center;
}

.chart-card canvas {
    max-height: 300px;
}

/* ===================================
   Modal
   =================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    color: var(--gray-600);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--error);
}

/* ===================================
   Footer
   =================================== */
.footer {
    background: var(--gray-900);
    color: var(--white);
    padding: 2rem 0;
    text-align: center;
}

.footer p {
    margin: 0.5rem 0;
    opacity: 0.8;
}

/* ===================================
   Responsive
   =================================== */
@media (max-width: 768px) {
    .progress-bar {
        overflow-x: auto;
        padding-bottom: 1rem;
    }
    
    .step-label {
        font-size: 0.75rem;
    }
    
    .welcome-card {
        padding: 2rem 1.5rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .form-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .form-navigation button {
        width: 100%;
        justify-content: center;
    }
}

/* ===================================
   Dynamic Items
   =================================== */
.emission-item {
    background: var(--gray-100);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.item-number {
    font-weight: 600;
    color: var(--primary);
}

/* ===================================
   Utilities
   =================================== */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden {
    display: none !important;
}


/* ===================================
   Help Button
   =================================== */
.btn-help {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-help:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 95, 45, 0.3);
}

/* ===================================
   Modal Styles
   =================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--gray-300);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* ===================================
   Help Sections
   =================================== */
.help-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--gray-300);
}

.help-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.help-section h3 {
    color: var(--primary);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.help-section p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--gray-700);
}

.help-section ul,
.help-section ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.help-section li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    color: var(--gray-700);
}

.workflow-steps {
    counter-reset: step-counter;
    list-style: none;
    margin-left: 0;
}

.workflow-steps li {
    counter-increment: step-counter;
    position: relative;
    padding-left: 3rem;
    margin-bottom: 1.5rem;
}

.workflow-steps li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    background: var(--primary);
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

/* ===================================
   Help Notes
   =================================== */
.help-note {
    padding: 1rem 1rem 1rem 3rem;
    border-radius: 8px;
    margin: 1rem 0;
    position: relative;
    line-height: 1.6;
}

.help-note i {
    position: absolute;
    left: 1rem;
    top: 1rem;
    font-size: 1.2rem;
}

.help-note.warning {
    background: #FFF3CD;
    border-left: 4px solid #FFC107;
    color: #856404;
}

.help-note.warning i {
    color: #FFC107;
}

.help-note.info {
    background: #D1ECF1;
    border-left: 4px solid #17A2B8;
    color: #0C5460;
}

.help-note.info i {
    color: #17A2B8;
}

.help-note.success {
    background: #D4EDDA;
    border-left: 4px solid #28A745;
    color: #155724;
}

.help-note.success i {
    color: #28A745;
}

/* ===================================
   FAQ Items
   =================================== */
.faq-item {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--gray-100);
    border-radius: 8px;
}

.faq-question {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
}

.faq-answer {
    color: var(--gray-700);
    margin-bottom: 0;
}

/* ===================================
   Responsive Modal
   =================================== */
@media (max-width: 768px) {
    .modal-content {
        max-width: 95%;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 1rem 1.5rem;
    }
    
    .modal-header h2 {
        font-size: 1.2rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-footer {
        padding: 1rem 1.5rem;
    }
    
    .help-section h3 {
        font-size: 1.1rem;
    }
    
    .workflow-steps li {
        padding-left: 2.5rem;
    }
    
    .workflow-steps li::before {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.85rem;
    }
}
