:root {
    --bg: #f6f3ee;
    --surface: #ffffff;
    --surface-2: #fff8ed;
    --text: #201b17;
    --muted: #6f665d;
    --line: #eadfce;
    --accent: #d06a2d;
    --accent-dark: #a94b16;
    --green: #147a45;
    --red: #b42318;
    --shadow: 0 18px 50px rgba(45, 35, 24, 0.10);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(208, 106, 45, 0.13), transparent 30rem),
        var(--bg);
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

main {
    width: min(1160px, calc(100% - 32px));
    margin: 0 auto;
}

.topbar {
    width: min(1160px, calc(100% - 32px));
    margin: 18px auto 0;
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--line);
    border-radius: 999px;
    backdrop-filter: blur(14px);
    position: sticky;
    top: 12px;
    z-index: 20;
}

.brand {
    font-weight: 800;
    letter-spacing: -0.02em;
}

nav {
    display: flex;
    gap: 8px;
}

nav a {
    padding: 9px 12px;
    color: var(--muted);
    border-radius: 999px;
}

nav a:hover {
    background: var(--surface-2);
    color: var(--text);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
    gap: 26px;
    padding: 70px 0 36px;
    align-items: stretch;
}

.hero-text,
.hero-card,
.card,
.price-card,
.form-card,
.thanks-card,
.table-card,
.cta {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-text {
    padding: 48px;
}

.hero-card {
    padding: 34px;
    background: var(--surface-2);
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--accent-dark);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
}

h1, h2, h3 {
    margin-top: 0;
    letter-spacing: -0.04em;
    line-height: 1.05;
}

h1 {
    font-size: clamp(2.3rem, 6vw, 5rem);
    margin-bottom: 18px;
}

h2 {
    font-size: clamp(1.6rem, 3vw, 2.35rem);
    margin-bottom: 14px;
}

h3 {
    font-size: 1.35rem;
}

.lead {
    font-size: 1.2rem;
    color: var(--muted);
    max-width: 760px;
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 28px;
}

.actions.center {
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    padding: 13px 20px;
    font-weight: 800;
    cursor: pointer;
    font-size: 0.98rem;
}

.btn.primary {
    background: var(--accent);
    color: white;
}

.btn.primary:hover {
    background: var(--accent-dark);
}

.btn.secondary {
    background: #2e2720;
    color: white;
}

.btn.ghost {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
}

ul {
    padding-left: 20px;
}

li + li {
    margin-top: 8px;
}

.grid {
    display: grid;
    gap: 20px;
}

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

.card,
.price-card,
.cta {
    padding: 28px;
}

.card p,
.price-card p,
.cta p,
.footer p {
    color: var(--muted);
}

.pricing,
.cta,
.page-head,
.table-card,
.stats,
.search {
    margin-top: 28px;
}

.price {
    font-size: 2rem;
    font-weight: 900;
    color: var(--accent-dark);
    margin: 8px 0;
}

.featured {
    outline: 3px solid rgba(208, 106, 45, 0.25);
}

.cta {
    text-align: center;
    margin-bottom: 52px;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    padding: 48px 0 8px;
}

.page-head.narrow,
.form-card.narrow {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.page-head h1 {
    font-size: clamp(2rem, 4vw, 3.4rem);
}

.form-card {
    padding: 28px;
    max-width: 780px;
    margin: 20px auto 56px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

label {
    display: block;
    font-weight: 750;
    margin-bottom: 16px;
}

input,
select,
textarea {
    width: 100%;
    display: block;
    margin-top: 8px;
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 13px 14px;
    font: inherit;
    background: #fffdf9;
    color: var(--text);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.question {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    margin: 20px 0;
    background: #fffdf9;
}

.question legend {
    padding: 0 8px;
    font-weight: 900;
}

.radio-line {
    display: flex;
    gap: 10px;
    align-items: center;
    font-weight: 600;
    margin: 10px 0;
}

.radio-line input {
    width: auto;
    margin: 0;
}

.flash-wrap {
    margin-top: 20px;
}

.flash {
    padding: 14px 16px;
    border-radius: 16px;
    font-weight: 700;
}

.flash-error {
    background: #fff0ed;
    color: var(--red);
    border: 1px solid #ffcdc5;
}

.flash-success {
    background: #ecfff4;
    color: var(--green);
    border: 1px solid #bce8cf;
}

.thanks-card {
    max-width: 700px;
    margin: 70px auto;
    padding: 44px;
    text-align: center;
}

.success-icon {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin: 0 auto 18px;
    background: #ecfff4;
    color: var(--green);
    font-size: 2.6rem;
    font-weight: 900;
}

.stats {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
}

.stat {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 14px;
}

.stat.active {
    background: var(--surface-2);
    border-color: rgba(208, 106, 45, 0.55);
}

.stat span {
    display: block;
    color: var(--muted);
    font-size: 0.84rem;
}

.stat strong {
    display: block;
    font-size: 1.65rem;
}

.admin-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search {
    display: flex;
    gap: 10px;
}

.search input {
    margin: 0;
}

.table-card {
    padding: 0;
    overflow: hidden;
    margin-bottom: 56px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
}

th,
td {
    padding: 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    background: var(--surface-2);
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

td small,
.muted {
    color: var(--muted);
}

.ok {
    color: var(--green) !important;
    font-weight: 700;
}

.empty {
    padding: 24px;
    color: var(--muted);
}

.footer {
    width: min(1160px, calc(100% - 32px));
    margin: 0 auto 30px;
    padding: 20px;
    text-align: center;
    border-top: 1px solid var(--line);
}

code {
    background: #efe5d7;
    padding: 2px 6px;
    border-radius: 8px;
}

@media (max-width: 860px) {
    .topbar,
    .page-head {
        align-items: flex-start;
        flex-direction: column;
        border-radius: 24px;
    }

    .hero,
    .grid.three,
    .form-grid,
    .stats {
        grid-template-columns: 1fr;
    }

    .hero {
        padding-top: 34px;
    }

    .hero-text {
        padding: 30px;
    }

    nav {
        flex-wrap: wrap;
    }
}

.inline-form {
    display: inline-block;
    margin: 0;
}

button.loading {
    opacity: 0.75;
    cursor: wait;
}

/* Цветные статусы в админке */
.stat[style*="--status-color"] {
    border-color: color-mix(in srgb, var(--status-color) 38%, var(--line));
    background: color-mix(in srgb, var(--status-color) 9%, #ffffff);
}

.stat[style*="--status-color"] strong {
    color: var(--status-color);
}

.leads-table {
    min-width: 1180px;
}

.lead-row {
    background: linear-gradient(90deg, color-mix(in srgb, var(--status-color) 11%, #ffffff) 0, #ffffff 150px);
    box-shadow: inset 5px 0 0 var(--status-color);
}

.lead-row:hover {
    background: color-mix(in srgb, var(--status-color) 7%, #ffffff);
}

.status-col,
.status-cell {
    min-width: 190px;
    width: 190px;
}

.status-form {
    margin: 0;
}

.status-select {
    width: 100%;
    min-width: 160px;
    margin: 0;
    padding: 10px 36px 10px 14px;
    border: 1px solid color-mix(in srgb, var(--status-color) 58%, var(--line));
    border-radius: 999px;
    background-color: color-mix(in srgb, var(--status-color) 13%, #ffffff);
    color: var(--status-color);
    font-weight: 850;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.status-select:focus {
    outline: 3px solid color-mix(in srgb, var(--status-color) 24%, transparent);
}

.status-settings {
    max-width: 860px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.color-row {
    margin: 0;
    padding: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    border: 1px solid color-mix(in srgb, var(--status-color) 35%, var(--line));
    border-radius: 18px;
    background: color-mix(in srgb, var(--status-color) 9%, #ffffff);
}

.status-preview {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 850;
    color: var(--status-color);
}

.status-dot {
    width: 13px;
    height: 13px;
    border-radius: 999px;
    background: var(--status-color);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--status-color) 14%, transparent);
}

.color-row input[type="color"] {
    width: 56px;
    height: 42px;
    min-width: 56px;
    margin: 0;
    padding: 4px;
    border-radius: 12px;
    cursor: pointer;
}

.settings-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

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