:root {
    --step-color: #333;
    --card-radius: 16px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
}

/* Welcome screen — the base page (scrollable) */
#welcome-screen {
    background: linear-gradient(150deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.welcome-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 12vh 1.5rem 4rem;
    gap: 1.2rem;
}

.welcome-logo {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
}

.welcome-title {
    font-size: clamp(2rem, 8vw, 3rem);
    font-weight: 800;
    color: #fff;
    margin: 0;
    line-height: 1.15;
}

.welcome-subtitle {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.65);
    margin: 0;
    line-height: 1.6;
    max-width: 360px;
}

/* Scroll hint arrow */
.welcome-hero::after {
    content: '↓';
    font-size: 1.4rem;
    color: rgba(255,255,255,0.3);
    margin-top: 2rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(6px); }
}

/* Feature cards section */
.welcome-features {
    display: flex;
    flex-direction: column;
    gap: 1px;
    max-width: 560px;
    margin: 0 auto;
    padding: 0 1.2rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.feature-card {
    display: flex;
    align-items: flex-start;
    gap: 1.1rem;
    padding: 1.4rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.feature-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
    width: 2.4rem;
    text-align: center;
    padding-top: 0.1rem;
}

.feature-text h3 {
    margin: 0 0 0.3rem;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.feature-text p {
    margin: 0;
    font-size: 0.92rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.55;
}

/* AI prompts section */
.ai-section-intro {
    grid-column: 1 / -1;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-muted, #888);
    text-align: center;
    margin: 0 0 0.25rem;
}

.welcome-ai {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem 2.5rem;
    max-width: 660px;
    margin: 0 auto;
    padding: 2.5rem 1.2rem 0;
}

@media (max-width: 540px) {
    .welcome-ai {
        grid-template-columns: 1fr;
    }
}

.ai-col-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    margin-bottom: 0.9rem;
}

.ai-prompts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ai-prompt {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.75);
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    line-height: 1.4;
    font-style: italic;
}

/* Early stage footer */
.welcome-footer {
    max-width: 560px;
    margin: 2.5rem auto 0;
    padding: 2rem 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.7rem;
}

.welcome-footer-badge {
    display: inline-block;
    padding: 0.25rem 0.8rem;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.7);
}

.welcome-footer-text {
    margin: 0;
    font-size: 0.95rem;
    color: rgba(255,255,255,0.75);
    line-height: 1.6;
}

.welcome-footer-text strong {
    color: #fff;
}

.welcome-footer-note {
    margin: 0;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.35);
    line-height: 1.5;
}

/* Fixed CTA button */
.btn-welcome {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 3rem);
    max-width: 320px;
    min-height: 56px;
    padding: 0 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a2e;
    background: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
    z-index: 50;
    white-space: nowrap;
}

.btn-welcome:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}

.btn-welcome:active {
    transform: translateX(-50%) scale(0.97);
}

/* Wizard overlay — sits on top of the welcome screen */
#wizard-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 100;
    animation: fadeIn 0.2s ease;
}

#wizard-overlay.visible {
    display: flex;
}

.onboarding-card {
    background: white;
    border-radius: var(--card-radius);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    width: 100%;
    max-width: 520px;
    padding: 2.5rem;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.25s ease;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Progress dots */
.step-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ddd;
    transition: background 0.3s, transform 0.3s;
}

.dot.active {
    background: var(--step-color);
    transform: scale(1.3);
}

.dot.done {
    background: #aaa;
}

/* Step content */
.step {
    display: none;
    flex-direction: column;
    gap: 1.2rem;
}

.step.visible {
    display: flex;
}

.step h1 {
    font-size: 1.8rem;
    margin: 0;
    color: #222;
}

.step h2 {
    font-size: 1.4rem;
    margin: 0;
    color: #222;
}

.step p {
    color: #555;
    margin: 0;
    line-height: 1.6;
}

.step label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.3rem;
}

.step input[type="text"] {
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: 1.1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
}

.step input[type="text"]:focus {
    border-color: var(--step-color);
}

/* Language selector */
.language-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.lang-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s;
    color: #333;
}

.lang-btn:hover {
    border-color: #aaa;
}

.lang-btn.selected {
    background: var(--step-color);
    color: white;
    border-color: var(--step-color);
}

.lang-btn.locked {
    opacity: 0.6;
    cursor: default;
}

/* Color preset swatches */
.color-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
}

.color-swatch {
    border: 3px solid transparent;
    border-radius: 10px;
    padding: 0.6rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    transition: border-color 0.2s, transform 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.color-swatch:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.color-swatch.selected {
    border-color: #333;
}

/* Currency selector */
.currency-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.currency-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.currency-btn:hover {
    border-color: #aaa;
}

.currency-btn.selected {
    background: var(--step-color);
    color: white;
    border-color: var(--step-color);
}

.currency-btn .currency-symbol {
    opacity: 0.75;
    font-size: 0.8rem;
}

.swatch-preview {
    width: 100%;
    height: 36px;
    border-radius: 6px;
}

.swatch-label {
    font-size: 0.8rem;
    color: #555;
    font-weight: 600;
    text-transform: capitalize;
}

/* Summary */
.summary-list {
    background: #f8f8f8;
    border-radius: 8px;
    padding: 1rem 1.2rem;
    list-style: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.summary-list li {
    color: #333;
    font-size: 0.95rem;
}

.summary-list li span {
    font-weight: 700;
}

/* Navigation buttons */
.step-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    gap: 1rem;
}

.btn {
    padding: 0.8rem 1.6rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--step-color);
    color: white;
    flex: 1;
}

.btn-secondary {
    background: #eee;
    color: #333;
}

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

/* Spinner / loading */
.spinner-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #eee;
    border-left-color: var(--step-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Phase 2 chat panel */
#phase2 {
    display: none;
    flex-direction: column;
    gap: 0;
    height: 480px;
}

#phase2.visible {
    display: flex;
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.chat-message {
    max-width: 85%;
    padding: 0.7rem 1rem;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-message.user {
    align-self: flex-end;
    background: var(--step-color);
    color: white;
    border-bottom-right-radius: 3px;
}

.chat-message.ai {
    align-self: flex-start;
    background: #f0f0f0;
    color: #222;
    border-bottom-left-radius: 3px;
}

.chat-message.system {
    align-self: center;
    background: #fffbe6;
    color: #7a6000;
    font-size: 0.85rem;
    border-radius: 8px;
}

.chat-message.error {
    align-self: flex-start;
    background: #fee;
    color: #c00;
    border-bottom-left-radius: 3px;
}

#chat-thinking {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: #888;
    font-style: italic;
}

#chat-thinking.hidden {
    display: none;
}

#chat-input-row {
    display: flex;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    border-top: 1px solid #eee;
}

#chat-input {
    flex: 1;
    padding: 0.6rem 0.9rem;
    font-size: 0.95rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    resize: none;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

#chat-input:focus {
    border-color: var(--step-color);
}

#chat-send {
    padding: 0.6rem 1.1rem;
    background: var(--step-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

#chat-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#chat-phase2-header {
    padding: 0.8rem 1rem 0;
    color: #555;
    font-size: 0.9rem;
}

.welcome-footer-dev {
    margin-top: 1rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
}

.welcome-footer-dev a {
    color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
}

.welcome-footer-dev a:hover {
    color: rgba(255, 255, 255, 0.75);
}

/* Language switcher */
#ob-lang-switcher {
    position: fixed;
    top: 0.8rem;
    right: 0.8rem;
    display: flex;
    gap: 2px;
    z-index: 200;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 3px;
}

.ob-lang-btn {
    padding: 0.25rem 0.45rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
}

.ob-lang-btn:hover {
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.12);
}

.ob-lang-btn.active {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}
