/**
 * Test Vocacional - Academia Fleming
 * Diseño Mobile-First
 */

/* ========================================
   VARIABLES
   ======================================== */
:root {
    --tv-primary: #2563eb;
    --tv-primary-dark: #1d4ed8;
    --tv-success: #10b981;
    --tv-warning: #f59e0b;
    --tv-danger: #ef4444;
    --tv-purple: #8b5cf6;
    --tv-pink: #ec4899;
    --tv-bg: #f8fafc;
    --tv-card: #ffffff;
    --tv-text: #1e293b;
    --tv-text-light: #64748b;
    --tv-border: #e2e8f0;
    --tv-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --tv-shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
    --tv-radius: 16px;
    --tv-radius-sm: 8px;
}

/* ========================================
   BASE STYLES
   ======================================== */
.tv-page {
    min-height: 100vh;
    background: var(--tv-bg);
}

.tv-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ========================================
   HERO SECTION (Página inicial)
   ======================================== */
.tv-hero {
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    padding: 60px 0 80px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.tv-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: pulse-bg 4s ease-in-out infinite;
}

@keyframes pulse-bg {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.tv-hero-content {
    position: relative;
    z-index: 1;
}

.tv-hero-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: bounce 2s ease-in-out infinite;
}

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

.tv-hero h1 {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 16px;
    line-height: 1.2;
    color: #ffffff;
}

.tv-hero p {
    font-size: 16px;
    opacity: 0.9;
    margin: 0 0 32px;
    line-height: 1.6;
    color: #ffffff;
}

.tv-hero-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
}

.tv-feature-tag {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.tv-btn-start {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: white;
    color: var(--tv-primary);
    padding: 18px 40px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: var(--tv-shadow-lg);
    transition: all 0.3s ease;
}

.tv-btn-start:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.25);
}

.tv-btn-start svg {
    width: 24px;
    height: 24px;
}

/* Wave divider */
.tv-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
}

.tv-wave svg {
    width: 100%;
    height: 100%;
}

/* ========================================
   INFO SECTION
   ======================================== */
.tv-info-section {
    padding: 40px 0;
}

.tv-info-card {
    background: var(--tv-card);
    border-radius: var(--tv-radius);
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: var(--tv-shadow);
}

.tv-info-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tv-info-card p {
    font-size: 15px;
    color: var(--tv-text-light);
    margin: 0;
    line-height: 1.6;
}

.tv-modules-grid {
    display: grid;
    gap: 16px;
}

.tv-module-item {
    background: var(--tv-card);
    border-radius: var(--tv-radius);
    padding: 20px;
    box-shadow: var(--tv-shadow);
    display: flex;
    align-items: center;
    gap: 16px;
}

.tv-module-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.tv-module-icon.interests { background: linear-gradient(135deg, #ec4899, #f472b6); }
.tv-module-icon.aptitudes { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
.tv-module-icon.knowledge { background: linear-gradient(135deg, #10b981, #34d399); }

.tv-module-info h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px;
}

.tv-module-info p {
    font-size: 14px;
    color: var(--tv-text-light);
    margin: 0;
}

/* ========================================
   TEST CONTAINER (Durante el test)
   ======================================== */
.tv-test-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header del test */
.tv-test-header {
    background: var(--tv-card);
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.tv-test-header-content {
    max-width: 600px;
    margin: 0 auto;
}

.tv-test-title {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tv-progress-container {
    margin-bottom: 8px;
}

.tv-topic-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #0f172a;
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tv-topic-title .topic-icon {
    font-size: 18px;
}

.tv-progress-bar {
    height: 8px;
    background: var(--tv-border);
    border-radius: 4px;
    overflow: hidden;
}

.tv-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--tv-primary), var(--tv-purple));
    border-radius: 4px;
    transition: width 0.4s ease;
}

.tv-progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--tv-text-light);
    margin-top: 6px;
}

/* Cuerpo del test */
.tv-test-body {
    flex: 1;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
}

.tv-question-container {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Módulo badge */
.tv-module-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 16px;
    align-self: flex-start;
}

.tv-module-badge.interests {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

.tv-module-badge.aptitudes {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.tv-module-badge.knowledge {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

/* Pregunta */
.tv-question-card {
    background: var(--tv-card);
    border-radius: var(--tv-radius);
    padding: 24px;
    box-shadow: var(--tv-shadow);
    margin-bottom: 20px;
}

.tv-question-number {
    font-size: 13px;
    color: var(--tv-text-light);
    margin-bottom: 8px;
}

.tv-question-text {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.5;
    margin: 0;
    color: var(--tv-text);
}

/* Opciones de respuesta */
.tv-options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.tv-option {
    background: var(--tv-card);
    border: 2px solid var(--tv-border);
    border-radius: var(--tv-radius-sm);
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 14px;
}

.tv-option:hover {
    border-color: var(--tv-primary);
    background: rgba(37, 99, 235, 0.02);
}

.tv-option.selected {
    border-color: var(--tv-primary);
    background: rgba(37, 99, 235, 0.05);
}

.tv-option-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.tv-option-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--tv-text);
}

/* Escala tipo Likert */
.tv-scale-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.tv-scale-option {
    background: var(--tv-card);
    border: 2px solid var(--tv-border);
    border-radius: var(--tv-radius-sm);
    padding: 16px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.tv-scale-option:hover {
    border-color: var(--tv-primary);
}

.tv-scale-option.selected {
    border-color: var(--tv-primary);
    background: rgba(37, 99, 235, 0.05);
}

.tv-scale-option .icon {
    font-size: 28px;
    display: block;
    margin-bottom: 6px;
}

.tv-scale-option .label {
    font-size: 11px;
    color: var(--tv-text-light);
    font-weight: 500;
}

/* Opciones de conocimiento (A, B, C, D) */
.tv-knowledge-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tv-knowledge-option {
    background: var(--tv-card);
    border: 2px solid var(--tv-border);
    border-radius: var(--tv-radius-sm);
    padding: 18px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 56px; /* Mejor área de toque en móvil */
}

.tv-knowledge-option:hover {
    border-color: var(--tv-primary);
    background: rgba(37, 99, 235, 0.02);
    transform: translateX(4px);
}

.tv-knowledge-option.selected {
    border-color: var(--tv-primary);
    background: rgba(37, 99, 235, 0.05);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.tv-knowledge-option .option-letter {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--tv-primary), var(--tv-purple));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.tv-knowledge-option .option-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--tv-text);
    line-height: 1.4;
}

/* Mejora para móvil: opciones más grandes */
@media (max-width: 640px) {
    .tv-scale-option {
        padding: 18px 12px;
        min-height: 60px;
    }

    .tv-scale-option .icon {
        font-size: 32px;
    }

    .tv-scale-option .label {
        font-size: 13px;
    }

    .tv-knowledge-option {
        padding: 20px 18px;
        min-height: 62px;
    }

    .tv-knowledge-option .option-letter {
        width: 46px;
        height: 46px;
        font-size: 20px;
    }

    .tv-knowledge-option .option-text {
        font-size: 15px;
    }
}

/* Navegación */
.tv-navigation {
    display: flex;
    gap: 12px;
    margin-top: auto;
    padding-top: 20px;
}

.tv-btn {
    flex: 1;
    padding: 16px 24px;
    border-radius: var(--tv-radius-sm);
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tv-btn-secondary {
    background: var(--tv-border);
    color: var(--tv-text);
}

.tv-btn-secondary:hover {
    background: #cbd5e1;
}

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

.tv-btn-primary:hover {
    background: var(--tv-primary-dark);
}

.tv-btn-primary:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

/* ========================================
   RESULTADOS
   ======================================== */
.tv-results-section {
    padding: 40px 0 60px;
}

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

.tv-results-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: celebrate 0.6s ease-out;
}

@keyframes celebrate {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.tv-results-header h2 {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 8px;
    color: var(--tv-text);
}

.tv-results-header p {
    font-size: 15px;
    color: var(--tv-text-light);
    margin: 0;
}

/* Carrera principal */
.tv-main-career {
    background: linear-gradient(135deg, var(--tv-primary) 0%, var(--tv-purple) 100%);
    border-radius: var(--tv-radius);
    padding: 32px 24px;
    text-align: center;
    color: white;
    margin-bottom: 24px;
    box-shadow: var(--tv-shadow-lg);
}

.tv-career-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
    font-weight: 500;
}

.tv-career-name {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 12px;
    line-height: 1.2;
    color: #ffffff !important;
}

.tv-main-career .tv-career-label,
.tv-main-career .tv-career-faculty {
    color: #ffffff !important;
}

.tv-career-faculty {
    font-size: 14px;
    opacity: 0.85;
}

/* Carreras alternativas */
.tv-alternatives-card {
    background: var(--tv-card);
    border-radius: var(--tv-radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--tv-shadow);
}

.tv-alternatives-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tv-alternative-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--tv-border);
}

.tv-alternative-item:last-child {
    border-bottom: none;
}

.tv-alternative-number {
    width: 28px;
    height: 28px;
    background: var(--tv-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--tv-primary);
    flex-shrink: 0;
}

.tv-alternative-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--tv-text);
}

/* Explicación */
.tv-explanation-card {
    background: var(--tv-card);
    border-radius: var(--tv-radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--tv-shadow);
    border-left: 4px solid var(--tv-primary);
}

.tv-explanation-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tv-explanation-card p {
    font-size: 15px;
    color: var(--tv-text-light);
    margin: 0;
    line-height: 1.7;
}

/* Perfil RIASEC */
.tv-profile-card {
    background: var(--tv-card);
    border-radius: var(--tv-radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--tv-shadow);
}

.tv-profile-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tv-profile-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tv-profile-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tv-profile-label {
    width: 100px;
    font-size: 13px;
    font-weight: 500;
    color: var(--tv-text);
    flex-shrink: 0;
}

.tv-profile-track {
    flex: 1;
    height: 24px;
    background: var(--tv-bg);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.tv-profile-fill {
    height: 100%;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    min-width: 40px;
    transition: width 0.8s ease;
}

/* Colores por área */
.tv-profile-fill.R { background: linear-gradient(90deg, #ef4444, #f87171); }
.tv-profile-fill.I { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.tv-profile-fill.A { background: linear-gradient(90deg, #ec4899, #f472b6); }
.tv-profile-fill.S { background: linear-gradient(90deg, #10b981, #34d399); }
.tv-profile-fill.E { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.tv-profile-fill.C { background: linear-gradient(90deg, #3b82f6, #60a5fa); }

/* Tarjeta de puntaje de conocimientos */
.tv-knowledge-score-card {
    background: var(--tv-card);
    border-radius: var(--tv-radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--tv-shadow);
}

.tv-knowledge-score-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Botones de acción */
.tv-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 32px;
}

.tv-btn-download {
    background: var(--tv-card);
    border: 2px solid var(--tv-primary);
    color: var(--tv-primary);
    padding: 16px 24px;
    border-radius: var(--tv-radius-sm);
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.tv-btn-download:hover {
    background: rgba(37, 99, 235, 0.05);
}

.tv-btn-whatsapp {
    background: #25D366;
    color: white;
    padding: 16px 24px;
    border-radius: var(--tv-radius-sm);
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.tv-btn-whatsapp:hover {
    background: #128C7E;
}

/* ========================================
   FORMULARIO DATOS
   ======================================== */
.tv-form-section {
    padding: 40px 0;
}

.tv-form-card {
    background: var(--tv-card);
    border-radius: var(--tv-radius);
    padding: 32px 24px;
    box-shadow: var(--tv-shadow);
}

.tv-form-header {
    text-align: center;
    margin-bottom: 28px;
}

.tv-form-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px;
}

.tv-form-header p {
    font-size: 14px;
    color: var(--tv-text-light);
    margin: 0;
}

.tv-form-group {
    margin-bottom: 20px;
}

.tv-form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--tv-text);
    margin-bottom: 8px;
}

.tv-form-label .optional {
    font-weight: 400;
    color: var(--tv-text-light);
}

.tv-form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--tv-border);
    border-radius: var(--tv-radius-sm);
    font-size: 16px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

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

.tv-form-input::placeholder {
    color: #94a3b8;
}

.tv-form-note {
    font-size: 12px;
    color: var(--tv-text-light);
    margin-top: 6px;
}

/* ========================================
   LOADING
   ======================================== */
.tv-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

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

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

.tv-loading p {
    font-size: 16px;
    color: var(--tv-text-light);
    margin: 0;
}

/* ========================================
   RESPONSIVE (Tablet y Desktop)
   ======================================== */
@media (min-width: 640px) {
    .tv-hero h1 {
        font-size: 36px;
    }

    .tv-hero p {
        font-size: 18px;
    }

    .tv-question-text {
        font-size: 20px;
    }

    .tv-scale-options {
        gap: 12px;
    }

    .tv-scale-option {
        padding: 20px 12px;
    }

    .tv-scale-option .icon {
        font-size: 32px;
    }

    .tv-scale-option .label {
        font-size: 13px;
    }

    .tv-career-name {
        font-size: 32px;
    }

    .tv-actions {
        flex-direction: row;
    }

    .tv-btn-download,
    .tv-btn-whatsapp {
        flex: 1;
    }
}

@media (min-width: 1024px) {
    .tv-container {
        max-width: 700px;
    }

    .tv-hero {
        padding: 80px 0 100px;
    }

    .tv-hero h1 {
        font-size: 42px;
    }
}
