/* ========================================
   RELATIONSHIP QUIZ - @realitasmara
   Dark Premium Design System
   ======================================== */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #06060b;
    --bg-secondary: #0d0d14;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --text-primary: #f0f0f5;
    --text-secondary: rgba(240, 240, 245, 0.55);
    --text-muted: rgba(240, 240, 245, 0.35);
    --accent: #e63946;
    --accent-glow: rgba(230, 57, 70, 0.3);
    --accent-soft: rgba(230, 57, 70, 0.1);
    --accent-hover: #ff4757;
    --green: #2ed573;
    --yellow: #ffa502;
    --orange: #ff6348;
    --red: #e63946;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 660px;
    margin: 0 auto;
    padding: 0 20px;
}

/* === SCREENS === */
.screen {
    min-height: 100vh;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
}

.screen.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: .5
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* === HERO / LANDING === */
#landing {
    position: relative;
    text-align: center;
}

.hero-glow {
    position: absolute;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
    opacity: 0.4;
}

.logo-wrapper {
    margin-bottom: 48px;
    animation: slideUp 0.6s ease;
    text-align: center;
    /* CENTER logo */
    display: flex;
    justify-content: center;
}

.logo-wrapper.small {
    margin-bottom: 16px;
    justify-content: center;
    /* center juga untuk footer & result */
}

.logo-img {
    height: auto;
    width: 280px;
    max-width: 280px;
    object-fit: contain;
    display: block;
    filter: brightness(1.2);
}

.logo-img-sm {
    width: 160px;
    max-width: 160px;
    height: auto;
    filter: brightness(1.2);
}

.hero-content {
    animation: slideUp 0.8s ease;
}

.badge {
    display: inline-block;
    padding: 6px 16px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid rgba(230, 57, 70, 0.2);
    border-radius: 100px;
    margin-bottom: 24px;
}

.hero-title {
    font-size: clamp(28px, 6vw, 48px);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent) 0%, #ff6b6b 50%, #ffa502 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto 36px;
    line-height: 1.7;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 56px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
    animation: slideUp 1s ease;
}

.stat {
    text-align: center;
}

.stat-num {
    display: block;
    font-size: 28px;
    font-weight: 800;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    color: #fff;
    background: var(--accent);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 6px 30px var(--accent-glow);
    transform: translateY(-2px);
}

.btn-ghost {
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.btn-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 40px;
    flex-wrap: wrap;
}

/* === DATA INTAKE === */
.step-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-title {
    font-size: clamp(22px, 4vw, 32px);
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.section-desc {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.7;
}

.intake-form {
    max-width: 480px;
    margin: 0 auto;
    animation: slideUp 0.5s ease;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group select option {
    background: #1a1a2e;
    color: var(--text-primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 20px;
    font-style: italic;
}

.date-input-group {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 0 8px;
    transition: var(--transition);
}

.date-input-group:focus-within {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
}

.date-input-group input {
    background: transparent !important;
    border: none !important;
    padding: 16px 8px !important;
    text-align: center;
    width: 100%;
    -moz-appearance: textfield;
}

.date-input-group input::-webkit-outer-spin-button,
.date-input-group input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.date-input-group input:focus {
    outline: none;
    box-shadow: none;
}

.date-sep {
    color: rgba(255, 255, 255, 0.3);
    font-size: 18px;
    font-weight: 300;
}

.disclaimer-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: rgba(46, 213, 115, 0.06);
    border: 1px solid rgba(46, 213, 115, 0.15);
    border-radius: var(--radius-md);
    margin-bottom: 28px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.disclaimer-box svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--green);
}

.intake-form .btn {
    width: 100%;
    justify-content: center;
}

/* === QUIZ === */
.quiz-progress {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 100px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #ff6b6b);
    border-radius: 100px;
    transition: width 0.4s ease;
    width: 5%;
}

.progress-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.quiz-area-badge {
    text-align: center;
    margin-bottom: 24px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
}

.question-container {
    animation: fadeIn 0.4s ease;
}

.question-text {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 28px;
    line-height: 1.4;
    text-align: center;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-btn {
    display: block;
    width: 100%;
    padding: 16px 20px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    line-height: 1.5;
}

.option-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: translateX(4px);
}

.option-btn.selected {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--text-primary);
}

/* === LOADING === */
.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 24px;
}

.loading-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
}

.loading-desc {
    font-size: 14px;
    color: var(--text-muted);
    animation: pulse 1.5s ease infinite;
}

/* === RESULT === */
#result {
    padding-top: 40px;
}

.result-header {
    text-align: center;
    margin-bottom: 32px;
}

.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px 28px;
    margin-bottom: 20px;
    animation: slideUp 0.5s ease backwards;
}

.result-card:nth-child(2) {
    animation-delay: 0.05s;
}

.result-card:nth-child(3) {
    animation-delay: 0.1s;
}

.result-card:nth-child(4) {
    animation-delay: 0.15s;
}

.card-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 16px;
    text-transform: uppercase;
}

/* BaZi Card */
.bazi-card {
    border-left: 3px solid var(--accent);
}

.bazi-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 12px;
}

.bazi-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.bazi-note {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-style: italic;
}

/* Score Card */
.score-card {
    text-align: center;
}

.score-display {
    margin: 20px 0;
}

.score-circle {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    animation: countUp 0.8s ease;
}

.score-number {
    font-size: 72px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -3px;
}

.score-max {
    font-size: 24px;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 4px;
}

.verdict-level {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Color variants */
.score-toxic .score-number,
.score-toxic .verdict-level {
    color: var(--red);
}

.score-danger .score-number,
.score-danger .verdict-level {
    color: var(--orange);
}

.score-warning .score-number,
.score-warning .verdict-level {
    color: var(--yellow);
}

.score-healthy .score-number,
.score-healthy .verdict-level {
    color: var(--green);
}

.score-solid .score-number,
.score-solid .verdict-level {
    color: #00d2d3;
}

/* Breakdown */
.breakdown-bars {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bar-item {}

.bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.bar-name {
    font-size: 13px;
    font-weight: 600;
}

.bar-score {
    font-size: 13px;
    font-weight: 700;
}

.bar-track {
    height: 8px;
    background: var(--border);
    border-radius: 100px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 100px;
    transition: width 1s ease;
    width: 0;
}

/* Verdict */
.verdict-text {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Area Details */
.area-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.area-detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-md);
    padding: 20px;
}

.area-detail-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.area-detail-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Products */
.products-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
}

.products-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: var(--transition);
}

.product-item:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: translateX(4px);
}

.product-info {
    flex: 1;
}

.product-tier {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.tier-murah {
    color: var(--green);
}

.tier-sedang {
    color: var(--yellow);
}

.tier-mahal {
    color: var(--accent);
}

.product-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.product-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.product-price {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
    margin-left: 16px;
}

/* CTA Follow */
.cta-follow {
    text-align: center;
    padding: 20px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* FOOTER */
.footer {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid var(--border);
}

.footer-text {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.footer-copy {
    font-size: 12px;
    color: var(--text-muted);
    opacity: 0.5;
}

/* === SHARE TEMPLATE (For html2canvas only) === */
.share-card-template {
    width: 400px;
    /* Fixed width for IG Story ratio base */
    background-color: #06060b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 32px;
    box-sizing: border-box;
    z-index: -100;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #f0f0f5;
}

.share-logo {
    text-align: center;
    margin-bottom: 24px;
}

.share-logo-img {
    height: auto;
    width: 160px;
    max-width: 160px;
    object-fit: contain;
    display: block;
    margin: 0 auto 4px;
    filter: brightness(1.2);

    .share-badge {
        font-size: 9px;
        font-weight: 700;
        letter-spacing: 2px;
        color: #e63946;
        margin-top: 4px;
    }

    .share-bazi-box {
        text-align: center;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 16px 0;
        margin-bottom: 24px;
    }

    .share-bazi-label {
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 2px;
        color: #e63946;
        margin-bottom: 6px;
    }

    .share-bazi-title {
        font-size: 18px;
        font-weight: 800;
        color: #f0f0f5;
        margin-bottom: 8px;
    }

    .share-bazi-desc {
        font-size: 11px;
        color: rgba(240, 240, 245, 0.7);
        line-height: 1.5;
        padding: 0 10px;
    }

    .share-score-box {
        text-align: center;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: 16px;
        padding: 24px;
        margin-bottom: 24px;
    }

    .share-verdict {
        font-size: 16px;
        font-weight: 800;
        letter-spacing: 1px;
        margin-bottom: 8px;
        color: #f0f0f5;
    }

    .share-score {
        font-size: 64px;
        font-weight: 900;
        line-height: 1;
        letter-spacing: -2px;
        color: #f0f0f5;
    }

    .share-score-max {
        font-size: 20px;
        color: rgba(240, 240, 245, 0.35);
    }

    .share-name {
        margin-top: 8px;
        font-size: 14px;
        color: rgba(240, 240, 245, 0.55);
    }

    .share-breakdown {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-bottom: 32px;
    }

    .share-bar-item {
        width: 100%;
    }

    .share-bar-header {
        display: flex;
        justify-content: space-between;
        margin-bottom: 6px;
        font-size: 12px;
    }

    .share-bar-name {
        font-weight: 600;
        color: #f0f0f5;
    }

    .share-bar-score {
        font-weight: 700;
    }

    .share-bar-track {
        height: 6px;
        background-color: rgba(255, 255, 255, 0.06);
        border-radius: 10px;
    }

    .share-bar-fill {
        height: 100%;
        border-radius: 10px;
    }

    .share-footer {
        text-align: center;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 20px;
    }

    .share-cta {
        font-size: 12px;
        color: rgba(240, 240, 245, 0.55);
    }

    .share-ig {
        font-size: 14px;
        font-weight: 700;
        color: #e63946;
        margin-top: 4px;
    }

    /* === RESPONSIVE === */
    @media (max-width: 640px) {
        .screen {
            padding: 40px 0;
        }

        .hero-stats {
            gap: 24px;
        }

        .stat-num {
            font-size: 22px;
        }

        .form-row {
            grid-template-columns: 1fr;
        }

        .score-number {
            font-size: 56px;
        }

        .result-card {
            padding: 24px 20px;
        }

        .btn {
            padding: 12px 20px;
            font-size: 13px;
        }

        .btn-group {
            flex-direction: column-reverse;
        }

        .btn-group .btn {
            width: 100%;
            justify-content: center;
        }

        .product-item {
            flex-direction: column;
            align-items: flex-start;
            gap: 8px;
        }

        .product-price {
            margin-left: 0;
        }
    }
}