/* ═══════════════════════════════════════════
   QuiCheirinho – Frontend Quiz Styles
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400&family=Inter:wght@400;500;600&display=swap');

/* ── Variables ── */
.qc-wrap {
    --qc-primary:    #C9935A;
    --qc-primary-dk: #a07040;
    --qc-bg:         #fffdf9;
    --qc-card:       #ffffff;
    --qc-border:     #e8ddd0;
    --qc-text:       #2d1f0e;
    --qc-muted:      #8a7560;
    --qc-radius:     14px;
    --qc-shadow:     0 4px 24px rgba(120,80,20,.10);

    font-family: 'Inter', sans-serif;
    color: var(--qc-text);
    background: var(--qc-bg);
    border-radius: var(--qc-radius);
    box-shadow: var(--qc-shadow);
    padding: 36px 40px 40px;
    max-width: 640px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

/* Dark theme */
.qc-wrap.qc-theme-dark {
    --qc-bg:     #1a1208;
    --qc-card:   #271a0b;
    --qc-border: #3d2e1c;
    --qc-text:   #f5ede0;
    --qc-muted:  #b09070;
}

/* Subtle grain overlay */
.qc-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='.03'/%3E%3C/svg%3E");
    pointer-events: none;
    border-radius: var(--qc-radius);
    z-index: 0;
}
.qc-wrap > * { position: relative; z-index: 1; }

/* ── Progress bar ── */
.qc-progress-bar {
    height: 4px;
    background: var(--qc-border);
    border-radius: 99px;
    margin-bottom: 6px;
    overflow: hidden;
}
.qc-progress-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--qc-primary), #e8b47a);
    border-radius: 99px;
    transition: width .4s cubic-bezier(.4,0,.2,1);
}
.qc-progress-text {
    font-size: 12px;
    color: var(--qc-muted);
    margin: 0 0 28px;
    text-align: right;
}

/* ── Step counter ── */
.qc-step-counter {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--qc-primary);
    margin: 0 0 8px;
}

/* ── Question ── */
.qc-question-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(20px, 4vw, 26px);
    font-weight: 600;
    line-height: 1.3;
    color: var(--qc-text);
    margin: 0 0 24px;
}

/* ── Options ── */
.qc-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
}

.qc-option {
    background: var(--qc-card);
    border: 2px solid var(--qc-border);
    border-radius: var(--qc-radius);
    padding: 14px 18px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: var(--qc-text);
    text-align: left;
    cursor: pointer;
    transition: all .2s ease;
    line-height: 1.4;
}
.qc-option:hover {
    border-color: var(--qc-primary);
    background: #fff8f0;
    transform: translateX(4px);
}
.qc-wrap.qc-theme-dark .qc-option:hover {
    background: #2e1e0e;
}
.qc-option.selected {
    border-color: var(--qc-primary);
    color: var(--qc-primary);
    background: #fff3e4;
    box-shadow: 0 0 0 3px rgba(201,147,90,.12);
    font-weight: 600;
}
.qc-wrap.qc-theme-dark .qc-option.selected {
    background: #2e1e0e;
}
.qc-option.selected::before {
    content: '✓  ';
    color: var(--qc-primary);
}

/* ── Navigation ── */
.qc-nav {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.qc-btn {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 26px;
    border-radius: var(--qc-radius);
    border: none;
    cursor: pointer;
    transition: all .2s ease;
    letter-spacing: .02em;
}
.qc-btn-primary {
    background: var(--qc-primary);
    color: #fff;
}
.qc-btn-primary:hover {
    background: var(--qc-primary-dk);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(201,147,90,.35);
}
.qc-btn-secondary {
    background: transparent;
    color: var(--qc-muted);
    border: 1px solid var(--qc-border);
}
.qc-btn-secondary:hover {
    border-color: var(--qc-primary);
    color: var(--qc-primary);
}

/* ── Loading ── */
.qc-loading {
    text-align: center;
    padding: 48px 0;
}
.qc-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--qc-border);
    border-top-color: var(--qc-primary);
    border-radius: 50%;
    animation: qc-spin .8s linear infinite;
    margin: 0 auto 16px;
}
@keyframes qc-spin { to { transform: rotate(360deg); } }

/* ── Results ── */
.qc-result-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    color: var(--qc-text);
    margin-bottom: 8px;
}
.qc-result-subtitle {
    text-align: center;
    color: var(--qc-muted);
    font-size: 13px;
    margin-bottom: 24px;
}

/* Profile tags */
.qc-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
    justify-content: center;
}
.qc-tag-badge {
    background: var(--qc-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .05em;
    padding: 4px 12px;
    border-radius: 99px;
}

/* Product cards */
.qc-products {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 28px;
}

.qc-product-card {
    display: flex;
    gap: 18px;
    background: var(--qc-card);
    border: 1px solid var(--qc-border);
    border-radius: var(--qc-radius);
    padding: 18px;
    align-items: center;
    animation: qc-fadeup .4s ease both;
}
@keyframes qc-fadeup {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.qc-product-card:nth-child(2) { animation-delay: .08s; }
.qc-product-card:nth-child(3) { animation-delay: .16s; }

.qc-product-img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

.qc-product-info { flex: 1; }

.qc-product-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--qc-text);
    margin: 0 0 4px;
}

.qc-product-price {
    font-size: 15px;
    font-weight: 600;
    color: var(--qc-primary);
    margin: 0 0 10px;
}

.qc-match-badge {
    display: inline-block;
    background: #fff3e4;
    color: var(--qc-primary);
    border: 1px solid #e8c090;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 99px;
    margin-bottom: 12px;
}
.qc-wrap.qc-theme-dark .qc-match-badge {
    background: #2e1e0e;
}

.qc-product-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.qc-btn-product {
    font-size: 12px;
    padding: 8px 16px;
    border-radius: 8px;
}

/* Error state */
.qc-error {
    text-align: center;
    padding: 32px;
    color: var(--qc-muted);
}
.qc-error strong {
    display: block;
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--qc-text);
}

/* Restart button row */
.qc-restart-row {
    text-align: center;
}

/* Responsive */
@media (max-width: 480px) {
    .qc-wrap { padding: 24px 20px 28px; }
    .qc-product-card { flex-direction: column; align-items: flex-start; }
    .qc-product-img { width: 100%; height: 180px; border-radius: 10px; }
}
/* Shake animation for unanswered step */
@keyframes qc-shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}
.qc-shake { animation: qc-shake .4s ease; }
