:root {
    --bg: #fafaf9;
    --surface: #ffffff;
    --text: #18181b;
    --text-muted: #71717a;
    --border: #e4e4e7;
    --accent: #18181b;
    --accent-hover: #27272a;
    --error: #dc2626;
    --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 30px -10px rgba(0,0,0,0.1);
}

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

html, body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 4rem 1.5rem 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hero {
    text-align: center;
    margin-bottom: 2.5rem;
}

.hero h1 {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
}

.decision-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: var(--shadow);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.decision-form:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(24,24,27,0.08);
}

#decision-input {
    width: 100%;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 1.05rem;
    color: var(--text);
    background: transparent;
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

#decision-input::placeholder {
    color: var(--text-muted);
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.char-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

button {
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background 0.15s, transform 0.1s;
}

#submit-btn {
    background: var(--accent);
    color: white;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
}

#submit-btn:hover:not(:disabled) {
    background: var(--accent-hover);
}

#submit-btn:active:not(:disabled) {
    transform: scale(0.98);
}

#submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.loading {
    margin-top: 3rem;
    text-align: center;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 0.8s linear infinite;
}

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

#loading-message {
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: opacity 0.3s;
}

.results {
    margin-top: 2.5rem;
    animation: fadeIn 0.4s ease;
}

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

.results-heading {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    text-align: center;
}

.questions-list {
    list-style: none;
    counter-reset: q;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.question-card {
    counter-increment: q;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow);
    position: relative;
    transition: transform 0.15s, box-shadow 0.15s;
    animation: slideIn 0.4s ease backwards;
}

.question-card:nth-child(1) { animation-delay: 0.05s; }
.question-card:nth-child(2) { animation-delay: 0.12s; }
.question-card:nth-child(3) { animation-delay: 0.19s; }
.question-card:nth-child(4) { animation-delay: 0.26s; }
.question-card:nth-child(5) { animation-delay: 0.33s; }

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

.question-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.question-card::before {
    content: counter(q);
    position: absolute;
    top: 1.25rem;
    left: -2.25rem;
    width: 1.75rem;
    height: 1.75rem;
    line-height: 1.75rem;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

@media (max-width: 600px) {
    .question-card::before {
        position: static;
        display: inline-block;
        margin-right: 0.5rem;
    }
}

.question-text {
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--text);
    font-weight: 500;
}

.question-meta {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.question-meta strong {
    color: var(--text);
    font-weight: 500;
}

.reset-btn {
    margin: 2rem auto 0;
    display: block;
    background: transparent;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.reset-btn:hover {
    color: var(--text);
    border-color: var(--text);
}

.error {
    margin-top: 2rem;
    padding: 1rem 1.25rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: var(--error);
    text-align: center;
}

.error #error-message {
    margin-bottom: 0.75rem;
}

.footer {
    margin-top: auto;
    padding-top: 3rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.hidden { display: none !important; }
