/**
 * Typeform-like Questionnaire Styles
 * Design epure avec transitions fluides
 */

:root {
    --primary: #FF5B23;
    --primary-dark: #E64D15;
    --primary-light: #FFF3EE;
    --bg: #ffffff;
    --bg-secondary: #FAFAFA;
    --text: #1a1a1a;
    --text-muted: #666666;
    --text-light: #999999;
    --border: #E8E8E8;
    --success: #10b981;
    --success-light: #d1fae5;
    --error: #ef4444;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #FFFFFF 0%, #FAFAFA 100%);
    color: var(--text);
    line-height: 1.6;
}

/* ========================================
   QUESTIONNAIRE CONTAINER
   ======================================== */

.typeform-container {
    height: 100vh;
    overflow: hidden;
    position: relative;
}

.typeform-slides {
    height: 100%;
    position: relative;
}

/* ========================================
   INDIVIDUAL SLIDE
   ======================================== */

.typeform-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transform: translateY(50px);
    pointer-events: none;
    transition: var(--transition-slow);
}

.typeform-slide.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.typeform-slide.prev {
    opacity: 0;
    transform: translateY(-50px);
}

.slide-content {
    width: 100%;
    max-width: 680px;
    animation: slideIn 0.6s ease-out;
}

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

/* ========================================
   QUESTION NUMBER & TITLE
   ======================================== */

.question-number {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 14px;
}

.question-number span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--primary-light);
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 600;
}

.question-number .arrow {
    color: var(--text-light);
}

.question-title {
    font-size: 1.4rem;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 8px;
    color: var(--text);
    letter-spacing: -0.015em;
}

.question-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 24px;
    font-weight: 300;
    line-height: 1.6;
}

/* ========================================
   OPTIONS (RADIO & CHECKBOX)
   ======================================== */

.options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 32px;
}

.option-item {
    position: relative;
}

.option-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option-label {
    display: flex;
    align-items: center;
    padding: 11px 18px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    font-weight: 300;
}

.option-label:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateX(4px);
}

.option-input:checked + .option-label {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: var(--shadow);
}

.option-input:focus + .option-label {
    box-shadow: 0 0 0 3px rgba(255, 91, 35, 0.15);
}

.option-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-right: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-light);
    transition: var(--transition);
}

.option-input:checked + .option-label .option-key {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    font-weight: 600;
}

.option-text {
    flex: 1;
}

.option-text .main {
    font-weight: 400;
    display: block;
    font-size: 0.9rem;
}

.option-text .sub {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 3px;
    font-weight: 300;
}

/* Checkbox specific */
.checkbox-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

@media (max-width: 600px) {
    .checkbox-list {
        grid-template-columns: 1fr;
    }
}

.checkbox-item .option-label {
    padding: 16px 20px;
}

.checkbox-check {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-radius: 6px;
    margin-right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.checkbox-check svg {
    width: 14px;
    height: 14px;
    stroke: white;
    stroke-width: 3;
    opacity: 0;
    transform: scale(0.5);
    transition: var(--transition);
}

.option-input:checked + .option-label .checkbox-check {
    background: var(--primary);
    border-color: var(--primary);
}

.option-input:checked + .option-label .checkbox-check svg {
    opacity: 1;
    transform: scale(1);
}

/* ========================================
   INPUT FIELD (ELO)
   ======================================== */

.input-group {
    margin-bottom: 32px;
}

.input-label {
    display: block;
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.input-field {
    width: 100%;
    max-width: 200px;
    padding: 16px 20px;
    font-size: 1.1rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    transition: var(--transition);
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.input-field::placeholder {
    color: var(--text-light);
}

/* ========================================
   NAVIGATION BUTTONS
   ======================================== */

.slide-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.btn-primary {
    background: #100A3D;
    color: white;
    box-shadow: var(--shadow);
}

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

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow);
}

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

.btn-secondary {
    background: transparent;
    color: var(--text-muted);
    padding: 14px 20px;
}

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

.btn-secondary svg {
    width: 16px;
    height: 16px;
}

.btn-outline {
    background: #100A3D;
    color: white;
    border: 1px solid #100A3D;
    box-shadow: 0 2px 4px rgba(16, 10, 61, 0.15);
}

.btn-outline:hover {
    background: #0D0830;
    border-color: #0D0830;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 10, 61, 0.25);
}

.btn-outline:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(16, 10, 61, 0.15);
}

.enter-hint {
    color: var(--text-light);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.enter-hint kbd {
    display: inline-block;
    padding: 4px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.8rem;
}

/* ========================================
   PROGRESS BAR
   ======================================== */

.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--border);
    z-index: 100;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.4s ease-out;
}

/* ========================================
   TOP NAVIGATION
   ======================================== */

.top-nav {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 50;
}

.logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo-img {
    height: 40px;
    width: auto;
    display: block;
}

.nav-progress {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.nav-dots {
    display: flex;
    gap: 6px;
    margin-left: 12px;
}

.nav-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    transition: var(--transition);
    cursor: pointer;
}

.nav-dot.active {
    background: var(--primary);
    transform: scale(1.2);
}

.nav-dot.completed {
    background: var(--success);
}

/* ========================================
   WELCOME SLIDE
   ======================================== */

.welcome-slide .slide-content {
    text-align: center;
    max-width: 560px;
}

.welcome-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 32px;
    background: linear-gradient(135deg, var(--primary-light) 0%, #FFF8F5 100%);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    box-shadow: var(--shadow-lg);
}

.welcome-slide .question-title {
    font-size: 2.2rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.welcome-features {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 36px 0;
    flex-wrap: wrap;
}

.welcome-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 400;
}

.welcome-feature svg {
    color: var(--primary);
    width: 18px;
    height: 18px;
}

/* ========================================
   RESULTS SLIDE
   ======================================== */

.results-slide {
    overflow-y: auto;
    align-items: flex-start;
    padding-top: 80px;
    padding-bottom: 40px;
}

.results-slide .slide-content {
    max-width: 900px;
}

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

.results-header .success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: var(--success-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.results-header .success-icon svg {
    width: 32px;
    height: 32px;
    color: var(--success);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.pack-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: var(--transition);
}

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

.pack-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
    letter-spacing: -0.01em;
}

.pack-card .author {
    color: var(--primary);
    font-size: 0.85rem;
    margin-bottom: 10px;
    font-weight: 500;
}

.pack-card .description {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pack-card .level {
    display: inline-block;
    padding: 5px 10px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 14px;
}

.pack-card .btn-primary {
    width: 100%;
    padding: 10px 18px;
    font-size: 0.9rem;
}

.results-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .question-title {
        font-size: 1.4rem;
    }

    .question-subtitle {
        font-size: 0.9rem;
    }

    .welcome-slide .question-title {
        font-size: 1.8rem;
    }

    .option-label {
        padding: 12px 16px;
        font-size: 0.9rem;
    }

    .option-key {
        min-width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }

    .top-nav {
        top: 10px;
        left: 10px;
        right: 10px;
    }

    .nav-dots {
        display: none;
    }

    .welcome-features {
        flex-direction: column;
        gap: 14px;
        align-items: center;
    }

    .results-slide {
        padding-top: 60px;
    }

    .welcome-icon {
        width: 80px;
        height: 80px;
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .slide-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .enter-hint {
        justify-content: center;
        margin-top: 8px;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.option-input:checked + .option-label {
    animation: pulse 0.3s ease-out;
}

/* Loading state */
.loading .btn-primary {
    pointer-events: none;
    opacity: 0.7;
}

.loading .btn-primary::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
}

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

/* ========================================
   PACK NAME HIGHLIGHT
   ======================================== */

.pack-name-highlight {
    color: var(--primary);
    font-weight: inherit;
}

/* ========================================
   NO RESULTS
   ======================================== */

.no-results {
    text-align: center;
    padding: 60px 40px;
    background: var(--bg-secondary);
    border-radius: 16px;
    grid-column: 1 / -1;
}

.no-results p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 24px;
}

/* ========================================
   PACK REASON
   ======================================== */

.pack-reason {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ========================================
   ADDITIONAL UTILITIES
   ======================================== */

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 32px;
}

.mb-4 {
    margin-bottom: 32px;
}

/* ========================================
   ELO INPUT (Question 4)
   ======================================== */

.elo-input {
    width: 100%;
    padding: 16px;
    font-size: 18px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--background);
    color: var(--text-primary);
    transition: all 0.2s;
    font-family: inherit;
}

.elo-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.elo-input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.elo-input::-webkit-inner-spin-button,
.elo-input::-webkit-outer-spin-button {
    opacity: 1;
}

/* ========================================
   ELO INPUT INLINE (Question 1)
   ======================================== */

.elo-input-inline {
    transition: all 0.2s;
}

.elo-input-inline:focus {
    outline: none;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.elo-input-inline::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.elo-input-inline::-webkit-inner-spin-button,
.elo-input-inline::-webkit-outer-spin-button {
    opacity: 1;
}
