/**
 * Valoración de Empresas - Estilos
 * Plugin WordPress
 */

:root {
    --ve-primary: #1e3a5f;
    --ve-primary-light: #2d5a8a;
    --ve-primary-dark: #0f1f33;
    --ve-accent: #c9a227;
    --ve-accent-light: #e6c65c;
    --ve-success: #22c55e;
    --ve-error: #ef4444;
    --ve-warning: #f59e0b;
    --ve-bg-light: #f8fafc;
    --ve-bg-card: #ffffff;
    --ve-text-primary: #1e293b;
    --ve-text-secondary: #64748b;
    --ve-text-muted: #94a3b8;
    --ve-border: #e2e8f0;
    --ve-border-focus: #1e3a5f;
    --ve-shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --ve-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --ve-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --ve-shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    --ve-radius-sm: 6px;
    --ve-radius-md: 10px;
    --ve-radius-lg: 16px;
    --ve-transition: all 0.2s ease;
}

/* Container */
.valoracion-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--ve-text-primary);
}

.valoracion-container * {
    box-sizing: border-box;
}

/* Header */
.valoracion-header {
    text-align: center;
    margin-bottom: 48px;
}

.valoracion-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--ve-primary);
    margin: 0 0 12px 0;
    letter-spacing: -0.02em;
}

.valoracion-header p {
    font-size: 1.1rem;
    color: var(--ve-text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Method Selection */
.method-selection {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

@media (max-width: 640px) {
    .method-selection {
        grid-template-columns: 1fr;
    }
}

.method-card {
    background: var(--ve-bg-card);
    border: 2px solid var(--ve-border);
    border-radius: var(--ve-radius-lg);
    padding: 32px;
    cursor: pointer;
    transition: var(--ve-transition);
    position: relative;
    overflow: hidden;
}

.method-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--ve-accent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.method-card:hover {
    border-color: var(--ve-primary-light);
    box-shadow: var(--ve-shadow-lg);
    transform: translateY(-2px);
}

.method-card.active {
    border-color: var(--ve-primary);
    box-shadow: var(--ve-shadow-xl);
}

.method-card.active::before {
    transform: scaleX(1);
}

.method-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--ve-primary) 0%, var(--ve-primary-light) 100%);
    border-radius: var(--ve-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.method-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.method-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ve-primary);
    margin: 0 0 8px 0;
}

.method-card p {
    font-size: 0.95rem;
    color: var(--ve-text-secondary);
    margin: 0;
}

.method-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--ve-accent);
    color: var(--ve-primary-dark);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Main Card */
.main-card {
    background: var(--ve-bg-card);
    border-radius: var(--ve-radius-lg);
    box-shadow: var(--ve-shadow-xl);
    overflow: hidden;
}

/* Progress Steps */
.progress-container {
    background: var(--ve-primary);
    padding: 32px 40px;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: rgba(255,255,255,0.2);
}

.progress-line {
    position: absolute;
    top: 20px;
    left: 40px;
    height: 2px;
    background: var(--ve-accent);
    transition: width 0.4s ease;
    width: 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    margin-bottom: 12px;
    transition: var(--ve-transition);
}

.step.active .step-number,
.step.completed .step-number {
    background: var(--ve-accent);
    border-color: var(--ve-accent);
    color: var(--ve-primary-dark);
}

.step.completed .step-number {
    background: var(--ve-success);
    border-color: var(--ve-success);
}

.step-label {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    font-weight: 500;
    text-align: center;
    max-width: 100px;
    transition: var(--ve-transition);
}

.step.active .step-label,
.step.completed .step-label {
    color: white;
}

@media (max-width: 640px) {
    .step-label {
        display: none;
    }
    .progress-container {
        padding: 24px;
    }
}

/* Form Content */
.form-content {
    padding: 40px;
}

.form-section {
    display: none;
    animation: veSlideIn 0.3s ease;
}

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

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

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--ve-primary);
    margin: 0 0 8px 0;
}

.section-description {
    color: var(--ve-text-secondary);
    margin: 0 0 32px 0;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

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

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ve-text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-label .required {
    color: var(--ve-error);
}

.form-label .tooltip-icon {
    width: 16px;
    height: 16px;
    background: var(--ve-text-muted);
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: help;
    position: relative;
}

.form-label .tooltip-icon:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--ve-primary-dark);
    color: white;
    font-size: 0.8rem;
    font-weight: 400;
    padding: 8px 12px;
    border-radius: var(--ve-radius-sm);
    white-space: nowrap;
    margin-bottom: 8px;
    z-index: 100;
}

.form-input,
.form-select {
    padding: 14px 16px;
    border: 1.5px solid var(--ve-border);
    border-radius: var(--ve-radius-md);
    font-size: 1rem;
    font-family: inherit;
    color: var(--ve-text-primary);
    background: var(--ve-bg-card);
    transition: var(--ve-transition);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--ve-border-focus);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.form-input::placeholder {
    color: var(--ve-text-muted);
}

/* Currency Input */
.currency-input-wrapper {
    position: relative;
}

.currency-input-wrapper .currency-symbol {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ve-text-muted);
    font-weight: 500;
}

.currency-input-wrapper .form-input {
    padding-left: 45px;
}

/* Year Tabs */
.year-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.year-tab {
    padding: 10px 20px;
    border: 2px solid var(--ve-border);
    border-radius: var(--ve-radius-md);
    background: var(--ve-bg-card);
    cursor: pointer;
    font-weight: 500;
    color: var(--ve-text-secondary);
    transition: var(--ve-transition);
}

.year-tab:hover {
    border-color: var(--ve-primary-light);
    color: var(--ve-primary);
}

.year-tab.active {
    background: var(--ve-primary);
    border-color: var(--ve-primary);
    color: white;
}

.year-tab.completed {
    background: var(--ve-success);
    border-color: var(--ve-success);
    color: white;
}

.year-tab .check-icon {
    display: none;
    margin-left: 6px;
}

.year-tab.completed .check-icon {
    display: inline;
}

/* Year Content */
.year-content {
    display: none;
    animation: veSlideIn 0.3s ease;
}

.year-content.active {
    display: block;
}

/* Subsection */
.subsection {
    background: var(--ve-bg-light);
    border-radius: var(--ve-radius-md);
    padding: 24px;
    margin-bottom: 24px;
}

.subsection-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ve-primary);
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.subsection-title svg {
    width: 20px;
    height: 20px;
    color: var(--ve-accent);
}

.summary-value {
    font-weight: 600;
    color: var(--ve-primary);
}

.methodology-text {
    color: var(--ve-text-secondary);
    margin: 0 0 16px 0;
}

.methodology-list {
    color: var(--ve-text-secondary);
    margin: 0;
    padding-left: 20px;
}

.methodology-list li {
    margin-bottom: 8px;
}

/* Excel Upload */
.excel-upload-section {
    display: none;
}

.excel-upload-section.active {
    display: block;
}

.upload-area {
    border: 2px dashed var(--ve-border);
    border-radius: var(--ve-radius-lg);
    padding: 60px 40px;
    text-align: center;
    background: var(--ve-bg-light);
    transition: var(--ve-transition);
    cursor: pointer;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--ve-primary);
    background: rgba(30, 58, 95, 0.02);
}

.upload-area.has-file {
    border-color: var(--ve-success);
    border-style: solid;
    background: rgba(34, 197, 94, 0.05);
}

.upload-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--ve-primary) 0%, var(--ve-primary-light) 100%);
    border-radius: var(--ve-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.upload-icon svg {
    width: 32px;
    height: 32px;
    color: white;
}

.upload-area h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ve-text-primary);
    margin: 0 0 8px 0;
}

.upload-area p {
    color: var(--ve-text-secondary);
    margin: 0 0 16px 0;
}

.upload-area .file-types {
    font-size: 0.85rem;
    color: var(--ve-text-muted);
}

.file-info {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

.upload-area.has-file .file-info {
    display: flex;
}

.file-info .file-name {
    font-weight: 500;
    color: var(--ve-success);
}

.file-info .remove-file {
    background: none;
    border: none;
    color: var(--ve-error);
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: underline;
}

.template-download {
    margin-top: 32px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.05) 0%, rgba(201, 162, 39, 0.05) 100%);
    border-radius: var(--ve-radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.template-download .template-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.template-download .template-icon {
    width: 48px;
    height: 48px;
    background: var(--ve-success);
    border-radius: var(--ve-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.template-download .template-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.template-download h4 {
    font-weight: 600;
    color: var(--ve-text-primary);
    margin: 0 0 4px 0;
}

.template-download p {
    font-size: 0.9rem;
    color: var(--ve-text-secondary);
    margin: 0;
}

.template-download .btn-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--ve-success);
    color: white;
    border: none;
    border-radius: var(--ve-radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--ve-transition);
    text-decoration: none;
}

.template-download .btn-download:hover {
    background: #16a34a;
}

/* Buttons */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--ve-border);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--ve-radius-md);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--ve-transition);
    border: none;
    text-decoration: none;
}

.btn-secondary {
    background: var(--ve-bg-light);
    color: var(--ve-text-secondary);
    border: 1.5px solid var(--ve-border);
}

.btn-secondary:hover {
    background: var(--ve-border);
    color: var(--ve-text-primary);
}

.btn-primary {
    background: linear-gradient(135deg, var(--ve-primary) 0%, var(--ve-primary-light) 100%);
    color: white;
    box-shadow: var(--ve-shadow-md);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--ve-shadow-lg);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-accent {
    background: linear-gradient(135deg, var(--ve-accent) 0%, var(--ve-accent-light) 100%);
    color: var(--ve-primary-dark);
}

.btn svg {
    width: 18px;
    height: 18px;
}

/* Results Section */
.results-section {
    display: none;
    animation: veSlideIn 0.5s ease;
}

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

.results-header {
    text-align: center;
    margin-bottom: 40px;
}

.results-header .success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--ve-success) 0%, #16a34a 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.results-header .success-icon svg {
    width: 40px;
    height: 40px;
    color: white;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
}

.result-card {
    background: var(--ve-bg-light);
    border-radius: var(--ve-radius-md);
    padding: 24px;
    text-align: center;
}

.result-card.highlight {
    background: linear-gradient(135deg, var(--ve-primary) 0%, var(--ve-primary-light) 100%);
    color: white;
}

.result-card .result-label {
    font-size: 0.9rem;
    color: var(--ve-text-secondary);
    margin-bottom: 8px;
}

.result-card.highlight .result-label {
    color: rgba(255,255,255,0.8);
}

.result-card .result-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ve-primary);
}

.result-card.highlight .result-value {
    color: white;
}

.download-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-download-result {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: var(--ve-radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ve-transition);
    text-decoration: none;
    border: none;
}

.btn-download-pdf {
    background: var(--ve-error);
    color: white;
}

.btn-download-pdf:hover {
    background: #dc2626;
    color: white;
}

.btn-download-excel {
    background: var(--ve-success);
    color: white;
}

.btn-download-excel:hover {
    background: #16a34a;
    color: white;
}

/* Loading */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.95);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--ve-border);
    border-top-color: var(--ve-primary);
    border-radius: 50%;
    animation: veSpin 1s linear infinite;
    margin-bottom: 24px;
}

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

.loading-text {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--ve-primary);
}

.loading-subtext {
    color: var(--ve-text-secondary);
    margin-top: 8px;
}
