/* Plik: /public/style_quiz.css */

:root {
    --bg-body: #f9f5ff;
    --bg-card: rgba(255, 255, 255, 0.86);
    --text-main: #2d2a51;
    --text-muted: #5a5781;
    --border-color: #ddd9ff;
    --primary: #2946e5;
    --primary-hover: #1437d9;
    --success: #2946e5;
    --danger: #b41340;
    --surface-low: #f3eeff;
    --surface-high: #e3dfff;
    --shadow: 0 18px 40px rgba(45, 42, 81, 0.12);
    --shadow-strong: 0 12px 32px rgba(41, 70, 229, 0.2);
}

* { box-sizing: border-box; }

body {
    font-family: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

body::before,
body::after {
    content: "";
    position: fixed;
    z-index: -1;
    border-radius: 9999px;
    filter: blur(120px);
    opacity: 0.45;
    pointer-events: none;
}

body::before {
    top: -10%;
    right: -10%;
    width: 60%;
    height: 40%;
    background: rgba(41, 70, 229, 0.18);
}

body::after {
    bottom: -10%;
    left: -10%;
    width: 50%;
    height: 40%;
    background: rgba(85, 77, 181, 0.18);
}

h1, h2, h3,
.quiz-title,
.question-text,
.result-title,
.finish-title,
.finish-subtitle {
    font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover { color: var(--primary-hover); }

.question-box {
    width: 100%;
    max-width: 600px;
    background-color: var(--bg-card);
    padding: 32px;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: var(--shadow);
    margin: 20px auto;
    backdrop-filter: blur(20px);
}

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

.quiz-logo {
    max-width: 120px;
    max-height: 60px;
    margin-bottom: 15px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.quiz-title {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 12px 0;
    line-height: 1.3;
    text-align: center;
    letter-spacing: -0.02em;
}

.quiz-title--error { color: var(--danger); }

.progress {
    margin-bottom: 18px;
    color: var(--text-muted);
    font-size: 10px;
    text-align: right;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.82;
}

.question-text {
    font-size: 19px;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 30px;
    text-align: left;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-label {
    display: flex;
    align-items: center;
    padding: 16px;
    background-color: var(--surface-low);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.option-label:hover {
    border-color: var(--primary);
    background-color: #eae5ff;
    transform: translateY(-1px);
}

.option-label input[type="radio"] {
    margin-right: 15px;
    accent-color: var(--primary);
    transform: scale(1.2);
}

.option-text {
    font-size: 16px;
    color: var(--text-main);
}

textarea.open-answer,
input.open-answer {
    width: 100%;
    min-height: 140px;
    padding: 15px;
    background-color: var(--surface-low);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    color: var(--text-main);
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 20px;
}

input.open-answer {
    min-height: auto;
    height: 56px;
}

textarea.open-answer:focus,
input.open-answer:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(41, 70, 229, 0.15);
}

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

.submit-wrapper {
    text-align: center;
    margin-top: 25px;
}

.btn-primary,
.start-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 320px;
    padding: 16px 30px;
    background: linear-gradient(135deg, #2946e5 0%, #8999ff 100%);
    color: #fff;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: transform 0.2s, filter 0.2s;
    box-shadow: var(--shadow-strong);
}

.start-button { margin-top: 30px; }

.btn-primary:hover,
.start-button:hover {
    transform: translateY(-1px);
    filter: brightness(0.98);
}

.yn-grid {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    margin-top: 25px;
    width: 100%;
}

.btn-yes,
.btn-no {
    width: 40%;
    padding: 20px;
    font-size: 20px;
    font-weight: 700;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    color: #fff;
    transition: transform 0.2s, filter 0.2s;
    box-shadow: var(--shadow-strong);
}

.btn-yes:hover,
.btn-no:hover { transform: translateY(-2px); filter: brightness(0.98); }
.btn-yes:active,
.btn-no:active { transform: translateY(0); }

.btn-yes { background: linear-gradient(135deg, #2946e5 0%, #8999ff 100%); }
.btn-no { background: linear-gradient(135deg, #b41340 0%, #f74b6d 100%); }

.landing-desc {
    font-size: 16px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 30px;
    text-align: center;
}

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

.result-box {
    background-color: var(--surface-low);
    border: 1px solid var(--border-color);
    padding: 25px;
    border-radius: 18px;
    margin-bottom: 20px;
}

.result-title {
    color: var(--primary);
    font-size: 22px;
    margin-top: 0;
    margin-bottom: 12px;
}

.end-quiz-link {
    text-align: center;
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px dashed var(--border-color);
}

.end-quiz-link a {
    color: var(--text-muted);
    font-size: 12px;
    text-decoration: none;
}

.finish-container { text-align: center; padding: 10px 0; }
.finish-title { font-size: 24px; margin-bottom: 10px; color: var(--text-main); }

.finish-error {
    color: var(--danger);
    background: rgba(244, 75, 109, 0.12);
    padding: 15px;
    border-radius: 12px;
}

.finish-card { margin-top: 30px; }
.finish-icon { font-size: 48px; margin-bottom: 20px; }
.finish-subtitle { color: var(--primary); font-size: 22px; margin-top: 0; margin-bottom: 12px; }
.finish-text { font-size: 16px; line-height: 1.6; color: var(--text-main); }
.finish-note { font-size: 14px; color: var(--text-muted); margin-top: 20px; }
.finish-fallback-title { color: var(--text-muted); margin-bottom: 15px; }

.gate-icon { font-size: 48px; margin-bottom: 20px; }
.gate-text { color: var(--text-muted); margin-bottom: 30px; }
.gate-error { color: var(--danger); margin-bottom: 15px; font-weight: 600; }

.share-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed var(--border-color);
    text-align: center;
}

.share-title { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }

.share-input-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.share-input {
    background: var(--surface-low);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 10px;
    width: 100%;
    max-width: 300px;
    font-size: 13px;
}

.btn-copy {
    background: linear-gradient(135deg, #2946e5 0%, #8999ff 100%);
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    box-shadow: var(--shadow-strong);
    transition: transform 0.2s, filter 0.2s;
}

.btn-copy:hover { transform: translateY(-1px); filter: brightness(0.98); }
.btn-copy.is-success { background: linear-gradient(135deg, #2d1f8c 0%, #554db5 100%); }

@media (max-width: 600px) {
    body {
        min-height: 100vh;
        padding: 20px 0;
        display: flex;
        align-items: center;
    }

    .question-box {
        width: 94%;
        max-width: none;
        margin: 0 auto;
        padding: 22px;
        border-radius: 20px;
        box-shadow: 0 8px 18px rgba(45, 42, 81, 0.12);
    }

    .quiz-title { font-size: 20px; }
    .question-text { font-size: 18px; }

    .btn-yes,
    .btn-no {
        font-size: 18px;
        padding: 18px;
    }
}

@media (min-width: 601px) {
    .yn-grid {
        flex-direction: row;
        justify-content: center;
        gap: 20px;
    }

    .btn-yes,
    .btn-no {
        width: auto;
        min-width: 180px;
    }
}
