/* =========================================================
   Quiz de Marketing — Premium App Styles (Light Theme)
   Consolidated for SPA with Badge & Gamification on White BG
   ========================================================= */

:root {
    --quiz-brand: #fb5404;
    --quiz-brand-dark: #e04b04;
    --quiz-brand-rgb: 251, 84, 4;
    --quiz-dark: #1a1a1a;
    --quiz-surface: #ffffff;
    --quiz-card: #ffffff;
    --quiz-border: #eeeeee;
    --quiz-text: #1a1a1a;
    --quiz-text-dim: #666666;
    --quiz-radius: 16px;
    --quiz-shadow: 0 10px 30px rgba(0,0,0,0.05);
    --quiz-font: 'Montserrat', sans-serif;
}

/* ── App Container ──────────────────────────────── */
.hatch-quiz-app {
    max-width: 850px;
    margin: 0 auto;
    font-family: var(--quiz-font);
    color: var(--quiz-text);
}

/* ── Screen Management ──────────────────────────── */
.quiz-screen {
    display: none;
    animation: quizAppFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.quiz-screen.active {
    display: block;
}
@keyframes quizAppFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   SCREEN 1 — Level Selector
   ========================================================= */
.quiz-hero {
    text-align: center;
    margin-bottom: 40px;
}
.quiz-main-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--quiz-dark);
    margin: 0 0 10px;
    text-transform: uppercase;
}
.quiz-subtitle {
    font-size: 16px;
    color: var(--quiz-text-dim);
    line-height: 1.5;
    max-width: 500px;
    margin: 0 auto;
}

.quiz-levels-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.quiz-level-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: var(--quiz-card);
    border: 2px solid var(--quiz-border);
    border-radius: var(--quiz-radius);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: left;
    width: 100%;
}

.quiz-level-card:hover {
    border-color: var(--quiz-brand);
    background: #fff;
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(var(--quiz-brand-rgb), 0.1);
}

.level-icon-wrapper {
    font-size: 28px;
    background: #f8f8f8;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}

.level-content {
    flex: 1;
}

.level-name {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: var(--quiz-dark);
    margin-bottom: 4px;
}

.level-desc {
    display: block;
    font-size: 13px;
    color: var(--quiz-text-dim);
    line-height: 1.4;
}

/* =========================================================
   SCREEN 2 — Active Quiz
   ========================================================= */
.quiz-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.quiz-topbar-level {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--quiz-brand);
    background: rgba(var(--quiz-brand-rgb), 0.08);
    padding: 6px 15px;
    border-radius: 20px;
}
.quiz-topbar-timer {
    font-size: 15px;
    font-weight: 700;
    color: var(--quiz-text-dim);
}

.quiz-progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 10px;
    margin-bottom: 30px;
    overflow: hidden;
}
.quiz-progress-fill {
    height: 100%;
    background: var(--quiz-brand);
    transition: width 0.5s ease;
}

.quiz-question-card {
    margin-bottom: 25px;
}
.quiz-question-number {
    font-size: 12px;
    font-weight: 800;
    color: var(--quiz-brand);
    text-transform: uppercase;
    margin-bottom: 10px;
}
.quiz-question-text {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.3;
    margin: 0;
    color: #111;
}

.quiz-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.quiz-option-btn {
    background: var(--quiz-card);
    border: 2px solid var(--quiz-border);
    border-radius: 12px;
    padding: 18px 20px;
    color: var(--quiz-text);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.quiz-option-btn:hover {
    border-color: var(--quiz-brand);
    background: rgba(var(--quiz-brand-rgb), 0.02);
}

.quiz-option-btn.selected {
    border-color: var(--quiz-brand);
    background: var(--quiz-brand);
    color: #fff;
    box-shadow: 0 5px 15px rgba(var(--quiz-brand-rgb), 0.2);
}

.option-letter {
    width: 28px;
    height: 28px;
    background: #f5f5f5;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12px;
    color: #888;
    flex-shrink: 0;
}

.quiz-option-btn.selected .option-letter {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* =========================================================
   SCREEN 3 — Results & Gamification
   ========================================================= */
/* =========================================================
   SCREEN 3 — Results Dashboard (Horizontal Grid)
   ========================================================= */
.hatch-results-container {
    display: grid;
    grid-template-columns: 340px 1fr;
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    border: 2px solid #f2f2f2;
    box-shadow: 0 40px 100px rgba(0,0,0,0.08);
    min-height: 520px;
    animation: quizAppFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.hatch-results-sidebar {
    background: linear-gradient(180deg, #fcfcfc 0%, #f7f7f7 100%);
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #eee;
    text-align: center;
}

.results-badge-wrapper {
    position: relative;
    margin-bottom: 40px;
    z-index: 2;
}

.badge-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(var(--quiz-brand-rgb), 0.15) 0%, rgba(var(--quiz-brand-rgb), 0) 70%);
    z-index: -1;
    animation: pulseGlow 3s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.8; }
}

.quiz-badge {
    width: 170px;
    height: 170px;
    background: linear-gradient(135deg, var(--quiz-brand) 0%, #ff8400 100%);
    border-radius: 50%;
    padding: 10px;
    box-shadow: 0 20px 40px rgba(var(--quiz-brand-rgb), 0.3);
}

.badge-inner {
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.badge-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2.5px;
    color: #bbb;
    margin-bottom: 4px;
}

.badge-rank {
    font-size: 22px;
    font-weight: 900;
    color: var(--quiz-brand);
    text-transform: uppercase;
}

.results-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    width: 100%;
}

.metric-item {
    background: #fff;
    padding: 15px 10px;
    border-radius: 12px;
    border: 1px solid #eee;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.metric-icon { font-size: 18px; display: block; margin-bottom: 5px; }

.metric-label {
    display: block;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 3px;
}

.metric-value {
    display: block;
    font-size: 18px;
    font-weight: 900;
    color: #111;
}

/* Main Area */
.hatch-results-main {
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
}

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

.quiz-results-title {
    font-size: 42px;
    font-weight: 900;
    color: #111;
    margin: 0 0 15px;
    letter-spacing: -1px;
}

.quiz-results-phrase {
    font-size: 18px;
    line-height: 1.6;
    color: #555;
    max-width: 600px;
}

.quiz-results-phrase a {
    color: var(--quiz-brand);
    font-weight: 800;
    text-decoration: none;
    border-bottom: 2px solid rgba(var(--quiz-brand-rgb), 0.2);
    transition: all 0.2s ease;
}

.quiz-results-phrase a:hover {
    background: rgba(var(--quiz-brand-rgb), 0.05);
    border-bottom-color: var(--quiz-brand);
}

.share-box-premium {
    background: #fcfcfc;
    border: 1px solid #f0f0f0;
    padding: 25px;
    border-radius: 16px;
    margin-bottom: 40px;
    margin-top: auto;
}

.share-box-title {
    display: block;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 15px;
    text-align: center;
}

.share-buttons-premium {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.share-btn-p {
    flex: 1;
    border: none;
    padding: 12px 15px;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    color: #fff;
    max-width: 180px;
}

.share-btn-p.x-link { background: #000; }
.share-btn-p.li-link { background: #0077b5; }
.share-btn-p.wa-link { background: #25d366; }

.share-btn-p:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }

.results-actions-premium {
    padding-top: 30px;
    border-top: 1px solid #eee;
    text-align: center;
}

.ranking-prompt {
    font-size: 15px;
    font-weight: 600;
    color: #111;
    margin-bottom: 20px;
}

.action-buttons-group {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.share-title {
    font-weight: 800;
    font-size: 13px;
    text-transform: uppercase;
    margin-bottom: 15px;
    color: #888;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.share-btn {
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-btn.x-share { background: #000000; color: #fff; }
.share-btn.li-share { background: #0077b5; color: #fff; }
.share-btn.wa-share { background: #25d366; color: #fff; }

.share-btn:hover { transform: translateY(-2px); }

/* =========================================================
   Leaderboard UI
   ========================================================= */
.quiz-leaderboard-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 30px;
    border: 2px solid #f5f5f5;
    box-shadow: var(--quiz-shadow);
}

.quiz-tab {
    background: #f5f5f5;
    border: none;
    color: #888;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    font-size: 13px;
}

.quiz-tab.active {
    background: var(--quiz-brand);
    color: #fff;
    box-shadow: 0 5px 15px rgba(var(--quiz-brand-rgb), 0.2);
}

.quiz-lb-table {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;
}

.quiz-lb-table th {
    text-align: left;
    padding: 12px;
    color: #999;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #f5f5f5;
}

.quiz-lb-table td {
    padding: 15px 12px;
    border-bottom: 1px solid #f9f9f9;
}

.lb-pos { font-weight: 800; font-size: 16px; color: var(--quiz-brand); }
.lb-name { font-weight: 700; }
.lb-score { font-weight: 800; }
.lb-time { color: #888; font-size: 12px; }

/* =========================================================
   Buttons & General
   ========================================================= */
.quiz-btn {
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-family: var(--quiz-font);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.quiz-nav {
    display: flex;
    justify-content: flex-end;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #f9f9f9;
}

.quiz-btn-primary {
    background: var(--quiz-brand);
    color: #fff;
    box-shadow: 0 8px 20px rgba(var(--quiz-brand-rgb), 0.25);
}

.quiz-btn-primary:hover {
    background: var(--quiz-brand-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(var(--quiz-brand-rgb), 0.35);
}

.quiz-btn-secondary {
    background: #f0f0f0;
    color: #555;
}

.quiz-btn-secondary:hover { background: #e8e8e8; }

.quiz-warning {
    color: #e74c3c;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
}

/* Ranking Form */
.quiz-form-card {
    background: #fff;
    border-radius: 20px;
    padding: 35px;
    border: 2px solid #f5f5f5;
    max-width: 500px;
    margin: 0 auto;
}

.quiz-form-group input, .quiz-form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-family: inherit;
    margin-bottom: 15px;
}

.quiz-form-group input:focus {
    border-color: var(--quiz-brand);
    outline: none;
}

/* --- Height Compaction for 13" Laptops --- */
@media screen and (max-height: 800px) {
    .results-left-col { flex: 0 0 260px; padding: 25px; }
    .results-right-col { padding: 30px; }
    .quiz-results-title { font-size: 26px; }
    .quiz-badge { width: 120px; height: 120px; }
    .quiz-results-phrase { font-size: 14px; margin-bottom: 15px; }
    .quiz-stat-value { font-size: 22px; }
    .quiz-share-section { padding: 15px; }
}

@media (max-width: 768px) {
    .results-top-row { flex-direction: column; }
    .results-left-col { flex: 1 0 auto; border-right: none; border-bottom: 1px solid #eee; }
}

/* Link Styles in Phrases */
.quiz-results-phrase a {
    color: var(--quiz-brand);
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid rgba(var(--quiz-brand-rgb), 0.3);
    transition: all 0.2s ease;
}
.quiz-results-phrase a:hover {
    color: var(--quiz-brand-dark);
    border-bottom-color: var(--quiz-brand-dark);
    background: rgba(var(--quiz-brand-rgb), 0.05);
}

/* Animations for quiz flow */
#quiz-screen-active.active {
    display: flex;
    flex-direction: column;
}

/* Responsive */
@media (max-width: 768px) {
    .quiz-levels-grid, .quiz-options-grid { grid-template-columns: 1fr; }
    .quiz-results-stats { gap: 20px; flex-direction: column;}
}
