:root {
    --primary-color: #8B2635;
    --secondary-color: #C4A484;
    --accent-color: #7A9B57;
    --text-dark: #2C2C2C;
    --text-light: #666666;
    --background-light: #F8F8F8;
    --white: #FFFFFF;
    --border-color: #E0E0E0;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --gradient-primary: linear-gradient(135deg, #8B2635 0%, #A63446 100%);
    --gradient-secondary: linear-gradient(135deg, #7A9B57 0%, #8BAA68 100%);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-link {
    text-decoration: none;
}

.logo {
    height: 50px;
    width: auto;
}

.logo-tagline {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color);
}

/* Buttons */
.btn {
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    border: 2px solid transparent;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(139, 38, 53, 0.3);
}

.btn-secondary {
    background: var(--gradient-secondary);
    color: var(--white);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(122, 155, 87, 0.3);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--background-light) 0%, var(--white) 100%);
    padding: 80px 0;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-dark);
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Sections */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-dark);
}

.section-text {
    font-size: 1.1rem;
    color: var(--text-light);
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.try-section,
.about-section,
.why-section,
.important-section,
.how-section,
.cta-section {
    padding: 80px 0;
}

.try-section {
    background: var(--background-light);
}

.cta-section {
    background: var(--background-light);
    text-align: center;
}

/* Features Grid - Responsive layout */
.features-grid {
    display: grid;
    gap: 2rem;
    margin-top: 3rem;
    justify-items: center;
}

/* Desktop: 3 columns */
@media (min-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 1000px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Tablet: Handle 3 items in 2 columns with center alignment */
@media (min-width: 768px) and (max-width: 1023px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 700px;
        margin-left: auto;
        margin-right: auto;
    }

    /* Center the third item when there are 3 items */
    .features-grid .feature-item:nth-child(3):nth-last-child(1) {
        grid-column: 1 / -1;
        justify-self: center;
        max-width: 350px;
    }
}

/* Mobile: 1 column */
@media (max-width: 767px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}

.feature-item {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s ease;
    width: 100%;
    max-width: 350px;
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-item h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Cases Grid - Responsive layout */
.cases-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 3rem;
}

/* Mobile: 1 column */
@media (max-width: 767px) {
    .cases-grid {
        margin-top: 2rem;
    }
}

.case-item {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

@media (max-width: 767px) {
    .case-item {
        padding: 1rem;
    }
}

.case-number {
    background: var(--primary-color);
    color: var(--white);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-bottom: 1rem;
}

.case-item p {
    color: var(--text-light);
    line-height: 1.7;
}

/* Steps Grid - Responsive layout */
.steps-grid {
    display: grid;
    gap: 2rem;
    margin-top: 3rem;
    justify-items: center;
}

/* Desktop: 4 columns for steps */
@media (min-width: 1200px) {
    .steps-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 1000px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Large tablet: 2 columns with special handling for 4 items */
@media (min-width: 768px) and (max-width: 1199px) {
    .steps-grid {
        grid-template-columns: repeat(2, 1fr);
        margin-left: auto;
        margin-right: auto;
    }
}

/* Mobile: 1 column */
@media (max-width: 767px) {
    .steps-grid {
        grid-template-columns: 1fr;
    }
}

.step-item {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
    position: relative;
    width: 100%;
}

.step-number {
    background: var(--accent-color);
    color: var(--white);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
}

.step-item h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Chat Styles */
.chat-section {
    padding: 40px 0;
    min-height: calc(100vh - 120px);
}

.chat-header {
    text-align: center;
    margin-bottom: 2rem;
}

.chat-header h1 {
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.chat-header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

.chat-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.chat-messages {
    height: 500px;
    overflow-y: auto;
    padding: 2rem;
    background: var(--background-light);
}

.message {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

.user-message {
    align-items: flex-end;
}

.bot-message {
    align-items: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 1rem 1.5rem;
    border-radius: 18px;
    word-wrap: break-word;
}

.user-message .message-content {
    background: var(--primary-color);
    color: var(--white);
    border-bottom-right-radius: 4px;
}

.bot-message .message-content {
    background: var(--white);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
    white-space: pre-line;
}

.chat-input-container {
    padding: 1.5rem;
    background: var(--white);
    border-top: 1px solid var(--border-color);
}

.chat-input-wrapper {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    position: relative;
}

.chat-input {
    flex: 1;
    padding: 12px 50px 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
    resize: none;
    font-family: inherit;
    line-height: 1.4;
    min-height: 48px;
}

.chat-input:focus {
    border-color: var(--primary-color);
}

.send-btn {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.send-btn:hover {
    background: #6B1E2A;
    transform: scale(1.05);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 1rem 1.5rem;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    max-width: 70%;
    margin-bottom: 1.5rem;
}

.typing-text {
    color: var(--text-light);
    font-style: italic;
}

.typing-animation {
    display: flex;
    gap: 2px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.pencil-animation {
    width: 20px;
    height: 20px;
    animation: pencilMove 2s infinite linear;
}

@keyframes pencilMove {
    0% { transform: translateX(-10px) rotate(-15deg); }
    50% { transform: translateX(10px) rotate(15deg); }
    100% { transform: translateX(-10px) rotate(-15deg); }
}

/* Request Button in Bot Message */
.request-btn {
    background: var(--gradient-primary);
    color: var(--white);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.request-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 38, 53, 0.3);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background-color: var(--white);
    margin: 10% auto;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: slideIn 0.3s ease;
}

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

/* Success Modal Styles */
.success-modal {
    text-align: center;
    max-width: 400px;
}

.success-icon {
    margin: 0 auto 1.5rem;
    animation: successPulse 0.6s ease;
}

@keyframes successPulse {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-modal h2 {
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.success-modal p {
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.close {
    color: var(--text-light);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 1rem;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--text-dark);
}

.modal h2 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.modal p {
    margin-bottom: 2rem;
    color: var(--text-light);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Consent checkbox */
.consent-group {
    margin-top: 0.5rem;
}

.consent-group .consent-label {
    display: flex;
}

.consent-label {
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--text-light);
    user-select: none;
    cursor: pointer;
}

.consent-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
    appearance: none;
    position: relative;
}

.consent-label input[type="checkbox"]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 640'%3E%3Cpath d='M530.8 134.1C545.1 144.5 548.3 164.5 537.9 178.8L281.9 530.8C276.4 538.4 267.9 543.1 258.5 543.9C249.1 544.7 240 541.2 233.4 534.6L105.4 406.6C92.9 394.1 92.9 373.8 105.4 361.3C117.9 348.8 138.2 348.8 150.7 361.3L252.2 462.8L486.2 141.1C496.6 126.8 516.6 123.6 530.9 134z' fill='white' /%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    display: none;
}

.consent-label input[type="checkbox"]:checked {
    background-color: var(--primary-color);
}

.consent-label input[type="checkbox"]:checked::before {
    display: block;
}

.consent-label a {
    color: var(--primary-color);
    text-decoration: underline;
}

.consent-label.error span {
    color: #c0392b;
}

/* Footer */
.footer {
    background: var(--white);
    color: var(--text-dark);
    padding: 3rem 0 2rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-logo {
    height: 40px;
    width: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .nav {
        display: none;
    }

    .message-content {
        max-width: 85%;
    }

    .chat-input-wrapper {
        flex-direction: column;
        gap: 0;
    }

    .chat-input {
        width: 100%;
        padding: 12px 16px;
        margin-bottom: 1rem;
    }

    .send-btn {
        position: relative;
        right: auto;
        bottom: auto;
        align-self: flex-end;
        width: auto;
        height: auto;
        padding: 12px 24px;
    }

    .modal-content {
        margin: 20% auto;
        padding: 1.5rem;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message {
    animation: fadeInUp 0.3s ease;
}

/* Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--background-light);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* Inline Success/Error Messages */
.success-message-inline,
.error-message-inline {
    text-align: center;
    padding: 2rem 1rem;
    animation: fadeInScale 0.4s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.success-icon-inline,
.error-icon-inline {
    margin: 0 auto 1rem;
    animation: successPulse 0.6s ease;
}

.success-message-inline h3 {
    color: var(--accent-color);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.error-message-inline h3 {
    color: #e74c3c;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.success-message-inline p,
.error-message-inline p {
    color: var(--text-light);
    line-height: 1.6;
}