/* Gustavo Classic Font */
@font-face {
    font-family: 'Gustavo';
    src: url('assets/fonts/Gustavo-Regular.woff2') format('woff2'),
         url('assets/fonts/Gustavo-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Gustavo';
    src: url('assets/fonts/Gustavo-Bold.woff2') format('woff2'),
         url('assets/fonts/Gustavo-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Nespresso Vertuo World – Pool Campaign Palette
   ------------------------------------------------
   Navy:      PMS 3581C  #22326E
   Soft Blue: PMS 651C   #A7BCD6
*/

:root {
    /* Pool palette */
    --pool-navy: #22326E;
    --pool-navy-hover: #1a2755;
    --pool-blue: #A7BCD6;
    --pool-blue-dark: #7A93B0;

    /* Functional mapping */
    --bg-primary: #A7BCD6;
    --bg-card: #ffffff;
    --accent: var(--pool-navy);
    --text-primary: var(--pool-navy);
    --text-secondary: #556275;
    --border-subtle: #D4DCE8;
}

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

body {
    font-family: 'Gustavo', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* Utility classes */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Header */
header {
    text-align: center;
    padding: 30px 0;
}

.logo {
    margin-bottom: 20px;
}

.nespresso-logo {
    height: 100px;
    width: auto;
}

h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Progress Bar */
.progress-container {
    margin: 30px 0;
}

.progress-bar {
    height: 3px;
    background: var(--border-subtle);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 20px;
}

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

.step-indicators {
    display: flex;
    justify-content: space-between;
    max-width: 300px;
    margin: 0 auto;
}

.step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-card);
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 400;
    transition: all 0.3s ease;
    border: 1px solid var(--border-subtle);
}

.step-dot.active {
    background: var(--pool-navy);
    color: #fff;
    border-color: var(--pool-navy);
    font-weight: 700;
}

.step-dot.completed {
    background: var(--pool-blue);
    color: var(--pool-navy);
    border-color: var(--pool-blue);
}

/* Quiz Steps */
.quiz-step {
    display: none;
    animation: fadeIn 0.4s ease;
}

.quiz-step.active {
    display: block;
}

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

/* Fieldset reset */
fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.quiz-step-legend {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 30px;
    text-align: center;
    line-height: 1.4;
    width: 100%;
}

/* Validation error */
.step-error {
    text-align: center;
    color: #C0392B;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 15px;
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.options-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.options-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 600px) {
    .options-grid,
    .options-grid-2,
    .options-grid-3 {
        grid-template-columns: 1fr;
    }
}

.option-card {
    cursor: pointer;
}

/* Visually hidden but accessible radio inputs */
.option-card input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.option-content {
    background: var(--bg-card);
    border: 2px solid var(--border-subtle);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    min-height: 140px;
    justify-content: center;
}

.option-card:hover .option-content {
    border-color: var(--pool-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 50, 110, 0.1);
}

.option-card input:checked + .option-content {
    border-color: var(--pool-navy);
    background: rgba(167, 188, 214, 0.18);
    box-shadow: 0 0 20px rgba(34, 50, 110, 0.12);
}

/* Keyboard focus visible */
.option-card input:focus-visible + .option-content {
    outline: 3px solid var(--pool-navy);
    outline-offset: 2px;
}

.option-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.option-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Buttons */
.navigation-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.btn {
    padding: 14px 40px;
    border: none;
    border-radius: 30px;
    font-family: 'Gustavo', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    min-height: 44px;
    min-width: 44px;
}

.btn-primary {
    background: var(--pool-navy);
    color: var(--pool-blue);
}

#startQuizBtn {
    color: #fff;
}

.btn-primary:hover {
    background: var(--pool-navy-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(34, 50, 110, 0.25);
}

.btn-secondary {
    background: transparent;
    color: var(--pool-navy);
    border: 2px solid var(--pool-navy);
}

.btn-secondary:hover {
    background: rgba(34, 50, 110, 0.06);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn:focus-visible {
    outline: 3px solid var(--pool-navy);
    outline-offset: 2px;
}

/* Results Section */
.results-section {
    animation: fadeIn 0.5s ease;
}

.result-card {
    background: var(--bg-card);
    border: 2px solid var(--pool-navy);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
}

.result-card h2 {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.seat-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.recommendation {
    background: rgba(167, 188, 214, 0.15);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
}

.recommendation h3 {
    color: var(--pool-navy);
    font-size: 1rem;
    margin-bottom: 15px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 700;
}

#coffeeType {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--pool-navy);
    margin-bottom: 8px;
}

.coffee-drink {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--pool-navy);
}

.result-message {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
}

/* Error Message */
.error-message {
    background: #FDECEA;
    border: 2px solid #E6A19A;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    color: #C0392B;
    margin-top: 20px;
}

.error-message p {
    margin-bottom: 15px;
}

.error-retry-btn {
    margin-top: 5px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(239, 243, 248, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-overlay.hidden {
    display: none !important;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--pool-navy);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading-overlay p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(34, 50, 110, 0.55);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: 2px solid var(--pool-blue-dark);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    margin: 20px;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content h2 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-weight: 700;
}

.modal-content p {
    margin-bottom: 25px;
    line-height: 1.6;
    color: var(--text-secondary);
}

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

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 1.4rem;
    }

    .quiz-step-legend {
        font-size: 1.2rem;
    }

    .btn {
        padding: 12px 30px;
        font-size: 0.9rem;
        min-height: 44px;
    }

    .result-card {
        padding: 25px;
    }
}
