/* =========================================
   SBTI Personality Test Styles
   Clean, Minimal, White-Dominant
   ========================================= */

:root {
    --bg: #f8f9fa;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-sub: #4b5563;
    --text-light: #9ca3af;
    --accent: #7c3aed;
    --accent-light: #8b5cf6;
    --accent-soft: rgba(124, 58, 237, 0.08);
    --border: #e5e7eb;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow: 0 4px 20px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.08);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    min-height: 100vh;
    color: var(--text-main);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.section {
    display: none;
    animation: fadeIn 0.45s ease both;
}

.section.active {
    display: block;
}

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

/* =========================================
   Landing Page
   ========================================= */
.landing-header {
    text-align: center;
    padding: 80px 0 48px;
}

.landing-title {
    font-size: clamp(1.9rem, 5.5vw, 2.6rem);
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 16px;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.landing-title span {
    color: var(--accent);
}

.landing-subtitle {
    font-size: 1rem;
    color: var(--text-sub);
    max-width: 460px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 440px;
    margin: 0 auto 40px;
}

.feature-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 12px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-sub);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}

.feature-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.feature-item .icon {
    font-size: 1.35rem;
    display: block;
    margin-bottom: 6px;
}

.start-btn {
    display: block;
    width: 100%;
    max-width: 260px;
    margin: 0 auto 16px;
    padding: 15px 28px;
    border: none;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.22);
    transition: all var(--transition);
    font-family: inherit;
}

.start-btn:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(124, 58, 237, 0.3);
}

.author-note {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-light);
}

/* =========================================
   Quiz Page
   ========================================= */
.quiz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-top: 16px;
}

.back-link {
    font-size: 0.9rem;
    color: var(--text-sub);
    cursor: pointer;
    transition: color var(--transition);
    user-select: none;
    font-weight: 500;
}

.back-link:hover {
    color: var(--accent);
}

.progress-text {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 999px;
    margin-bottom: 32px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 999px;
    transition: width 0.4s ease;
}

.question-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.question-number {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

.question-text {
    font-size: clamp(1.15rem, 4vw, 1.4rem);
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 28px;
    color: var(--text-main);
}

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

.option-btn {
    width: 100%;
    padding: 17px 22px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: #fff;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    line-height: 1.55;
}

.option-btn:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: translateX(3px);
}

.option-btn:active {
    transform: translateX(1px) scale(0.995);
}

/* =========================================
   Loading Page
   ========================================= */
.loading-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--accent), var(--accent-light), var(--accent));
    mask: radial-gradient(circle, transparent 55%, black 56%);
    -webkit-mask: radial-gradient(circle, transparent 55%, black 56%);
    animation: spin 1.1s linear infinite;
    margin-bottom: 22px;
}

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

.loading-text {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-sub);
    margin-bottom: 6px;
}

.loading-sub {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* =========================================
   Result Page
   ========================================= */
.result-avatar {
    display: flex;
    justify-content: center;
    padding: 10px 0 6px;
}

.result-avatar img {
    width: 220px;
    height: 220px;
    object-fit: contain;
    border-radius: 0;
    background: transparent;
    padding: 0;
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.08));
    transition: transform var(--transition);
}

.result-avatar img:hover {
    transform: scale(1.04);
}

.result-header {
    text-align: center;
    padding: 0 0 32px;
}

.result-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-light);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.result-type-code {
    font-size: clamp(2.2rem, 6.5vw, 3.2rem);
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.result-type-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    margin-top: 8px;
}

.result-tagline {
    font-size: 0.95rem;
    color: var(--text-sub);
    margin-top: 6px;
    font-style: italic;
}

.match-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 18px;
    padding: 8px 18px;
    background: var(--accent-soft);
    border: 1px solid rgba(124,58,237,0.15);
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
}

.result-section-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
}

.result-section-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 14px;
}

.result-section-card p {
    font-size: 0.95rem;
    color: var(--text-sub);
    line-height: 1.85;
}

/* Dimension bars */
.dim-model {
    margin-bottom: 20px;
}

.dim-model:last-child {
    margin-bottom: 0;
}

.dim-model-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px dashed var(--border);
    letter-spacing: 0.02em;
}

.dim-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.dim-label {
    width: 90px;
    font-size: 0.78rem;
    color: var(--text-sub);
    flex-shrink: 0;
}

.dim-bar-wrap {
    flex: 1;
    height: 8px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.dim-bar {
    height: 100%;
    border-radius: 999px;
    transition: width 0.8s ease;
}

.dim-bar.l { width: 33%; background: #9ca3af; }
.dim-bar.m { width: 66%; background: #f59e0b; }
.dim-bar.h { width: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-light)); }

.dim-value {
    width: 24px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-light);
    text-align: right;
    flex-shrink: 0;
}

/* Disclaimer */
.disclaimer {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius-md);
    padding: 16px;
    font-size: 0.85rem;
    color: var(--text-sub);
    line-height: 1.75;
    margin-bottom: 18px;
}

.disclaimer strong {
    color: #d97706;
}

/* Action buttons */
.result-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    margin-bottom: 8px;
}

.result-actions button {
    flex: 1;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    border: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.22);
}

.btn-primary:hover {
    background: var(--accent-light);
    box-shadow: 0 10px 26px rgba(124, 58, 237, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #fff;
    color: var(--text-main);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 0 20px;
    font-size: 0.75rem;
    color: var(--text-light);
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 560px) {
    .container {
        padding: 20px 16px;
    }

    .landing-header {
        padding: 50px 0 32px;
    }

    .features {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .question-card {
        padding: 24px 18px;
    }

    .option-btn {
        padding: 15px 18px;
        font-size: 0.95rem;
    }

    .result-section-card {
        padding: 18px;
    }

    .result-avatar img {
        width: 180px;
        height: 180px;
    }

    .dim-label {
        width: 78px;
        font-size: 0.75rem;
    }

    .result-actions {
        flex-direction: column;
    }
}
