/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #000000;
    --accent: #FFCD00;
    --secondary: #6DA6B9;
    --bg: #FEF9E4;
    --surface: #FFFFFF;
    --dark: #001023;
    --subtle: #F4F7F9;
    --text: #1a1a1a;
    --text-light: #666;
    --radius: 16px;
    --radius-sm: 12px;
    --shadow: 0 2px 15px rgba(0,0,0,.08);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html, body {
    height: 100%;
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

/* ── Header ── */
.header {
    background: var(--dark);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.logo { height: 24px; width: auto; }

.header-title {
    color: rgba(255,255,255,.6);
    font-size: 14px;
    font-weight: 500;
}

/* ── Screens ── */
.screen {
    display: none;
    min-height: 100vh;
    padding-top: 56px;
}
.screen.active { display: flex; }

/* ── Start screen ── */
#start-screen {
    align-items: center;
    justify-content: center;
    padding: 80px 24px 40px;
}

.start-container {
    max-width: 560px;
    width: 100%;
}

.cornel-card {
    display: flex;
    gap: 20px;
    align-items: center;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 32px;
}

.cornel-photo img,
.cornel-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.cornel-placeholder {
    background: var(--secondary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}

.cornel-quote p {
    font-size: 16px;
    font-style: italic;
    color: var(--text);
    margin-bottom: 6px;
}

.cornel-name {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
}

.start-info h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--primary);
}

.start-info p {
    color: var(--text-light);
    margin-bottom: 24px;
    font-size: 15px;
    line-height: 1.6;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    transition: transform .15s, box-shadow .15s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
}

.btn-primary:active { transform: translateY(0); }

/* ── Chat screen ── */
#chat-screen {
    flex-direction: column;
}

.chat-container {
    display: flex;
    flex-direction: column;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    height: calc(100vh - 56px);
    padding: 0;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

/* Message bubbles */
.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    line-height: 1.5;
    animation: fadeIn .3s ease;
    word-wrap: break-word;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.assistant {
    align-self: flex-start;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
    border-bottom-left-radius: 4px;
}

.message.user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Typing indicator */
.typing-indicator {
    align-self: flex-start;
    display: flex;
    gap: 4px;
    padding: 16px 20px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: bounce .6s infinite alternate;
}

.typing-indicator span:nth-child(2) { animation-delay: .2s; }
.typing-indicator span:nth-child(3) { animation-delay: .4s; }

@keyframes bounce {
    from { transform: translateY(0); opacity: .4; }
    to { transform: translateY(-6px); opacity: 1; }
}

/* Input bar */
.input-bar {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: var(--surface);
    border-top: 1px solid rgba(0,0,0,.06);
}

#user-input {
    flex: 1;
    border: 1px solid rgba(0,0,0,.1);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 16px;
    font-family: var(--font);
    resize: none;
    outline: none;
    max-height: 120px;
    line-height: 1.4;
    transition: border-color .2s;
}

#user-input:focus { border-color: var(--accent); }

#send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform .15s, opacity .15s;
}

#send-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

#send-btn:not(:disabled):hover { transform: scale(1.05); }

/* ── Thank you screen ── */
#thank-screen {
    align-items: center;
    justify-content: center;
    padding: 80px 24px 40px;
    text-align: center;
}

.thank-container {
    max-width: 480px;
}

.thank-icon {
    margin-bottom: 24px;
}

.thank-container h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--primary);
}

.thank-container p {
    color: var(--text-light);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.thank-sub {
    font-weight: 600;
    color: var(--text) !important;
    margin-top: 24px !important;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .cornel-card {
        flex-direction: column;
        text-align: center;
    }

    .message { max-width: 90%; }

    .start-container { padding: 0 8px; }

    .start-info h2 { font-size: 20px; }
}

/* ── Scrollbar ── */
.messages::-webkit-scrollbar { width: 6px; }
.messages::-webkit-scrollbar-track { background: transparent; }
.messages::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,.15);
    border-radius: 3px;
}
