:root {
    --bg: #f4f6fb;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #6b7280;
    --border: #e5e7eb;
    --accent: #dc2626;
    --accent-2: #b91c1c;
    --success: #16a34a;
    --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body.anketa-page {
    background: var(--bg);
}
.page {
    max-width: 1100px;
    margin: 24px auto;
    padding: 0 16px 40px;
}
.card {
    background: var(--card);
    border-radius: 18px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}
.header {
    padding: 28px 28px 18px;
    background: #f8fafc;
    text-align: center;
}
.flag-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #eef2ff;
    color: #1e40af;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}
.flag-pill img {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
}
.title {
    margin: 14px 0 6px;
    font-size: 24px;
    font-weight: 700;
}
.salary-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: #e7f6ec;
    color: #15803d;
    font-weight: 600;
    font-size: 13px;
}
.progress {
    margin-top: 16px;
}
.progress-label {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
}
.progress-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.progress-bar span {
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
}
.progress-bar span.active {
    background: var(--accent);
}
.step {
    display: none;
    padding: 28px;
}
.step.active {
    display: block;
}
.step-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}
.job-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}
.job-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0;
    background: #fff;
    position: relative;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}
.job-card-body {
    padding: 14px;
}
.job-img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
}
.job-card:hover {
    border-color: #c7d2fe;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}
.job-card.active {
    border-color: var(--accent);
    box-shadow: 0 10px 24px rgba(29, 78, 216, 0.2);
}
.job-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.job-flag-img {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
}
.job-country {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.job-title {
    font-weight: 600;
    margin: 6px 0 8px;
}
.job-salary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #15803d;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 8px;
}
.job-meta {
    display: grid;
    gap: 6px;
    font-size: 12px;
    color: #374151;
}
.job-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.meta-icon {
    width: 20px;
    height: 20px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
    color: #1d4ed8;
    flex: 0 0 auto;
}
.meta-icon--food {
    background: #ecfdf5;
    color: #047857;
}
.meta-icon--time {
    background: #fff7ed;
    color: #c2410c;
}
.job-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.tag {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
}
.fields {
    display: grid;
    gap: 14px;
}
.field label {
    display: block;
    font-size: 13px;
    color: #475569;
    margin-bottom: 6px;
}
.field input,
.field select {
    width: 100%;
    height: 44px;
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 0 12px;
    font-size: 16px;
    font-family: inherit;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
.field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}
.field input:focus,
.field select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.radio-list {
    display: grid;
    gap: 10px;
}
.radio-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.radio-item input {
    margin: 0;
}
.radio-item.active {
    border-color: var(--accent);
    box-shadow: 0 6px 16px rgba(29, 78, 216, 0.15);
}
.actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}
.btn {
    height: 46px;
    padding: 0 20px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    width: 100%;
    font-size: 15px;
}
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    order: -1;
}
.btn-primary:disabled {
    background: #c7d2fe;
    border-color: #c7d2fe;
    cursor: not-allowed;
}
.btn-secondary {
    background: #f8fafc;
}
.budget-group {
    margin-top: 16px;
}
.summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    margin-top: 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #f8fafc;
}
.summary-text {
    font-size: 13px;
    color: #475569;
}
.summary-strong {
    font-weight: 600;
    color: var(--text);
}
.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 30;
}
.modal.active {
    display: flex;
}
.modal-card {
    max-width: 420px;
    width: 100%;
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.modal-title {
    font-weight: 700;
    margin-bottom: 8px;
}
.modal-text {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 16px;
}
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
/* ===== Планшеты и небольшие экраны ===== */
@media (max-width: 720px) {
    .page {
        margin: 12px auto;
        padding: 0 10px 30px;
    }
    .card {
        border-radius: 14px;
    }
    .header {
        padding: 20px 16px 14px;
    }
    .step {
        padding: 18px 16px;
    }
    .title {
        font-size: 19px;
        margin: 10px 0 6px;
    }
    .salary-pill {
        font-size: 12px;
        padding: 5px 10px;
    }
    .progress {
        margin-top: 12px;
    }
    .progress-bar {
        gap: 6px;
    }
    .step-title {
        font-size: 16px;
        margin-bottom: 14px;
    }
    .job-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    /* Горизонтальная раскладка карточки на мобильном */
    .job-card {
        display: flex;
        flex-direction: row;
        border-radius: 12px;
    }
    .job-img {
        width: 110px;
        min-width: 110px;
        height: auto;
        min-height: 100%;
        border-radius: 12px 0 0 12px;
    }
    .job-card-body {
        padding: 10px 12px;
        flex: 1;
        min-width: 0;
    }
    .job-head {
        gap: 6px;
        margin-bottom: 4px;
    }
    .job-flag-img {
        width: 18px;
        height: 18px;
    }
    .job-country {
        font-size: 10px;
    }
    .job-title {
        font-size: 14px;
        margin: 3px 0 4px;
        line-height: 1.3;
    }
    .job-salary {
        font-size: 12px;
        margin-bottom: 5px;
    }
    .job-meta {
        font-size: 11px;
        gap: 3px;
    }
    .meta-icon {
        width: 18px;
        height: 18px;
        border-radius: 6px;
    }
    .meta-icon svg {
        width: 10px;
        height: 10px;
    }
    .job-tags {
        gap: 4px;
        margin-top: 6px;
    }
    .tag {
        font-size: 10px;
        padding: 3px 6px;
    }
    .summary-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
    }
    .summary-text {
        font-size: 12px;
        text-align: center;
    }
    .summary-bar .btn {
        width: 100%;
    }
    .fields {
        gap: 12px;
    }
    .field input,
    .field select {
        height: 48px;
        font-size: 16px;
        border-radius: 12px;
    }
    .field label {
        font-size: 13px;
        margin-bottom: 5px;
    }
    .radio-item {
        padding: 14px 14px;
        border-radius: 12px;
        font-size: 14px;
    }
    .radio-item input[type="radio"] {
        width: 20px;
        height: 20px;
    }
    .btn {
        height: 50px;
        font-size: 15px;
        border-radius: 12px;
    }
    .actions {
        gap: 10px;
        margin-top: 18px;
    }
    .modal-card {
        border-radius: 16px 16px 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100%;
        padding: 20px 16px 28px;
        animation: slideUp 0.25s ease-out;
    }
    .modal {
        align-items: flex-end;
        padding: 0;
    }
    .modal-title {
        font-size: 17px;
    }
    .modal-text {
        font-size: 13px;
    }
    .modal-actions {
        flex-direction: column;
    }
    .modal-actions .btn {
        width: 100%;
    }
}

/* ===== Очень маленькие телефоны (до 400px) ===== */
@media (max-width: 400px) {
    .page {
        margin: 8px auto;
        padding: 0 6px 24px;
    }
    .card {
        border-radius: 12px;
    }
    .header {
        padding: 16px 12px 12px;
    }
    .step {
        padding: 14px 12px;
    }
    .title {
        font-size: 17px;
    }
    .flag-pill {
        font-size: 10px;
        padding: 4px 10px;
    }
    .job-img {
        width: 90px;
        min-width: 90px;
    }
    .job-card-body {
        padding: 8px 10px;
    }
    .job-title {
        font-size: 13px;
    }
    .job-salary {
        font-size: 11px;
    }
    .job-meta {
        font-size: 10px;
    }
    .job-tags {
        display: none;
    }
    .summary-bar {
        padding: 10px;
    }
}

/* Анимация модального окна снизу */
.job-card--custom {
    border-style: dashed;
    border-color: #c7d2fe;
    background: #fafbff;
}
.job-card--custom:hover {
    border-color: var(--accent);
    background: #eef2ff;
}
.job-card--custom.active {
    border-color: var(--accent);
    border-style: solid;
    background: #eef2ff;
}
@media (max-width: 720px) {
    .job-card--custom {
        flex-direction: column;
    }
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
