/* =====================================================================
   Delivery Express — фирменная таблица стилей
   Палитра: индиго #4f46e5 + express-оранжевый #ff6a2b (см. observer/BRAND.md)
   ===================================================================== */

:root {
    --brand:       #4f46e5;
    --brand-dark:  #4338ca;
    --brand-2:     #7c3aed;
    --brand-tint:  #eef2ff;
    --accent:      #ff6a2b;
    --accent-dark: #e8551a;
    --ink:         #101828;
    --ink-2:       #475467;
    --muted:       #667085;
    --bg:          #f5f6fb;
    --surface:     #ffffff;
    --surface-2:   #f8f9fd;
    --line:        #e6e8f0;
    --ok:          #12b76a;
    --err:         #f04438;

    --grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);

    --radius:    16px;
    --radius-sm: 12px;
    --shadow:    0 4px 12px rgba(16,24,40,.06);
    --shadow-md: 0 10px 30px rgba(16,24,40,.10);
    --shadow-lg: 0 24px 60px rgba(16,24,40,.14);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    color: var(--ink);
    line-height: 1.6;
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img { max-width: 100%; }

.container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --------------------------------------------------------- Шапка */
header {
    background-color: rgba(255,255,255,.85);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    gap: 20px;
}

/* Логотип Delivery Express (SVG-знак + текст) */
.brand,
.logo a {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-weight: 800;
    font-size: 21px;
    letter-spacing: -0.02em;
    color: var(--ink);
    line-height: 1;
}

.brand__mark {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(79,70,229,.35);
}

.brand__text b { color: var(--ink); font-weight: 800; }
.brand__text i { color: var(--accent); font-style: normal; font-weight: 800; }

nav ul {
    display: flex;
    list-style: none;
    gap: 6px;
    align-items: center;
}

nav ul li a {
    color: var(--ink-2);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    padding: 8px 14px;
    border-radius: 8px;
    transition: color .2s, background .2s;
}

nav ul li a:hover {
    color: var(--brand);
    background: var(--brand-tint);
}

/* --------------------------------------------------------- Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--accent);
    color: #fff;
    padding: 13px 28px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: .01em;
    transition: transform .2s, box-shadow .2s, background .2s;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(255,106,43,.28);
}

.btn:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(255,106,43,.36);
}

.btn:active { transform: translateY(0); }

.btn-ghost {
    background: transparent;
    color: #fff;
    border: 1.5px solid rgba(255,255,255,.55);
    box-shadow: none;
}
.btn-ghost:hover {
    background: rgba(255,255,255,.12);
    border-color: #fff;
    box-shadow: none;
}

/* --------------------------------------------------------- Секции */
section {
    padding: 64px 0;
    background-color: var(--surface);
    margin: 28px auto;
    max-width: 1160px;
    border-radius: 24px;
    box-shadow: var(--shadow);
}
section.container { padding-left: 40px; padding-right: 40px; }

h2 {
    text-align: center;
    margin-bottom: 12px;
    font-size: clamp(28px, 4vw, 38px);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--ink);
}

h2 + .section-sub {
    text-align: center;
    color: var(--muted);
    max-width: 640px;
    margin: 0 auto 44px;
    font-size: 17px;
}

/* --------------------------------------------------------- Герой */
.hero {
    position: relative;
    background: var(--grad);
    color: #fff;
    padding: 96px 40px;
    text-align: center;
    border-radius: 28px;
    margin: 28px auto;
    max-width: 1160px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(900px 400px at 15% 0%, rgba(255,255,255,.18), transparent 60%),
        radial-gradient(700px 500px at 100% 100%, rgba(255,106,43,.30), transparent 55%);
    pointer-events: none;
}

.hero > * { position: relative; z-index: 1; }

.hero .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.25);
    color: #fff;
    padding: 7px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 22px;
}

.hero h1 {
    font-size: clamp(32px, 6vw, 56px);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
}

.hero p {
    font-size: clamp(16px, 2.4vw, 20px);
    max-width: 720px;
    margin: 0 auto 34px;
    color: rgba(255,255,255,.92);
}

.hero-cta {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Полоса статистики под героем */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 48px;
    padding-top: 34px;
    border-top: 1px solid rgba(255,255,255,.2);
}

.stat b {
    display: block;
    font-size: clamp(26px, 4vw, 34px);
    font-weight: 800;
    letter-spacing: -0.02em;
}
.stat span {
    font-size: 14px;
    color: rgba(255,255,255,.82);
}

/* --------------------------------------------------------- Услуги */
.services {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 22px;
    margin-top: 8px;
}

.service {
    background: var(--surface);
    padding: 30px 28px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    text-align: left;
    transition: transform .25s, box-shadow .25s, border-color .25s;
}

.service:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

.service .service-ico {
    width: 52px;
    height: 52px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: var(--brand-tint);
    color: var(--brand);
    font-size: 24px;
    margin-bottom: 18px;
}

.service h3 {
    margin-bottom: 10px;
    font-size: 19px;
    color: var(--ink);
    font-weight: 700;
}
.service p { color: var(--ink-2); font-size: 15px; }

/* --------------------------------------------------------- Этапы работы */
.steps { background-color: var(--surface); }

.steps .steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
    gap: 20px;
    margin-top: 8px;
}

.steps .step-item {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 0;
    padding: 24px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: none;
}

.step-number {
    background: var(--accent);
    color: #fff;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.25rem;
    font-weight: 800;
    box-shadow: 0 6px 14px rgba(255,106,43,.3);
}

.steps .step-item h3 { color: var(--ink); margin-bottom: 6px; font-size: 18px; }
.steps .step-item p { color: var(--ink-2); font-size: 15px; }

/* --------------------------------------------------------- Преимущества */
.advantages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
    gap: 20px;
}

.advantage {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 24px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: transform .25s, box-shadow .25s;
}

.advantage:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.advantage-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--brand-tint);
    color: var(--brand);
    font-size: 20px;
    font-weight: 800;
    margin-right: 0;
    flex-shrink: 0;
}

.advantage h3 { color: var(--ink); margin-bottom: 6px; font-size: 18px; }
.advantage p { color: var(--ink-2); font-size: 15px; }

/* --------------------------------------------------------- Форма обратной связи */
.contact-form {
    max-width: 620px;
    margin: 0 auto;
    background: var(--surface-2);
    padding: 34px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
}

.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
    font-size: 14px;
    color: var(--ink);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 13px 14px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    color: var(--ink);
    transition: border-color .2s, box-shadow .2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(79,70,229,.12);
}

.contact-form .btn { width: 100%; margin-top: 4px; }

/* --------------------------------------------------------- Подвал */
footer {
    background: #0d1023;
    color: #cfd3e6;
    padding: 56px 0 40px;
    margin-top: 40px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 30px;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-weight: 800;
    font-size: 20px;
    color: #fff;
    letter-spacing: -0.02em;
}
.footer-brand .brand__text b { color: #fff; }
.footer-brand .brand__text i { color: var(--accent); }
.footer-brand .brand__mark { width: 36px; height: 36px; }

.footer-info p { margin-bottom: 8px; line-height: 1.6; color: #aab0c8; font-size: 14px; }

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    color: #cfd3e6;
    text-decoration: none;
    font-size: 14px;
    transition: color .2s;
}

.footer-links a:hover { color: var(--accent); }

/* --------------------------------------------------------- Попап */
.popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(16,24,40,.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.popup {
    background: var(--surface);
    padding: 34px;
    border-radius: 20px;
    max-width: 460px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    animation: popup-in .3s ease;
}

@keyframes popup-in {
    from { opacity: 0; transform: translateY(16px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

.popup h3 {
    margin-bottom: 22px;
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.error { border-color: var(--err) !important; }

.error-message {
    color: var(--err);
    font-size: 12.5px;
    margin-top: 6px;
    display: none;
}

.success-message {
    text-align: center;
    color: var(--ok);
    font-weight: 700;
    display: none;
    padding: 12px 0;
}

/* =====================================================================
   Блог
   ===================================================================== */
.blog-section {
    padding: 48px 40px;
    background-color: var(--surface);
    margin: 28px auto;
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.blog-section h2 { margin-bottom: 40px; }

.blog-posts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 26px;
    margin-bottom: 40px;
}

.blog-post {
    position: relative;
    overflow: hidden;
    transition: transform .25s, box-shadow .25s, border-color .25s;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.post-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--brand-tint);
    transition: transform .5s ease;
}

.blog-post:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

.blog-post:hover .post-image { transform: scale(1.05); }

.post-content {
    padding: 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-date, .article-meta {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 10px;
    display: block;
}

.post-title, .article-header h1 {
    font-size: 19px;
    margin-bottom: 12px;
    color: var(--ink);
    line-height: 1.35;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.article-header h1 {
    font-size: clamp(26px, 4vw, 34px);
    margin-bottom: 16px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.post-excerpt, .article-content p {
    color: var(--ink-2);
    margin-bottom: 16px;
    line-height: 1.6;
    font-size: 14.5px;
}

.article-content p { font-size: 16.5px; color: var(--ink-2); }

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 4px;
}

.post-category {
    font-size: 12px;
    background: var(--brand-tint);
    padding: 4px 10px;
    border-radius: 999px;
    color: var(--brand);
    font-weight: 600;
}

.read-more, .back-link {
    font-size: 14px;
    color: var(--brand);
    text-decoration: none;
    font-weight: 700;
    transition: color .2s;
}

.read-more:hover, .back-link:hover { color: var(--brand-dark); }

.back-link {
    display: inline-block;
    margin-top: 40px;
}

/* Статья */
.article-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
}

.article-image {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.article-content {
    max-width: 780px;
    margin: 0 auto;
}

.article-content h2 {
    font-size: 25px;
    margin: 34px 0 14px;
    color: var(--ink);
    text-align: left;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.article-content h3 { margin: 24px 0 10px; color: var(--ink); font-size: 20px; }

.article-content ul, .article-content ol {
    margin-bottom: 20px;
    padding-left: 22px;
}

.article-content li { margin-bottom: 10px; color: var(--ink-2); }

.article-content a { color: var(--brand); }

.tips-box {
    background: var(--brand-tint);
    border-left: 4px solid var(--brand);
    padding: 22px 24px;
    margin: 30px 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.tips-box h3 { margin-top: 0; color: var(--brand-dark); }
.tips-box li { color: var(--ink-2); }

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin: 40px 0;
}

.feature-card {
    background: var(--surface-2);
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-align: center;
    transition: transform .25s, box-shadow .25s;
}

.feature-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.feature-card h3 { color: var(--ink); margin-bottom: 12px; }

.benefits-section {
    background: var(--surface-2);
    padding: 44px 32px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin: 40px 0;
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 26px;
}

.benefit-icon {
    font-size: 1.6rem;
    color: var(--accent);
    min-width: 54px;
    text-align: center;
}

.benefit-content h3 { margin-bottom: 8px; color: var(--ink); }

.specs-table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    font-size: 15px;
}

.specs-table th, .specs-table td {
    padding: 13px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.specs-table th { background: var(--brand-tint); color: var(--ink); font-weight: 700; }

.testimonials {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 22px;
    margin: 40px 0;
}

.testimonial {
    background: var(--surface-2);
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    position: relative;
}

.testimonial:before {
    content: "\201C";
    font-size: 60px;
    line-height: 1;
    color: var(--brand);
    opacity: .18;
    position: absolute;
    top: 10px;
    left: 14px;
}

.testimonial p { font-style: italic; margin-bottom: 10px; color: var(--ink-2); }
.testimonial .author { font-weight: 700; color: var(--ink); font-style: normal; }

.delivery-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.delivery-step { text-align: center; padding: 20px; }

.delivery-step .step-number { margin: 0 auto 15px; }

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
    gap: 8px;
    flex-wrap: wrap;
}

.page-link {
    display: inline-block;
    padding: 9px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink-2);
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all .2s;
}

.page-link:hover, .page-link.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

/* Загрузка / ошибки */
.loading {
    text-align: center;
    padding: 40px;
    font-size: 17px;
    color: var(--muted);
    grid-column: 1 / -1;
}

.blog-posts .error-message {
    text-align: center;
    padding: 40px;
    color: var(--err);
    display: block;
    grid-column: 1 / -1;
    font-size: 16px;
}

.blog-posts .error-message .btn { margin-top: 20px; }

/* =====================================================================
   Юридические страницы
   ===================================================================== */
.policy-content {
    max-width: 820px;
    margin: 0 auto;
}

.policy-content h1 {
    text-align: center;
    color: var(--ink);
    margin-bottom: 10px;
    font-size: clamp(26px, 4vw, 34px);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.policy-meta {
    text-align: center;
    color: var(--muted);
    margin-bottom: 40px;
    font-style: italic;
}

.policy-content h2 {
    color: var(--ink);
    margin: 30px 0 14px;
    text-align: left;
    font-size: 22px;
    font-weight: 700;
}

.policy-content h3 { color: var(--ink); margin: 20px 0 10px; font-size: 18px; }
.policy-content p { margin-bottom: 15px; line-height: 1.7; color: var(--ink-2); }
.policy-content ul { margin-bottom: 20px; padding-left: 22px; }
.policy-content li { margin-bottom: 8px; color: var(--ink-2); }

/* =====================================================================
   Пошаговые инструкции в статьях (.step-by-step)
   ===================================================================== */
.step-by-step {
    position: relative;
    margin: 30px 0;
    padding-left: 30px;
}

.step-by-step .step-item {
    margin-bottom: 25px;
    position: relative;
    padding: 22px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--brand);
    display: block;
}

.step-by-step .step-number {
    font-weight: 700;
    color: var(--brand);
    margin-bottom: 10px;
    font-size: 18px;
    width: auto;
    height: auto;
    background: none;
    border-radius: 0;
    display: block;
    box-shadow: none;
}

.step-by-step .step-item:before {
    content: '';
    position: absolute;
    left: -30px;
    top: 25px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--brand);
}

.step-by-step .step-item:after {
    content: '';
    position: absolute;
    left: -24px;
    top: 31px;
    width: 2px;
    height: calc(100% + 20px);
    background: var(--brand);
    opacity: .4;
}

.step-by-step .step-item:last-child:after { display: none; }

/* =====================================================================
   Адаптивность
   ===================================================================== */
@media (max-width: 768px) {
    .header-content { flex-direction: column; gap: 12px; }
    nav ul { flex-wrap: wrap; justify-content: center; gap: 2px; }
    nav ul li a { padding: 6px 10px; font-size: 14px; }

    .hero { padding: 68px 24px; }
    section { padding: 44px 0; border-radius: 20px; }
    section.container, .blog-section, .hero { padding-left: 22px; padding-right: 22px; }

    .stats { grid-template-columns: repeat(2, 1fr); gap: 24px 16px; }

    .services, .advantages, .steps .steps-grid { grid-template-columns: 1fr; }

    .benefit-item { flex-direction: column; text-align: center; }
    .benefit-icon { margin: 0 auto; }

    .footer-content { flex-direction: column; }
    .footer-links { flex-direction: row; flex-wrap: wrap; gap: 18px; }
}

@media (max-width: 576px) {
    .container { padding: 0 16px; }
    .post-image { height: 170px; }
    .hero-cta .btn { width: 100%; }
    .step-by-step { padding-left: 20px; }
    .step-by-step .step-item:before { left: -20px; }
    .step-by-step .step-item:after { left: -14px; }
}
