/* ═══════════════════════════════════════════════════════
   СудебныйПриказ.рф — Основные стили
   Mobile-first: базовые стили для 320px+
   ═══════════════════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
    --primary:      #1a3a5c;
    --primary-dark: #0f2a45;
    --accent:       #c9a84c;
    --accent-dark:  #a88a2e;
    --success:      #2d6a4f;
    --error:        #c1121f;
    --bg:           #f8f9fa;
    --white:        #ffffff;
    --text:         #212529;
    --text-light:   #6c757d;
    --border:       #dee2e6;
    --shadow:       0 2px 8px rgba(0,0,0,.08);
    --shadow-lg:    0 4px 24px rgba(0,0,0,.12);
    --radius:       8px;
    --radius-lg:    12px;
    --font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --header-h:     60px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--accent-dark); }
ul { list-style: none; }
input, button, textarea, select { font: inherit; }

/* ── Utility ── */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}
.sr-only {
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
    border: 0;
}

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 24px; font-weight: 600; font-size: 1rem;
    border: 2px solid transparent; border-radius: var(--radius);
    cursor: pointer; transition: all .2s ease; text-align: center;
    line-height: 1.2; white-space: nowrap;
}
.btn--primary {
    background: var(--accent); color: var(--primary-dark);
    border-color: var(--accent);
}
.btn--primary:hover { background: var(--accent-dark); color: var(--primary-dark); }
.btn--outline {
    background: transparent; color: var(--primary);
    border-color: var(--primary);
}
.btn--outline:hover { background: var(--primary); color: var(--white); }
.btn--white {
    background: var(--white); color: var(--primary);
    border-color: var(--white);
}
.btn--white:hover { background: #e9ecef; }
.btn--sm { padding: 8px 16px; font-size: .875rem; }
.btn--lg { padding: 16px 32px; font-size: 1.125rem; }
.btn--block { width: 100%; }
.btn--danger { background: var(--error); color: white; border-color: var(--error); }
.btn--danger:hover { background: #a0111a; }

/* ═══════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════ */
.header {
    position: sticky; top: 0; z-index: 100;
    background: var(--white); border-bottom: 1px solid var(--border);
    height: var(--header-h); box-shadow: var(--shadow);
}
.header .container {
    display: flex; align-items: center; justify-content: space-between;
    height: 100%;
}
.header__logo {
    display: flex; flex-direction: column; gap: 2px;
    flex-shrink: 0; padding-top: 6px;
    text-decoration: none; color: inherit;
}
.header__logo:hover .header__logo-link { color: var(--accent-dark); }
.header__logo-link {
    font-weight: 700; font-size: 1.1rem; color: var(--primary);
    line-height: 1.2;
}
.header__logo-domain {
    font-size: .7rem; font-weight: 600; color: var(--text-light);
    border-top: 1px solid var(--border);
    padding-top: 3px; line-height: 1;
}
.header__nav { display: none; }
.header__nav a {
    color: var(--text); font-size: .9rem; padding: 8px 12px;
    border-radius: var(--radius); transition: background .2s;
}
.header__nav a:hover { background: var(--bg); color: var(--primary); }
.header__actions { display: flex; align-items: center; gap: 8px; }
.header__actions .btn { font-size: .85rem; padding: 8px 14px; }

/* Бургер */
.header__burger {
    display: flex; flex-direction: column; gap: 5px;
    width: 28px; cursor: pointer; background: none; border: none; padding: 4px 0;
}
.header__burger span {
    display: block; height: 2px; background: var(--primary);
    border-radius: 2px; transition: all .3s ease;
}
.header__burger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.header__burger.active span:nth-child(2) { opacity: 0; }
.header__burger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Мобильное меню */
.mobile-menu {
    display: none; position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
    background: var(--white); z-index: 99; padding: 24px 16px;
    flex-direction: column; gap: 8px;
}
.mobile-menu.active { display: flex; }
.mobile-menu a {
    display: block; padding: 14px 16px; font-size: 1.1rem;
    color: var(--text); border-radius: var(--radius); font-weight: 500;
}
.mobile-menu a:hover { background: var(--bg); }

/* ═══════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════ */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white); padding: 48px 0; text-align: center;
}
.hero__title {
    font-size: 1.75rem; font-weight: 800; line-height: 1.2;
    margin-bottom: 12px;
}
.hero__subtitle {
    font-size: 1.05rem; color: rgba(255,255,255,.8);
    margin-bottom: 28px; line-height: 1.5;
}
.hero__cta { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.hero__guarantee {
    margin-top: 16px; font-size: .85rem; color: rgba(255,255,255,.6);
    display: flex; align-items: center; gap: 6px; justify-content: center;
}
.hero__guarantee-icon { font-size: 1.2rem; }

/* ═══════════════════════════════════════════════════════
   TARIFFS
   ═══════════════════════════════════════════════════════ */
.tariffs {
    padding: 48px 0;
    background: var(--white);
}
.tariffs__title {
    text-align: center; font-size: 1.5rem; font-weight: 700;
    margin-bottom: 8px; color: var(--primary);
}
.tariffs__subtitle { text-align: center; color: var(--text-light); margin-bottom: 32px; }
.tariffs__grid {
    display: grid; grid-template-columns: 1fr; gap: 20px;
    max-width: 600px; margin: 0 auto;
}
.tariff-card {
    background: var(--bg); border: 2px solid var(--border);
    border-radius: var(--radius-lg); padding: 28px 20px;
    position: relative; transition: transform .2s, box-shadow .2s;
}
.tariff-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.tariff-card--featured {
    border-color: var(--accent); background: #fefce8;
    box-shadow: 0 0 0 4px rgba(201,168,76,.15);
}
.tariff-card__badge {
    position: absolute; top: -14px; right: 20px;
    background: var(--accent); color: var(--primary-dark);
    font-size: .8rem; font-weight: 700;
    padding: 4px 14px; border-radius: 20px;
}
.tariff-card__name {
    font-size: 1.25rem; font-weight: 700; margin-bottom: 8px;
    color: var(--primary);
}
.tariff-card__price {
    font-size: 2rem; font-weight: 800; color: var(--primary-dark);
    margin-bottom: 4px;
}
.tariff-card__price span { font-size: 1rem; font-weight: 400; color: var(--text-light); }
.tariff-card__desc {
    color: var(--text-light); font-size: .9rem; margin-bottom: 16px;
    line-height: 1.5;
}
.tariff-card__features { margin-bottom: 20px; }
.tariff-card__features li {
    padding: 6px 0; font-size: .9rem; display: flex; align-items: flex-start; gap: 8px;
}
.tariff-card__features li::before { content: '✓'; color: var(--success); font-weight: 700; flex-shrink: 0; }
.tariff-card__features li.missing::before { content: '—'; color: var(--text-light); }

/* ═══════════════════════════════════════════════════════
   HOW IT WORKS
   ═══════════════════════════════════════════════════════ */
.how {
    padding: 48px 0;
    background: var(--bg);
}
.how__title {
    text-align: center; font-size: 1.5rem; font-weight: 700;
    margin-bottom: 32px; color: var(--primary);
}
.how__steps {
    display: grid; grid-template-columns: 1fr; gap: 24px;
    counter-reset: step;
}
.how__step {
    background: var(--white); border-radius: var(--radius-lg);
    padding: 24px 20px; text-align: center; position: relative;
    box-shadow: var(--shadow);
}
.how__step-num {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--primary); color: var(--accent);
    font-size: 1.2rem; font-weight: 800; margin: 0 auto 16px;
}
.how__step h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.how__step p { color: var(--text-light); font-size: .9rem; }

/* ═══════════════════════════════════════════════════════
   UPLOAD FORM (главный экран)
   ═══════════════════════════════════════════════════════ */
.upload-section {
    padding: 48px 0;
    background: var(--white);
}
.upload-section__title {
    text-align: center; font-size: 1.5rem; font-weight: 700;
    margin-bottom: 8px; color: var(--primary);
}
.upload-section__subtitle { text-align: center; color: var(--text-light); margin-bottom: 24px; }
.upload-form {
    max-width: 540px; margin: 0 auto;
    background: var(--bg); border: 2px dashed var(--border);
    border-radius: var(--radius-lg); padding: 32px 20px;
    text-align: center;
}
.upload-form__dropzone {
    padding: 32px 16px; cursor: pointer;
    transition: border-color .2s, background .2s;
}
.upload-form__dropzone:hover,
.upload-form__dropzone.dragover {
    border-color: var(--accent); background: #fefce8;
}
.upload-form__icon { font-size: 3rem; margin-bottom: 12px; }
.upload-form__text { font-size: .95rem; color: var(--text-light); margin-bottom: 4px; }
.upload-form__hint { font-size: .8rem; color: var(--text-light); }
.upload-form__input { display: none; }
.upload-form__file-info {
    display: none; margin-top: 12px; padding: 12px;
    background: var(--white); border-radius: var(--radius);
    font-size: .9rem; text-align: left;
}
.upload-form__file-info.visible { display: block; }
.upload-form__file-info.error { background: #fff5f5; border: 1px solid var(--error); }
.upload-form__comment {
    width: 100%; margin-top: 16px; padding: 12px;
    border: 1px solid var(--border); border-radius: var(--radius);
    resize: vertical; min-height: 80px; font-size: .9rem;
}
.upload-form__submit { margin-top: 16px; width: 100%; }

/* ═══════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════ */
.footer {
    background: var(--primary-dark); color: rgba(255,255,255,.7);
    padding: 32px 0; font-size: .9rem;
}
.footer__grid {
    display: grid; grid-template-columns: 1fr; gap: 24px;
}
.footer__brand { font-weight: 700; font-size: 1.1rem; color: var(--white); margin-bottom: 8px; }
.footer__copy { margin-bottom: 4px; }
.footer a { color: rgba(255,255,255,.7); }
.footer a:hover { color: var(--accent); }
.footer__links { display: flex; flex-direction: column; gap: 8px; }
.footer__links-title { color: var(--white); font-weight: 600; margin-bottom: 4px; }
.footer__contacts p { margin-bottom: 4px; }

/* ═══════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════ */
.modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,.5); align-items: center; justify-content: center;
    padding: 16px;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--white); border-radius: var(--radius-lg);
    width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.2); animation: modalIn .25s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal__header {
    padding: 20px 20px 0; display: flex; align-items: center; justify-content: space-between;
}
.modal__close {
    width: 36px; height: 36px; border: none; background: var(--bg);
    border-radius: 50%; font-size: 1.2rem; cursor: pointer; display: flex;
    align-items: center; justify-content: center; color: var(--text-light);
}
.modal__close:hover { background: var(--border); }
.modal__tabs { display: flex; gap: 0; padding: 16px 20px 0; border-bottom: 1px solid var(--border); }
.modal__tab {
    flex: 1; padding: 10px; text-align: center; font-weight: 600;
    font-size: .95rem; color: var(--text-light); cursor: pointer;
    border: none; background: none; border-bottom: 2px solid transparent;
    transition: all .2s;
}
.modal__tab.active { color: var(--primary); border-bottom-color: var(--accent); }
.modal__body { padding: 20px; }
.modal__body .tab-content { display: none; }
.modal__body .tab-content.active { display: block; }

/* Form elements */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.form-input {
    width: 100%; padding: 10px 14px; border: 1px solid var(--border);
    border-radius: var(--radius); font-size: .95rem; transition: border-color .2s;
}
.form-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(201,168,76,.15); }
.form-input--error { border-color: var(--error); }
.form-error { color: var(--error); font-size: .8rem; margin-top: 4px; display: none; }
.form-error.visible { display: block; }
.form-message {
    padding: 10px 14px; border-radius: var(--radius); font-size: .9rem;
    margin-bottom: 16px; display: none;
}
.form-message.visible { display: block; }
.form-message--error { background: #fff5f5; color: var(--error); border: 1px solid #fecaca; }
.form-message--success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }

/* ═══════════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════════ */
.alert {
    padding: 12px 16px; border-radius: var(--radius); font-size: .9rem;
    margin-bottom: 16px; border: 1px solid transparent;
}
.alert--success { background: #f0fdf4; color: var(--success); border-color: #bbf7d0; }
.alert--error   { background: #fff5f5; color: var(--error);   border-color: #fecaca; }
.alert--info    { background: #eff6ff; color: #1e40af;        border-color: #bfdbfe; }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE — Tablet (≥768px)
   ═══════════════════════════════════════════════════════ */
@media (min-width: 768px) {
    :root { --header-h: 68px; }

    .header__nav { display: flex; align-items: center; gap: 4px; }
    .header__burger { display: none; }
    .mobile-menu { display: none !important; }

    .hero { padding: 72px 0; }
    .hero__title { font-size: 2.5rem; }
    .hero__subtitle { font-size: 1.15rem; max-width: 600px; margin-inline: auto; }
    .hero__cta { flex-direction: row; justify-content: center; }

    .tariffs__grid { grid-template-columns: 1fr 1fr; max-width: 700px; }

    .how__steps { grid-template-columns: repeat(3, 1fr); }

    .footer__grid { grid-template-columns: 2fr 1fr 1fr; }

    .upload-form { padding: 40px 32px; }
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE — Desktop (≥1024px)
   ═══════════════════════════════════════════════════════ */
@media (min-width: 1024px) {
    :root { --header-h: 72px; }

    .container { padding: 0 24px; }

    .hero { padding: 96px 0; }
    .hero__title { font-size: 2.75rem; }

    .tariffs { padding: 64px 0; }
    .tariffs__grid { max-width: 800px; }

    .how { padding: 64px 0; }

    .upload-section { padding: 64px 0; }
}
