:root {
    --bg: #edf3f9;
    --card: #ffffff;
    --text: #11203a;
    --muted: #64748b;
    --primary: #173f73;
    --primary-2: #2f69aa;
    --primary-soft: #eaf2fc;
    --border: #dbe5f0;
    --danger: #a52626;
    --danger-bg: #fff0f0;
    --success: #146c43;
    --shadow: 0 18px 50px rgba(23, 63, 115, .11);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 10% 0, rgba(48, 105, 170, .14), transparent 32rem),
        var(--bg);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

a { color: var(--primary-2); }

.page {
    width: min(1080px, calc(100% - 28px));
    margin: 0 auto;
    padding: 34px 0 50px;
}

.auth-card {
    width: min(760px, 100%);
    margin: 34px auto;
    padding: clamp(24px, 5vw, 42px);
    border: 1px solid var(--border);
    border-radius: 28px;
    background: var(--card);
    box-shadow: var(--shadow);
}

.auth-card-small { width: min(520px, 100%); }

.auth-heading {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.auth-icon {
    display: grid;
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    place-items: center;
    border-radius: 18px;
    background: var(--primary-soft);
    font-size: 29px;
}

.auth-heading h1 {
    margin: 0 0 6px;
    font-size: clamp(25px, 4vw, 34px);
}

.auth-heading p,
.dashboard-topbar p {
    margin: 0;
    color: var(--muted);
}

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

.field {
    display: block;
    margin-bottom: 17px;
}

.form-grid .field { margin-bottom: 0; }
.field-wide { grid-column: 1 / -1; }

.field span {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 700;
}

input, select {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    color: var(--text);
    border: 1px solid #cbd7e5;
    border-radius: 12px;
    outline: none;
    background: #fff;
    font: inherit;
}

input:focus, select:focus {
    border-color: var(--primary-2);
    box-shadow: 0 0 0 4px rgba(47, 105, 170, .12);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 45px;
    padding: 10px 18px;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    font: inherit;
    font-weight: 800;
}

.button-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.button-light {
    color: var(--primary);
    background: #fff;
}

.button-full {
    width: 100%;
    margin-top: 22px;
}

.auth-footer {
    margin: 22px 0 0;
    text-align: center;
    color: var(--muted);
}

.alert {
    margin-bottom: 20px;
    padding: 14px 16px;
    border-radius: 13px;
}

.alert-error {
    color: var(--danger);
    border: 1px solid #efb9b9;
    background: var(--danger-bg);
}

.alert ul { margin: 8px 0 0; padding-left: 20px; }

.test-note {
    margin-top: 18px;
    padding: 12px 14px;
    color: #66541d;
    border: 1px solid #eadb9e;
    border-radius: 12px;
    background: #fff9df;
    font-size: 13px;
    line-height: 1.5;
}

.dashboard-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 25px 28px;
    color: #fff;
    border-radius: 24px 24px 0 0;
    background: #102f58;
}

.dashboard-topbar .eyebrow {
    margin-bottom: 8px;
    color: rgba(255,255,255,.74);
    font-weight: 800;
}

.dashboard-topbar h1 {
    margin: 0 0 7px;
    font-size: clamp(24px, 4vw, 36px);
}

.dashboard-topbar p { color: rgba(255,255,255,.72); }

.hero {
    padding: 22px 28px 28px;
    border-radius: 0 0 24px 24px;
    background: linear-gradient(135deg, #173f73, #326dad);
    box-shadow: var(--shadow);
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.status-card {
    min-height: 128px;
    padding: 17px;
    color: #fff;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 17px;
    background: rgba(255,255,255,.10);
}

.status-card .status-icon { font-size: 24px; }
.status-card span {
    display: block;
    margin: 13px 0 6px;
    color: rgba(255,255,255,.72);
    font-size: 13px;
}
.status-card strong {
    display: block;
    line-height: 1.3;
}

.profile-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin-top: 22px;
    padding: 20px 22px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--card);
}

.profile-summary > div > span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.profile-summary strong {
    display: block;
    margin-top: 5px;
    font-size: 22px;
}

.summary-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.summary-stats span {
    padding: 8px 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary) !important;
}

.section-title {
    margin: 34px 0 16px;
    font-size: 23px;
}

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

.module {
    display: block;
    min-height: 175px;
    padding: 21px;
    color: inherit;
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--card);
    box-shadow: 0 10px 30px rgba(23,63,115,.06);
}

.module-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 15px;
    background: var(--primary-soft);
    font-size: 24px;
}

.module h2 { margin: 18px 0 8px; font-size: 17px; }
.module p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.module-disabled { cursor: default; }

.site-footer {
    padding-top: 30px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 900px) {
    .status-grid, .modules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .page { width: min(100% - 18px, 1080px); padding-top: 12px; }
    .auth-card { margin-top: 12px; border-radius: 20px; }
    .form-grid { grid-template-columns: 1fr; }
    .field-wide { grid-column: auto; }
    .dashboard-topbar { align-items: flex-start; border-radius: 20px 20px 0 0; }
    .hero { border-radius: 0 0 20px 20px; }
    .status-grid, .modules { grid-template-columns: 1fr; }
    .status-card, .module { min-height: auto; }
    .profile-summary { align-items: flex-start; flex-direction: column; }
    .summary-stats { justify-content: flex-start; }
}


/* Шаг 3 — личные автомобили */
textarea {
    width: 100%;
    padding: 12px 13px;
    color: var(--text);
    border: 1px solid #cbd7e5;
    border-radius: 12px;
    outline: none;
    resize: vertical;
    background: #fff;
    font: inherit;
}

textarea:focus {
    border-color: var(--primary-2);
    box-shadow: 0 0 0 4px rgba(47, 105, 170, .12);
}

.field small {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 12px;
}

.inner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 22px;
    padding: 26px 28px;
    color: #fff;
    border-radius: 24px;
    background: linear-gradient(135deg, #102f58, #326dad);
    box-shadow: var(--shadow);
}

.inner-header h1 {
    margin: 5px 0 7px;
    font-size: clamp(25px, 4vw, 36px);
}

.inner-header p {
    margin: 0;
    color: rgba(255,255,255,.74);
}

.inner-header .eyebrow {
    color: rgba(255,255,255,.72);
    font-weight: 800;
}

.inner-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.content-card,
.empty-state {
    padding: clamp(22px, 4vw, 34px);
    border: 1px solid var(--border);
    border-radius: 23px;
    background: var(--card);
    box-shadow: 0 12px 36px rgba(23,63,115,.07);
}

.empty-state {
    text-align: center;
}

.empty-state .empty-icon {
    font-size: 52px;
}

.empty-state h2 {
    margin: 15px 0 8px;
}

.empty-state p {
    margin: 0 0 22px;
    color: var(--muted);
}

.alert-success {
    margin-bottom: 20px;
    color: var(--success);
    border: 1px solid #afd8c2;
    background: #ebf8f1;
}

.button-secondary {
    color: var(--primary);
    border: 1px solid #c9d8e8;
    background: #eef4fb;
}

.button-danger {
    color: #fff;
    background: #b52d2d;
}

.button-danger-outline {
    color: #a22626;
    border: 1px solid #ebbbbb;
    background: #fff4f4;
}

.form-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.current-car-photo {
    margin-top: 20px;
}

.current-car-photo span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
}

.current-car-photo img {
    width: min(280px, 100%);
    max-height: 220px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid var(--border);
}

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

.car-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 23px;
    background: var(--card);
    box-shadow: 0 12px 35px rgba(23,63,115,.07);
}

.car-photo {
    display: grid;
    height: 250px;
    place-items: center;
    overflow: hidden;
    color: var(--muted);
    background: #dfe9f4;
    font-size: 54px;
}

.car-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.car-body {
    padding: 22px;
}

.car-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.car-title-row h2 {
    margin: 0;
    font-size: 22px;
}

.type-badge {
    flex: 0 0 auto;
    padding: 6px 9px;
    color: var(--primary);
    border-radius: 999px;
    background: var(--primary-soft);
    font-size: 12px;
    font-weight: 800;
}

.plate {
    display: inline-block;
    margin-top: 13px;
    padding: 8px 12px;
    color: #101010;
    border: 2px solid #222;
    border-radius: 7px;
    background: #fff;
    font-weight: 900;
    letter-spacing: .7px;
}

.car-meta,
.car-comment {
    color: var(--muted);
    line-height: 1.5;
}

.car-comment {
    padding: 12px 14px;
    border-radius: 12px;
    background: #f5f8fc;
}

.car-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 18px;
}

.delete-confirm {
    text-align: center;
}

.delete-confirm > img {
    width: min(380px, 100%);
    max-height: 280px;
    object-fit: cover;
    border-radius: 18px;
}

.delete-confirm .form-buttons {
    justify-content: center;
}

.module-active {
    transition: transform .18s ease, box-shadow .18s ease;
}

.module-active:hover {
    transform: translateY(-3px);
    box-shadow: 0 17px 36px rgba(23,63,115,.13);
}

.module-open {
    display: inline-block;
    margin-top: 14px;
    color: var(--primary-2);
    font-size: 13px;
    font-weight: 800;
}

@media (max-width: 760px) {
    .inner-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .inner-actions {
        justify-content: flex-start;
    }

    .car-grid {
        grid-template-columns: 1fr;
    }

    .car-photo {
        height: 220px;
    }
}
