/* =========================================
   БАЗОВІ НАЛАШТУВАННЯ ТА ЗМІННІ
========================================= */
:root {
    --primary-color: #6e8efb;
    --secondary-color: #a777e3;
    --accent-color: #ff4757;
    --accent-hover: #ff6b81;
    --text-color: #2d3436;
    --text-light: #636e72;
    --bg-light: #f4f7f6;
    --white: #ffffff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --border-radius: 16px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    background-color: var(--white);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================
   ШАПКА (HEADER)
========================================= */
.header {
    background-color: var(--white);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    cursor: pointer;
}

.nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    margin: 0 15px;
    transition: var(--transition);
}

.nav a:hover {
    color: var(--primary-color);
}

.btn-login-header {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-login-header:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* =========================================
   ГОЛОВНИЙ ЕКРАН (HERO)
========================================= */
.hero {
    background: linear-gradient(135deg, rgba(110, 142, 251, 0.95), rgba(167, 119, 227, 0.95)), 
                url('https://images.unsplash.com/photo-1492684223066-81342ee5ff30?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') center/cover;
    padding: 140px 0;
    text-align: center;
    color: var(--white);
}

.hero-content {
    max-width: 800px;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 24px;
    line-height: 1.2;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    opacity: 0.9;
}

.btn {
    padding: 18px 40px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 40px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-main {
    background: var(--accent-color);
    color: var(--white);
    box-shadow: 0 10px 20px rgba(255, 71, 87, 0.3);
}

.btn-main:hover {
    background: var(--accent-hover);
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(255, 71, 87, 0.4);
}

/* =========================================
   СЕКЦІЇ ТА СІТКИ (GRIDS)
========================================= */
.section {
    padding: 100px 0;
}

.bg-light {
    background-color: var(--bg-light);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 60px;
    color: var(--text-color);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

/* Картки "Як це працює" */
.card-step {
    background: var(--white);
    padding: 40px 30px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card-step:hover {
    transform: translateY(-10px);
}

.step-number {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: var(--white);
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 20px;
}

.card-step h3 {
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.card-step p {
    color: var(--text-light);
}

/* Картки "Категорії" */
.category-card {
    background: var(--white);
    padding: 30px 20px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.category-card:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.category-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.category-card p {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* =========================================
   ПІДВАЛ (FOOTER)
========================================= */
.footer {
    background: #1e272e;
    color: var(--white);
    padding: 60px 0 40px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.footer .small-text {
    font-size: 12px;
    opacity: 0.5;
    margin-top: 5px;
}

/* =========================================
   МОДАЛЬНЕ ВІКНО: АВТОРИЗАЦІЯ
========================================= */
.modal-overlay {
    display: none; /* Приховано за замовчуванням */
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--white);
    width: 100%;
    max-width: 450px;
    padding: 40px;
    border-radius: 20px;
    position: relative;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-btn {
    position: absolute;
    top: 20px; right: 25px;
    font-size: 28px;
    color: #999;
    cursor: pointer;
}

.close-btn:hover { color: #333; }

.modal-content h2 { margin-bottom: 10px; font-size: 1.8rem; }
.modal-subtitle { color: var(--text-light); margin-bottom: 25px; font-size: 0.9rem; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 0.9rem; }

input[type="email"], input[type="password"], input[type="text"] {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

input:focus { border-color: var(--primary-color); }

.btn-login-style {
    width: 100%;
    padding: 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: var(--transition);
}

.btn-login-style:hover { background: #5a75d1; }

/* =========================================
   ВІДЖЕТ ЧАТУ (ПЛАВАЮЧИЙ)
========================================= */
.chat-widget {
    display: none; /* Приховано за замовчуванням */
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 350px;
    height: 500px;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    z-index: 999;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

.chat-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logout-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
}
.logout-btn:hover { background: rgba(255,255,255,0.3); }

.chat-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f9fbfc;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.msg {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.msg.user {
    background: var(--primary-color);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.msg.admin {
    background: #e1e8ed;
    color: var(--text-color);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.chat-input-wrapper {
    display: flex;
    padding: 15px;
    background: var(--white);
    border-top: 1px solid #eee;
}

.chat-input-wrapper input {
    border-radius: 30px;
    padding: 12px 20px;
    margin-right: 10px;
    margin-bottom: 0;
    background: #f1f2f6;
    border: none;
}

.btn-send-style {
    background: var(--primary-color);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.btn-send-style:hover { transform: scale(1.1); }