/* ==========================================================================
   CSS VARIABLES & DESIGN SYSTEM
   ========================================================================== */
   :root {
    /* Color Palette */
    --bg-primary: #FAF8F5; /* Trắng ngà / Off-white */
    --bg-secondary: #EBE3D5; /* Kem ấm / Beige */
    --accent-sage: #A3B18A; /* Xanh xô thơm nhẹ nhàng */
    --text-main: #3E362E; /* Nâu gỗ tối / Walnut */
    --text-highlight: #C28462; /* Cam đất / Terracotta */
    --text-light: #7A6F66; /* Nâu mềm cho phụ đề */
    --white: #FFFFFF;

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Montserrat', sans-serif;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-s: 1rem;
    --space-m: 2rem;
    --space-l: 4rem;
    --space-xl: 6rem;
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-body);
    color: var(--text-main);
    background-color: var(--bg-primary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--space-s);
    color: var(--text-main);
}

p {
    margin-bottom: var(--space-m);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-m);
}

.text-center { text-align: center; }
.mb-l { margin-bottom: var(--space-l); }
.mt-s { margin-top: var(--space-s); }
.mt-m { margin-top: var(--space-m); }
.mt-l { margin-top: var(--space-l); }

.bg-secondary { background-color: var(--bg-secondary); }
.bg-sage { background-color: var(--accent-sage); }
.bg-white { background-color: var(--white); }
.bg-terracotta { background-color: var(--text-highlight); }
.rounded { border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(62, 54, 46, 0.05); }

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--accent-sage);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(163, 177, 138, 0.4);
}

.btn-primary:hover {
    background-color: #8C9877;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(163, 177, 138, 0.6);
}

/* ==========================================================================
   SECTIONS
   ========================================================================== */
.section-spacing {
    padding: var(--space-xl) 0;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: var(--space-m);
}

@media (max-width: 768px) {
    .section-title { font-size: 1.8rem; line-height: 1.25;}
    .section-spacing { padding: var(--space-l) 0; }
}

/* HERO SECTION */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--space-l);
    background-color: var(--bg-primary);
}

.hero-container {
    display: flex;
    align-items: center;
    gap: var(--space-l);
}

.hero-content {
    flex: 1.1;
    padding-right: var(--space-l);
}

.jamte-logo {
    font-size: 0.85rem;
    letter-spacing: 2px;
    color: var(--text-highlight);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: var(--space-m);
}

.hero-title {
    font-size: 2.3rem;
    line-height: 1.25;
}

.hero-subtitle {
    font-size: 0.95rem;
    opacity: 0.85;
    margin-bottom: var(--space-l);
}

.hero-note {
    font-size: 0.85rem;
    font-style: italic;
    opacity: 0.7;
    margin-top: var(--space-s);
}

.hero-image-wrapper {
    flex: 0.9;
    border-radius: 12px 12px 50% 12px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(62, 54, 46, 0.08);
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02); /* Slight scale to hide edges */
}

@media (max-width: 900px) {
    .hero { min-height: auto; padding-bottom: var(--space-l); }
    .hero-container {
        flex-direction: column-reverse;
        text-align: center;
        gap: var(--space-m);
    }
    .hero-content { padding-right: 0; }
    .hero-title { font-size: 1.75rem; line-height: 1.3; margin-top: var(--space-m); }
    .hero-subtitle { font-size: 0.9rem; margin-bottom: var(--space-m); }
    .hero-image-wrapper { flex: none; width: 100%; border-radius: 12px; }
}

/* EMPATHY SECTION */
.empathy-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-l);
    margin-top: var(--space-l);
}

.empathy-card {
    background-color: var(--white);
    padding: var(--space-l);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(62, 54, 46, 0.03);
    border-top: 3px solid var(--accent-sage);
    transition: transform 0.3s ease;
}

.empathy-card:hover {
    transform: translateY(-5px);
}

.empathy-card .icon {
    font-size: 2rem;
    display: block;
    margin-bottom: var(--space-s);
    color: var(--text-highlight);
}

.empathy-card h3 {
    font-size: 1.3rem;
}

.empathy-card p {
    font-size: 0.95rem;
    opacity: 0.8;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .empathy-grid { grid-template-columns: 1fr; }
}

/* STORY SECTION */
.story-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: var(--space-xl);
    align-items: center;
}

.story-image {
    position: relative;
}

.story-img {
    border-radius: 8px;
    box-shadow: 0 15px 35px rgba(62, 54, 46, 0.1);
}

.story-highlight {
    background-color: var(--white);
    padding: var(--space-m);
    border-left: 4px solid var(--text-highlight);
    border-radius: 0 8px 8px 0;
    margin: var(--space-m) 0;
    box-shadow: 0 4px 15px rgba(62, 54, 46, 0.04);
}

.story-highlight p {
    font-size: 0.95rem;
}

.manifesto {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-style: italic;
    color: var(--text-highlight);
    text-align: center;
    margin-top: var(--space-l);
    padding: 0;
}

@media (max-width: 900px) {
    .story-grid { grid-template-columns: 1fr; gap: var(--space-m); }
    .manifesto { font-size: 1.25rem; font-weight: 500; line-height: 1.5; padding: 0 var(--space-s); }
}

/* SOLUTION SECTION */
.zigzag-layout {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.zigzag-row {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.zigzag-row.reverse {
    flex-direction: row-reverse;
}

.zigzag-img, .zigzag-text {
    flex: 1;
}

.zigzag-text {
    padding: 0 var(--space-m);
}

.step-number {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 3rem;
    color: var(--text-highlight);
    opacity: 0.3;
    line-height: 1;
    margin-bottom: var(--space-xs);
}

.full-img { width: 100%; display: block; object-fit: cover;}

.img-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
}

@media (max-width: 768px) {
    .zigzag-row, .zigzag-row.reverse { 
        flex-direction: column; 
        gap: var(--space-m);
    }
    .zigzag-text { padding: 0; text-align: center; }
}

/* CTA SECTION */
.cta-section {
    position: relative;
    padding: 0; /* Override */
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cta-background {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
}

.cta-bg-img {
    width: 100%; height: 100%; object-fit: cover;
}

.cta-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(250, 248, 245, 0.75); /* Off-white overlay for readable text */
    backdrop-filter: blur(5px);
}

.cta-content {
    position: relative;
    z-index: 2;
    background-color: var(--white);
    padding: var(--space-xl) var(--space-m);
    max-width: 800px;
    width: 90%;
    margin: 0 auto;
    text-align: center;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(62, 54, 46, 0.1);
}

.cta-note {
    background-color: var(--bg-primary);
    padding: var(--space-s) var(--space-m);
    border: 1px dashed var(--accent-sage);
    border-radius: 8px;
    font-size: 0.9rem;
    opacity: 0.9;
    text-align: left;
}

/* SURVEY FORM SECTION */
.survey-wrapper {
    background-color: var(--white);
    padding: var(--space-l);
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(62, 54, 46, 0.05);
    max-width: 800px;
    margin: 0 auto;
    border-top: 4px solid var(--accent-sage);
}
.custom-form {
    text-align: left;
}
.custom-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}
.form-row {
    display: flex;
    gap: var(--space-s);
}
.form-row input {
    flex: 1;
}
.custom-form input[type="text"],
.custom-form input[type="tel"],
.custom-form textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid rgba(62, 54, 46, 0.2);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    background-color: var(--bg-primary);
    transition: all 0.3s ease;
}
.custom-form input:focus,
.custom-form textarea:focus {
    outline: none;
    border-color: var(--accent-sage);
    box-shadow: 0 0 0 3px rgba(163, 177, 138, 0.2);
}
.custom-form textarea {
    resize: vertical;
    min-height: 100px;
}
.radio-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}
.radio-group.vertical {
    flex-direction: column;
    gap: 0.8rem;
}
.radio-label {
    display: flex !important;
    align-items: center;
    font-weight: 400 !important;
    cursor: pointer;
    font-size: 0.95rem;
}
.radio-label input[type="radio"] {
    margin-right: 10px;
    width: 1.2rem;
    height: 1.2rem;
    accent-color: var(--accent-sage);
    cursor: pointer;
}
.inline-input {
    flex: 1;
    margin-left: 10px;
    padding: 0.4rem 0.6rem !important;
}

@media (max-width: 768px) {
    .survey-wrapper { padding: var(--space-m); }
    .form-row { flex-direction: column; }
    .inline-input { display: block; margin-left: 0; margin-top: 10px; width: 100% !important; }
}

/* RESPONSIVE TEXT WRAPPING */
@media (min-width: 900px) {
    .no-wrap-desktop {
        white-space: nowrap;
    }
}

@media (max-width: 899px) {
    .no-wrap-desktop {
        white-space: normal !important;
        display: block;
    }
    br {
        display: none; /* Ẩn bớt dấu ngắt dòng cố định trên Mobile để chữ trôi tự nhiên */
    }
    .hero-title br, .manifesto br {
        display: block; /* Giữ lại ngắt dòng ở những chỗ quan trọng */
    }
}

/* FOOTER */
.footer {
    background-color: var(--text-main);
    color: var(--white);
    padding: var(--space-m) 0;
    font-size: 0.85rem;
    opacity: 0.8;
}

/* ==========================================================================
   CHATBOT STYLES
   ========================================================================== */
.chatbot-wrapper {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: var(--font-body);
    --bot-theme: #0F766E; /* Xanh cổ vịt */
    --bot-theme-rgb: 15, 118, 110;
}

.chatbot-toggler {
    width: 60px;
    height: 60px;
    background-color: var(--bot-theme);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(var(--bot-theme-rgb), 0.4);
    transition: transform 0.3s ease;
}

.chatbot-toggler:hover {
    transform: scale(1.1);
}

.chatbot-toggler .icon {
    font-size: 1.8rem;
}

.chatbot-window {
    width: 350px;
    height: 500px;
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(62, 54, 46, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.5);
    opacity: 0;
    pointer-events: none;
    transform-origin: bottom right;
    transition: all 0.3s ease;
    border: 1px solid rgba(var(--bot-theme-rgb), 0.2);
}

.chatbot-window.active {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
}

.chatbot-header {
    background-color: var(--bot-theme);
    color: var(--white);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 1rem;
    font-family: var(--font-heading);
    color: var(--white);
}

.close-btn {
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.chatbot-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: var(--bg-primary);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-msg {
    max-width: 85%;
    padding: 10px 15px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.chat-msg.bot {
    background-color: var(--white);
    color: var(--text-main);
    align-self: flex-start;
    border-bottom-left-radius: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.chat-msg.user {
    background-color: var(--text-highlight);
    color: var(--white);
    align-self: flex-end;
    border-bottom-right-radius: 0;
}

.chatbot-input-area {
    padding: 15px;
    background-color: var(--white);
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 10px;
}

#chat-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 20px;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

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

#chat-send-btn {
    background-color: var(--bot-theme);
    color: var(--white);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

#chat-send-btn:hover {
    transform: scale(1.05);
}

.chatbot-btn-link {
    display: inline-block;
    padding: 8px 15px;
    background-color: var(--bot-theme);
    color: var(--white);
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(var(--bot-theme-rgb), 0.3);
}

.chatbot-btn-link.secondary {
    background-color: var(--text-main);
}

@media (max-width: 400px) {
    .chatbot-window {
        width: calc(100vw - 40px);
        right: 20px;
        bottom: 20px;
    }
}
