/* ═══════════════════════════════════════════
   ElMásListo — CSS Global
   Portal de Tests y Quizzes
   dev: MF Sanchez
   ═══════════════════════════════════════════ */

:root {
    --primary: #6C5CE7;
    --primary-dark: #5A4BD1;
    --primary-light: #EDE9FE;
    --secondary: #1A1A2E;
    --accent-pink: #FD79A8;
    --accent-pink-light: #FFF0F6;
    --accent-yellow: #FDCB6E;
    --accent-yellow-light: #FFFBEB;
    --accent-green: #00B894;
    --accent-green-light: #ECFDF5;
    --accent-blue: #0984E3;
    --accent-blue-light: #EFF6FF;
    --accent-orange: #E17055;
    --accent-orange-light: #FFF7ED;
    --accent-red: #D63031;
    --accent-red-light: #FEF2F2;
    --gray-50: #FAFAFA;
    --gray-100: #F4F4F5;
    --gray-200: #E4E4E7;
    --gray-300: #D4D4D8;
    --gray-400: #A1A1AA;
    --gray-500: #71717A;
    --gray-600: #52525B;
    --gray-700: #3F3F46;
    --gray-800: #27272A;
    --gray-900: #18181B;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 100px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.1);
    --shadow-glow: 0 0 30px rgba(108,92,231,0.15);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Nunito', -apple-system, sans-serif;
    color: var(--gray-800);
    background: #fff;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ── NAV ── */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--gray-200);
}
.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--secondary);
}
.logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--accent-pink));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    font-weight: 800;
}
.logo-text {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.logo-text span { color: var(--primary); }
.nav-links {
    display: flex;
    gap: 28px;
    list-style: none;
}
.nav-links a {
    text-decoration: none;
    color: var(--gray-500);
    font-size: 15px;
    font-weight: 600;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--primary); }
.nav-back {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--gray-500);
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s;
}
.nav-back:hover { color: var(--primary); }

/* ── HERO ── */
.hero {
    padding: 140px 24px 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, var(--primary-light) 0%, #fff 100%);
}
.hero::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(253,121,168,0.1), transparent 70%);
    pointer-events: none;
}
.hero::after {
    content: '';
    position: absolute;
    bottom: -100px;
    left: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(108,92,231,0.08), transparent 70%);
    pointer-events: none;
}
.hero-emoji {
    font-size: 48px;
    margin-bottom: 20px;
    animation: bounce 2s ease-in-out infinite;
}
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.hero h1 {
    font-size: clamp(36px, 5.5vw, 56px);
    font-weight: 900;
    color: var(--secondary);
    line-height: 1.1;
    letter-spacing: -1.5px;
    max-width: 700px;
    margin: 0 auto 16px;
}
.hero h1 span {
    background: linear-gradient(135deg, var(--primary), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero p {
    font-size: 18px;
    color: var(--gray-500);
    max-width: 480px;
    margin: 0 auto 40px;
    line-height: 1.6;
}

/* ── MAIN ── */
main {
    flex: 1;
    padding: 104px 24px 60px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}
main.wide { max-width: 1200px; }

/* ── SECTION ── */
.section-header {
    text-align: center;
    margin-bottom: 40px;
}
.section-header .emoji { font-size: 32px; margin-bottom: 8px; }
.section-header h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--secondary);
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}
.section-header p {
    font-size: 15px;
    color: var(--gray-400);
}

/* ── QUIZ CARDS GRID ── */
.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 60px;
}
.quiz-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.quiz-card:hover {
    border-color: transparent;
    box-shadow: var(--shadow-lg);
    transform: translateY(-6px);
}
.quiz-card .card-emoji {
    font-size: 36px;
    margin-bottom: 14px;
    display: block;
}
.quiz-card h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 6px;
}
.quiz-card p {
    font-size: 13px;
    color: var(--gray-400);
    line-height: 1.5;
    margin-bottom: 14px;
}
.quiz-card .card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--gray-400);
    font-weight: 600;
}
.quiz-card .card-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.quiz-card .card-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}
.quiz-card:hover .card-bar { transform: scaleX(1); }

/* ── QUIZ PAGE ── */
.quiz-header {
    text-align: center;
    margin-bottom: 36px;
}
.quiz-header .emoji { font-size: 48px; margin-bottom: 12px; }
.quiz-header h1 {
    font-size: 32px;
    font-weight: 800;
    color: var(--secondary);
    letter-spacing: -0.8px;
    margin-bottom: 8px;
}
.quiz-header p {
    font-size: 16px;
    color: var(--gray-500);
}

/* Progress bar */
.quiz-progress {
    background: var(--gray-100);
    border-radius: var(--radius-full);
    height: 8px;
    margin-bottom: 32px;
    overflow: hidden;
}
.quiz-progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--primary), var(--accent-pink));
    transition: width 0.4s ease;
}

/* Question card */
.question-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 36px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    animation: slideIn 0.4s ease-out;
}
@keyframes slideIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}
.question-num {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
}
.question-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--secondary);
    line-height: 1.4;
    margin-bottom: 24px;
}
.answers {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.answer-btn {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    background: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-700);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}
.answer-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}
.answer-btn.correct {
    border-color: var(--accent-green);
    background: var(--accent-green-light);
    color: var(--accent-green);
}
.answer-btn.wrong {
    border-color: var(--accent-red);
    background: var(--accent-red-light);
    color: var(--accent-red);
}
.answer-btn .letter {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    transition: all 0.2s;
}
.answer-btn:hover .letter {
    background: var(--primary);
    color: #fff;
}
.answer-btn.correct .letter { background: var(--accent-green); color: #fff; }
.answer-btn.wrong .letter { background: var(--accent-red); color: #fff; }

/* Result card */
.result-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 48px 36px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.result-emoji { font-size: 64px; margin-bottom: 16px; }
.result-card h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 8px;
}
.result-card .score {
    font-size: 48px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}
.result-card .score-text {
    font-size: 15px;
    color: var(--gray-500);
    margin-bottom: 28px;
}
.result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── BUTTONS ── */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent-pink));
    color: #fff;
    box-shadow: 0 4px 14px rgba(108,92,231,0.3);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(108,92,231,0.4); }
.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-600);
}
.btn-secondary:hover { background: var(--gray-200); }
.btn-share {
    background: #25D366;
    color: #fff;
}
.btn-share:hover { background: #1DA855; }

/* ── TYPING TEST SPECIFIC ── */
.typing-area {
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 32px;
    font-size: 18px;
    line-height: 1.8;
    margin-bottom: 24px;
    position: relative;
    min-height: 200px;
    user-select: none;
}
.typing-area .char { transition: color 0.1s; }
.typing-area .char.correct { color: var(--accent-green); }
.typing-area .char.wrong { color: var(--accent-red); text-decoration: underline; }
.typing-area .char.current { background: var(--primary-light); border-radius: 2px; }
.typing-area .char.pending { color: var(--gray-400); }
.typing-input {
    position: absolute;
    opacity: 0;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.typing-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.stat-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}
.stat-card .stat-val {
    font-size: 28px;
    font-weight: 800;
    color: var(--secondary);
}
.stat-card .stat-label {
    font-size: 12px;
    color: var(--gray-400);
    font-weight: 600;
    margin-top: 2px;
}

/* ── AD ── */
.ad-placeholder {
    background: var(--gray-50);
    border: 1px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    color: var(--gray-400);
    font-size: 13px;
    margin: 40px 0;
}

/* ── FOOTER ── */
footer {
    background: var(--secondary);
    color: #fff;
    padding: 30px 24px;
    text-align: center;
    margin-top: auto;
}
footer p {
    font-size: 13px;
    color: rgba(255,255,255,0.4);
}
footer a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
}
footer a:hover { color: #fff; }

/* ── SEO CONTENT ── */
.seo-content {
    max-width: 700px;
    margin: 40px auto 0;
}
.seo-content h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 12px;
}
.seo-content p {
    font-size: 15px;
    color: var(--gray-500);
    line-height: 1.7;
    margin-bottom: 12px;
}

/* ── ANIMATIONS ── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero { padding: 120px 20px 60px; }
    .quiz-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    main { padding: 100px 16px 40px; }
    .quiz-header h1 { font-size: 26px; }
    .question-card { padding: 24px 20px; }
    .result-card { padding: 32px 20px; }
    .typing-area { padding: 20px; font-size: 16px; }
    .typing-stats { grid-template-columns: 1fr 1fr; }
}
