/* ═══════════════════════════════════════════════
   ValueMyIdea.com — Stylesheet
   ═══════════════════════════════════════════════ */

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

:root {
    --bg: #0c0b0e;
    --surface: #14131a;
    --surface2: #1c1b24;
    --surface3: #24232e;
    --border: #2e2d3a;
    --border-hover: #444358;
    --text: #eae8f0;
    --text-secondary: #a8a6b8;
    --text-muted: #6b697a;
    --accent: #f5a623;
    --accent-light: #ffd080;
    --accent-dim: #c4841c;
    --green: #34d399;
    --green-dim: #065f46;
    --red: #f87171;
    --red-dim: #7f1d1d;
    --blue: #60a5fa;
    --amber: #fbbf24;
    --serif: 'DM Serif Display', Georgia, serif;
    --sans: 'DM Sans', -apple-system, sans-serif;
    --mono: 'IBM Plex Mono', monospace;
    --radius: 12px;
    --radius-sm: 8px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    min-height: 100vh;
    line-height: 1.6;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(245, 166, 35, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(245, 166, 35, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

.app {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* ── Header ── */
.header {
    text-align: center;
    padding: 3rem 0;
    margin-bottom: 1rem;
}

.logo {
    font-family: var(--serif);
    font-size: 2.2rem;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

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

.subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    font-weight: 300;
    max-width: 440px;
    margin: 0 auto 1.5rem;
}

.header-meta {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--mono);
}

.header-meta span::before {
    content: '●';
    margin-right: 0.4rem;
    color: var(--accent-dim);
}

.privacy-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1rem;
    font-family: var(--mono);
    font-size: 0.7rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    border: 1px solid var(--green-dim);
    color: var(--green);
    background: rgba(52, 211, 153, 0.05);
}

/* ── Progress ── */
.progress-container { margin-bottom: 2.5rem; }

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: var(--mono);
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-dim), var(--accent));
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Question Card ── */
.question-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    animation: fadeUp 0.4s ease;
}

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

.question-number {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
}

.question-text {
    font-family: var(--serif);
    font-size: 1.35rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.question-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* ── Options ── */
.options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.9rem;
}

.option:hover {
    border-color: var(--border-hover);
    background: var(--surface3);
}

.option.selected {
    border-color: var(--accent);
    background: rgba(245, 166, 35, 0.08);
}

.option-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--border-hover);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.option.selected .option-dot {
    border-color: var(--accent);
    background: var(--accent);
}

.option.selected .option-dot::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bg);
}

/* Checkbox style for multi-select */
.option .option-dot[style*="border-radius:4px"] {
    border-radius: 4px !important;
}

.option.selected .option-dot[style*="border-radius:4px"]::after {
    content: '✓';
    width: auto;
    height: auto;
    border-radius: 0;
    background: none;
    color: var(--bg);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

/* ── Text Input ── */
.text-input {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--sans);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s;
}

.text-input:focus { border-color: var(--accent); }
.text-input::placeholder { color: var(--text-muted); }
textarea.text-input { min-height: 80px; resize: vertical; }

/* ── Slider ── */
.slider-container { padding: 0.5rem 0; }

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: var(--surface3);
    border-radius: 2px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(245, 166, 35, 0.3);
}

.slider-value {
    text-align: center;
    font-family: var(--mono);
    font-size: 1.5rem;
    color: var(--accent);
    margin-top: 0.75rem;
    font-weight: 500;
}

/* ── Buttons ── */
.btn {
    font-family: var(--sans);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.75rem 1.8rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

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

.btn-primary {
    background: var(--accent);
    color: var(--bg);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-light);
    box-shadow: 0 4px 24px rgba(245, 166, 35, 0.25);
}

.btn-primary:active:not(:disabled) { transform: scale(0.97); }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-ghost:hover:not(:disabled) {
    border-color: var(--border-hover);
    color: var(--text-secondary);
}

.btn-large { padding: 1rem 2.5rem; font-size: 1rem; }

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

/* ═══════════════════════════════════════════════
   RESULTS
   ═══════════════════════════════════════════════ */

.results {
    display: none;
    animation: fadeUp 0.6s ease;
}

.results.visible { display: block; }

/* Score Ring */
.score-hero { text-align: center; padding: 3rem 0; }

.score-ring-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 1.5rem;
}

.score-ring {
    width: 200px;
    height: 200px;
    transform: rotate(-90deg);
}

.score-ring circle { fill: none; stroke-width: 6; }
.score-ring .ring-bg { stroke: var(--surface3); }

.score-ring .ring-fill {
    stroke: var(--accent);
    stroke-linecap: round;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 565.48;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-ring .ring-fill.green { stroke: var(--green); }
.score-ring .ring-fill.red { stroke: var(--red); }
.score-ring .ring-fill.amber { stroke: var(--amber); }

.score-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--serif);
    font-size: 3.5rem;
    line-height: 1;
}

.score-number small {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    margin-top: 0.25rem;
}

.score-label {
    font-family: var(--serif);
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.score-summary {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 480px;
    margin: 0 auto;
}

/* Breakdown */
.breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
}

.metric-label {
    font-family: var(--mono);
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-family: var(--serif);
    font-size: 1.6rem;
    margin-bottom: 0.25rem;
}

.metric-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.metric-bar {
    height: 3px;
    background: var(--surface3);
    border-radius: 2px;
    margin-top: 0.75rem;
    overflow: hidden;
}

.metric-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 1s ease 0.5s;
}

/* Detail sections */
.detail-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    margin-bottom: 1rem;
}

.detail-title {
    font-family: var(--serif);
    font-size: 1.15rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}

.detail-row:last-child { border-bottom: none; }
.detail-row .label { color: var(--text-secondary); }
.detail-row .value { font-family: var(--mono); font-weight: 500; text-align: right; }

/* Risk items */
.risk-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}

.risk-item:last-child { border-bottom: none; }

.risk-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 0.45rem;
    flex-shrink: 0;
}

.risk-dot.high { background: var(--red); }
.risk-dot.medium { background: var(--amber); }
.risk-dot.low { background: var(--green); }

.risk-label { font-weight: 600; margin-bottom: 0.15rem; }
.risk-desc { color: var(--text-muted); font-size: 0.82rem; }

/* Steps */
.next-steps { counter-reset: step; }

.step-item {
    display: flex;
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}

.step-item:last-child { border-bottom: none; }

.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--surface3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 500;
}

.step-text { padding-top: 0.2rem; }
.step-text strong { display: block; margin-bottom: 0.15rem; }
.step-text span { color: var(--text-muted); font-size: 0.82rem; }

/* Tags */
.tag {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.68rem;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    border: 1px solid;
    margin-left: 0.4rem;
}

.tag.green { border-color: var(--green-dim); color: var(--green); background: rgba(52, 211, 153, 0.08); }
.tag.red { border-color: var(--red-dim); color: var(--red); background: rgba(248, 113, 113, 0.08); }
.tag.amber { border-color: var(--accent-dim); color: var(--amber); background: rgba(251, 191, 36, 0.08); }

/* ═══════════════════════════════════════════════
   AUTH & MODALS
   ═══════════════════════════════════════════════ */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal-overlay.visible {
    display: flex;
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 420px;
    width: 90%;
    animation: fadeUp 0.3s ease;
}

.modal-title {
    font-family: var(--serif);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.modal-desc {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 1.5rem;
}

.modal .btn { width: 100%; margin-bottom: 0.5rem; }

.google-btn {
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-family: var(--sans);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.google-btn:hover {
    border-color: var(--border-hover);
    background: var(--surface3);
}

.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.form-group { margin-bottom: 0.75rem; }

.form-group label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.consent-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    margin: 1rem 0;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.consent-row input[type="checkbox"] {
    margin-top: 0.2rem;
    accent-color: var(--accent);
}

/* Rate limit warning */
.rate-limit-banner {
    display: none;
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid var(--red-dim);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.rate-limit-banner.visible { display: block; }

.rate-limit-banner p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.rate-limit-banner .countdown {
    font-family: var(--mono);
    color: var(--red);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

/* User bar */
.user-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.user-bar .user-email { color: var(--text-secondary); }
.user-bar .plan-badge {
    font-family: var(--mono);
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    background: var(--surface3);
    color: var(--accent);
    border: 1px solid var(--accent-dim);
}

.user-bar button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.78rem;
    font-family: var(--sans);
}

.user-bar button:hover { color: var(--text); }

/* Upsell banner */
.upsell-banner {
    background: linear-gradient(135deg, rgba(245, 166, 35, 0.08), rgba(245, 166, 35, 0.02));
    border: 1px solid var(--accent-dim);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    margin: 1.5rem 0;
}

.upsell-banner h3 {
    font-family: var(--serif);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.upsell-banner p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.upsell-features {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.upsell-features span::before {
    content: '✓ ';
    color: var(--accent);
}

/* CTA */
.cta-bar {
    text-align: center;
    padding: 2rem 0;
    margin-top: 1rem;
}

.cta-bar p {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 0.75rem;
}

.share-row {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.share-btn {
    font-family: var(--mono);
    font-size: 0.72rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

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

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

footer a { color: var(--text-muted); text-decoration: underline; cursor: pointer; }
footer a:hover { color: var(--accent); }

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.5rem;
    font-size: 0.85rem;
    color: var(--text);
    z-index: 200;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--surface3);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 0.4rem;
}

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

.hidden { display: none !important; }

/* Responsive */
@media (max-width: 600px) {
    .app { padding: 1rem 1rem 3rem; }
    .header { padding: 2rem 0; }
    .logo { font-size: 1.8rem; }
    .question-text { font-size: 1.15rem; }
    .question-card { padding: 1.5rem; }
    .header-meta { flex-direction: column; gap: 0.25rem; }
    .breakdown { grid-template-columns: 1fr; }
    .modal { padding: 1.5rem; }
}
