/* ==========================================================================
   Variables & Theme
   ========================================================================== */
:root {
    --bg-dark: #f3f3f3; /* Gris suave */
    --bg-card: rgba(255, 255, 255, 0.9);
    --text-main: #20184a; /* Azul Gestal */
    --text-muted: #64748b;
    
    /* Branding Colors */
    --primary: #20184a; /* Azul Gestal */
    --primary-hover: #1b1340;
    --secondary: #e2e8f0; /* Bordes claros */
    --success: #efb322; /* Amarillo Gestal */
    --success-hover: #dfa31b;
    --accent: #ea6433; /* Naranja Gestal */
    --accent-hover: #d55325;
    
    /* Status Colors */
    --color-low: #ef4444; /* Rojo */
    --color-medium: #f59e0b; /* Amarillo/Naranja */
    --color-high: #10b981; /* Verde */
    --color-excel: #20184a; /* Azul Gestal */

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.88);
    --glass-border: rgba(32, 24, 74, 0.08);
    --glass-shadow: 0 20px 40px -15px rgba(32, 24, 74, 0.12);
    
    --font-main: 'Nunito', sans-serif;
    --radius-lg: 24px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Background gradient effect */
.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: radial-gradient(circle at 10% 20%, rgba(32, 24, 74, 0.06) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(239, 179, 34, 0.06) 0%, transparent 40%),
                radial-gradient(circle at 50% 50%, rgba(234, 100, 51, 0.03) 0%, transparent 50%);
    filter: blur(40px);
}

.container {
    width: 100%;
    max-width: 900px;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
}

.logo-container {
    margin-bottom: 2rem;
    text-align: center;
    width: 100%;
}

.brand-logo {
    display: block;
    margin: 0 auto;
    max-width: 280px;
    width: 55%;
    height: auto;
    object-fit: contain;
}

/* ==========================================================================
   Steps Transition System
   ========================================================================== */
.step {
    width: 100%;
    display: none;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.step.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 3rem;
    width: 100%;
    box-shadow: var(--glass-shadow);
}

.text-center { text-align: center; }
.mt-4 { margin-top: 2rem; }
.mt-2 { margin-top: 1rem; }

/* Progress bar header */
.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(32, 24, 74, 0.05);
    border-radius: 99px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 99px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Typography & Badges
   ========================================================================== */
h1 {
    font-size: 2.25rem;
    line-height: 1.25;
    margin-bottom: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--primary) 30%, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: var(--primary);
}

h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}

h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

h5 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.step-number {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: rgba(32, 24, 74, 0.05);
    color: var(--primary);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.intro-text p {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.2rem;
}

.intro-text strong {
    color: var(--primary);
}

/* ==========================================================================
   Form Fields
   ========================================================================== */
form {
    width: 100%;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
    text-align: left;
}

.form-group {
    display: flex;
    flex-direction: column;
    text-align: left;
    position: relative;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--primary);
}

input[type="text"],
input[type="email"],
select {
    width: 100%;
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--secondary);
    background: rgba(255, 255, 255, 0.85);
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: var(--font-main);
    transition: all 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2320184a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2rem;
    padding-right: 2.5rem;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(234, 100, 51, 0.15);
    background: #fff;
}

/* Form Validation Styles */
.error-msg,
.error-msg-question {
    display: none;
    color: var(--color-low);
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.4rem;
}

.form-group.has-error input,
.form-group.has-error select {
    border-color: var(--color-low);
    background-color: rgba(239, 68, 68, 0.02);
}

.form-group.has-error .error-msg,
.question-item.has-error .error-msg-question {
    display: block;
}

.question-item.has-error {
    border-color: rgba(239, 68, 68, 0.4) !important;
    background-color: rgba(239, 68, 68, 0.02) !important;
}

/* ==========================================================================
   Question Grid (Likert Scale)
   ========================================================================== */
.questions-container {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin-top: 1.5rem;
}

.question-item {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(32, 24, 74, 0.04);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    text-align: left;
    transition: all 0.25s ease;
}

.question-item:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(32, 24, 74, 0.08);
}

.question-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
    color: var(--primary);
    line-height: 1.4;
}

.scale-container {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
}

.scale-option {
    flex: 1;
    position: relative;
    cursor: pointer;
}

.scale-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.scale-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 0.4rem;
    background: #fff;
    border: 1px solid var(--secondary);
    border-radius: var(--radius-sm);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    text-align: center;
}

.scale-label .num {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.1rem;
}

.scale-label .text {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 600;
    line-height: 1.2;
}

/* Checked States */
.scale-option input[type="radio"]:checked + .scale-label {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(32, 24, 74, 0.15);
}

.scale-option input[type="radio"]:checked + .scale-label .num {
    color: #fff;
}

.scale-option input[type="radio"]:checked + .scale-label .text {
    color: rgba(255, 255, 255, 0.8);
}

/* Hover effects */
.scale-option:hover input[type="radio"]:not(:checked) + .scale-label {
    border-color: var(--accent);
    background-color: rgba(234, 100, 51, 0.02);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.actions {
    display: flex;
    justify-content: space-between;
    gap: 1.2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    text-align: center;
    padding: 1rem 2.2rem;
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    font-family: var(--font-main);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(32, 24, 74, 0.15);
}

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

.btn-secondary:hover {
    background: var(--bg-dark);
    border-color: var(--text-muted);
}

.btn-success {
    background: var(--accent); /* Usamos naranja Gestal */
    color: white;
    flex: 1.5;
}

.btn-success:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(234, 100, 51, 0.25);
}

/* Button Animations */
.animate-pulse {
    animation: buttonPulse 2.5s infinite;
}

@keyframes buttonPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.025); }
    100% { transform: scale(1); }
}

/* ==========================================================================
   Loading State
   ========================================================================== */
.loader {
    border: 4px solid rgba(32, 24, 74, 0.05);
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s cubic-bezier(0.55, 0.055, 0.675, 0.19) infinite;
    margin: 0 auto 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Results Screen (Dashboard)
   ========================================================================== */
.results-card {
    padding: 3rem 2.5rem;
}

.results-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2.5rem;
    margin-top: 2rem;
    align-items: start;
}

.results-main {
    background: #fff;
    border: 1px solid var(--secondary);
    border-radius: var(--radius-md);
    padding: 2.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Gauge Arc visualization */
.gauge-wrapper {
    position: relative;
    width: 260px;
    margin-bottom: 1.5rem;
}

.gauge {
    width: 100%;
    height: auto;
    display: block;
}

.gauge-track {
    stroke: #e2e8f0;
}

.gauge-fill {
    stroke-dasharray: 125.6;
    stroke-dashoffset: 125.6; /* Dynamic from JS */
    transform-origin: center;
    transform: rotate(0deg);
}

.gauge-text {
    position: absolute;
    bottom: 5px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gauge-score {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
}

.gauge-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.2rem;
}

.maturity-description {
    margin-top: 0.5rem;
}

.maturity-description h3 {
    margin-bottom: 0.6rem;
    font-size: 1.35rem;
}

.maturity-description p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Highlights */
.results-highlights {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.highlight-card {
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border-left: 5px solid transparent;
}

.highlight-card.positive {
    background: rgba(16, 185, 129, 0.06);
    border-left-color: var(--color-high);
}

.highlight-card.positive h4 {
    color: var(--color-high);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
}

.highlight-card.positive p {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
}

.highlight-card.warning {
    background: rgba(234, 100, 51, 0.06);
    border-left-color: var(--accent);
}

.highlight-card.warning h4 {
    color: var(--accent);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
}

.highlight-card.warning p {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
}

/* Axes Detailed results Grid */
.axes-results {
    margin-top: 3.5rem;
}

.axes-results h3 {
    border-bottom: 2px solid var(--secondary);
    padding-bottom: 0.8rem;
    margin-bottom: 1.8rem;
    font-size: 1.35rem;
}

.axes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.8rem;
}

.axis-result-card {
    background: #fff;
    border: 1px solid var(--secondary);
    border-radius: var(--radius-md);
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
}

.axis-result-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.5rem;
    gap: 1rem;
}

.axis-result-header h4 {
    font-size: 1.05rem;
    line-height: 1.3;
}

.axis-score-badge {
    padding: 0.25rem 0.65rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
}

.axis-score-badge.color-low { background: var(--color-low); }
.axis-score-badge.color-medium { background: var(--color-medium); }
.axis-score-badge.color-high { background: var(--color-high); }

.axis-desc-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 1.2rem;
}

/* Horizontal Progress bar */
.axis-progress-bg {
    width: 100%;
    height: 8px;
    background: rgba(32, 24, 74, 0.05);
    border-radius: 99px;
    margin-bottom: 1.2rem;
    overflow: hidden;
}

.axis-progress-bar {
    height: 100%;
    border-radius: 99px;
    width: 0%; /* Dynamic fill from JS */
    transition: width 1.5s cubic-bezier(0.1, 0.8, 0.25, 1);
}

.axis-progress-bar.color-low { background: var(--color-low); }
.axis-progress-bar.color-medium { background: var(--color-medium); }
.axis-progress-bar.color-high { background: var(--color-high); }

/* Axis Status & Recommendations */
.axis-status-section {
    margin-bottom: 1.2rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px dashed var(--secondary);
}

.status-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
}

.status-tag.color-low { background: rgba(239, 68, 68, 0.1); color: var(--color-low); }
.status-tag.color-medium { background: rgba(245, 158, 11, 0.1); color: var(--color-medium); }
.status-tag.color-high { background: rgba(16, 185, 129, 0.1); color: var(--color-high); }

.axis-status-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.axis-recommendations h5 {
    color: var(--primary);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.axis-recommendations ul {
    list-style: none;
    padding-left: 0;
}

.axis-recommendations li {
    font-size: 0.85rem;
    color: var(--text-main);
    line-height: 1.45;
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1.2rem;
}

.axis-recommendations li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

/* Call to Action Section */
.recommendations-cta-section {
    margin-top: 4rem;
    border-top: 2px solid var(--secondary);
    padding-top: 3.5rem;
}

.cta-banner {
    background: linear-gradient(135deg, rgba(32, 24, 74, 0.02) 0%, rgba(234, 100, 51, 0.02) 100%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    max-width: 720px;
    margin: 0 auto;
}

.cta-banner h2 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.cta-banner p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.cta-actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.btn-cta {
    padding: 1.1rem 2.5rem;
    font-size: 1.1rem;
    flex: unset;
}

.email-notice {
    font-size: 0.85rem !important;
    font-style: italic;
    color: var(--text-muted);
    margin-top: 1.5rem;
}

/* ==========================================================================
   Responsive adjustments
   ========================================================================== */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .glass-card {
        padding: 2rem 1.5rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .scale-container {
        flex-direction: column;
        gap: 0.5rem;
    }

    .scale-label {
        flex-direction: row;
        justify-content: flex-start;
        padding: 0.9rem 1.2rem;
        text-align: left;
    }

    .scale-label .num {
        margin-bottom: 0;
        margin-right: 1.2rem;
        width: 25px;
    }

    .scale-label .text {
        font-size: 0.75rem;
    }

    .actions {
        flex-direction: column-reverse;
        gap: 0.8rem;
    }

    .btn {
        width: 100%;
        padding: 0.9rem;
    }

    /* Results responsive */
    .results-card {
        padding: 2rem 1.2rem;
    }

    .results-layout {
        grid-template-columns: 1fr;
        gap: 1.8rem;
    }

    .results-main {
        padding: 1.5rem;
    }

    .axes-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .cta-banner {
        padding: 2rem 1.2rem;
    }

    .cta-actions {
        flex-direction: column;
        gap: 1rem;
    }

    .btn-cta {
        width: 100%;
    }
}
