/* ============================================================
   Reset & base
   ============================================================ */

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

:root {
    --green-dark:   #1e4620;
    --green:        #2c5f2d;
    --green-mid:    #3a7d3c;
    --green-light:  #e8f5e9;
    --green-pale:   #f1f8f1;
    --text:         #1a1a1a;
    --text-muted:   #555;
    --border:       #d8e8d8;
    --bg:           #f7f9f7;
    --white:        #ffffff;
    --warning-bg:   #fff8e1;
    --warning-text: #795b00;
    --warning-border: #f0c040;
    --danger:       #c62828;
    --danger-bg:    #ffebee;
}

html, body {
    height: 100%;
}

/* Chat page: no scrollbar — widget fills exactly */
html:not(.scrollable), html:not(.scrollable) body {
    overflow: hidden;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--green);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ============================================================
   Site nav
   ============================================================ */

.site-nav {
    background: var(--green);
    padding: 0 24px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.nav-brand {
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.2px;
    text-decoration: none;
}

.nav-brand:hover {
    text-decoration: none;
    opacity: 0.9;
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-links a {
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active {
    color: #fff;
    text-decoration: none;
}

/* ============================================================
   Site footer
   ============================================================ */

.site-footer {
    background: var(--green-dark);
    color: rgba(255,255,255,0.6);
    font-size: 12px;
    text-align: center;
    padding: 16px 24px;
    width: 100%;
}

.site-footer a {
    color: rgba(255,255,255,0.8);
}

.footer-privacy {
    margin-top: 4px;
    font-size: 11px;
    opacity: 0.5;
}

/* ============================================================
   Chat page layout
   ============================================================ */

.chat-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    overflow: hidden;
}

/* The chat widget */
#app {
    width: 100%;
    max-width: 900px;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    overflow: hidden;
    min-height: 0;
}

#app-header {
    padding: 10px 16px;
    background: var(--green);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 40px;
}

.phase {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.15);
    padding: 3px 10px;
    border-radius: 10px;
}

/* Disclaimer banner */
#disclaimer {
    padding: 10px 16px;
    background: var(--warning-bg);
    color: var(--warning-text);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    border-bottom: 1px solid var(--warning-border);
}

/* Chat container */
#chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Message bubbles */
.message {
    max-width: 85%;
    padding: 9px 13px;
    border-radius: 16px;
    line-height: 1.5;
    font-size: 14px;
    word-wrap: break-word;
    animation: fadeIn 0.2s ease;
}

.message.agent {
    background: var(--green-light);
    color: var(--green-dark);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message.user {
    background: var(--green);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

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

/* Typing indicator */
#typing-indicator {
    display: flex;
    gap: 4px;
    padding: 9px 13px;
    align-self: flex-start;
}

#typing-indicator .dot {
    width: 7px;
    height: 7px;
    background: #bbb;
    border-radius: 50%;
    animation: bounce 1.2s infinite;
}

#typing-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
#typing-indicator .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30%            { transform: translateY(-5px); }
}

.hidden {
    display: none !important;
}

/* Emergency block */
#emergency-block {
    padding: 24px 16px;
    background: var(--danger-bg);
    color: var(--danger);
    text-align: center;
    border-top: 2px solid var(--danger);
}

#emergency-block h2 {
    margin-bottom: 12px;
    font-size: 18px;
}

#emergency-block p {
    margin: 6px 0;
    font-size: 15px;
}

#emergency-block a {
    color: var(--danger);
    font-weight: 700;
    text-decoration: underline;
}

/* Denied block */
#denied-block {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.7;
}

#denied-block a {
    color: var(--green);
    font-weight: 600;
    white-space: nowrap;
}

/* Input form */
#input-form {
    display: flex;
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    background: #fafafa;
    gap: 8px;
}

#user-input {
    flex: 1;
    padding: 9px 14px;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    background: var(--white);
    transition: border-color 0.15s;
}

#user-input:focus {
    border-color: var(--green-mid);
}

#send-btn {
    padding: 9px 20px;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

#send-btn:hover {
    background: var(--green-dark);
}

#send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ============================================================
   About page
   ============================================================ */

.about-page {
    max-width: 820px;
    margin: 0 auto;
    padding: 48px 24px 64px;
    width: 100%;
}

.about-hero {
    margin-bottom: 48px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 36px;
}

.about-hero h1 {
    font-size: 30px;
    font-weight: 700;
    color: var(--green-dark);
    letter-spacing: -0.4px;
    margin-bottom: 12px;
}

.about-hero p {
    font-size: 16px;
    color: var(--text-muted);
    max-width: 640px;
    line-height: 1.65;
}

.about-section {
    margin-bottom: 52px;
}

.about-section h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--green-dark);
    margin-bottom: 20px;
    letter-spacing: -0.2px;
}

.about-section p {
    font-size: 15px;
    color: #333;
    line-height: 1.7;
    margin-bottom: 14px;
}

.about-section p:last-child {
    margin-bottom: 0;
}

/* Two-column layout */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.col-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
}

.col-card h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--green-dark);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-size: 12px;
}

.col-card p {
    font-size: 14px;
    color: #444;
    line-height: 1.65;
    margin-bottom: 12px;
}

.col-card p:last-child {
    margin-bottom: 0;
}

/* Phase list inside col-card */
.phase-list {
    margin: 12px 0 12px 18px;
    font-size: 14px;
    color: #444;
    line-height: 1.7;
}

.phase-list li {
    margin-bottom: 4px;
}

/* Pipeline */
.pipeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.pipeline-step {
    display: flex;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--white);
    align-items: flex-start;
}

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

.pipeline-step:nth-child(even) {
    background: var(--green-pale);
}

.step-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: var(--green);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    margin-top: 1px;
}

.pipeline-step strong {
    display: block;
    font-size: 14px;
    color: var(--green-dark);
    margin-bottom: 4px;
}

.pipeline-step p {
    font-size: 14px;
    color: #444;
    margin: 0;
    line-height: 1.6;
}

/* Limits section */
.about-limits {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
}

.limits-hero {
    display: flex;
    gap: 32px;
    align-items: center;
    margin-bottom: 28px;
}

.limits-mascot {
    width: 240px;
    flex-shrink: 0;
    border-radius: 12px;
}

.limits-text h2 {
    margin-bottom: 12px;
}

.limits-text p {
    margin-bottom: 16px;
}

.limits-text p:last-child {
    margin-bottom: 0;
}

.limits-stripe {
    border-top: 1px solid var(--border);
    padding-top: 24px;
    display: flex;
    justify-content: center;
}

@media (max-width: 640px) {
    .limits-hero {
        flex-direction: column;
    }

    .limits-mascot {
        width: 140px;
        align-self: center;
    }
}

.limits-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.limit-card {
    text-align: center;
    background: var(--green-pale);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.limit-num {
    font-size: 36px;
    font-weight: 800;
    color: var(--green);
    line-height: 1;
}

.limit-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* About disclaimer section */
.about-disclaimer {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    border-left: 4px solid #e6a800;
    border-radius: 10px;
    padding: 28px;
    margin-bottom: 52px;
}

.about-disclaimer h2 {
    font-size: 20px;
    font-weight: 700;
    color: #5a3e00;
    margin-bottom: 16px;
    letter-spacing: -0.2px;
}

.about-disclaimer p {
    font-size: 14px;
    color: #5a3e00;
    line-height: 1.7;
    margin-bottom: 12px;
}

.about-disclaimer p:last-child {
    margin-bottom: 0;
}

.about-disclaimer a {
    color: #5a3e00;
    font-weight: 600;
    text-decoration: underline;
}

/* CTA */
.about-cta {
    text-align: center;
    margin-top: 48px;
}

.cta-btn {
    display: inline-block;
    background: var(--green);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 32px;
    border-radius: 24px;
    text-decoration: none;
    transition: background 0.15s;
}

.cta-btn:hover {
    background: var(--green-dark);
    text-decoration: none;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 640px) {
    .chat-intro h1 {
        font-size: 21px;
    }

    #app {
        border-radius: 8px;
        max-height: none;
        min-height: 400px;
    }

    .two-col {
        grid-template-columns: 1fr;
    }

    .limits-grid {
        grid-template-columns: 1fr;
    }

    .about-page {
        padding: 32px 16px 48px;
    }

    .about-hero h1 {
        font-size: 24px;
    }
}
