/* ── Form wrapper ───────────────────────────────────────── */
.form-wrapper {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.form-wrapper h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 24px;
    color: #1f2933;
}

/* ── Length row (side-by-side fields) ───────────────────── */
.length-row {
    display: flex;
    gap: 16px;
}
.length-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ── Fields ─────────────────────────────────────────────── */
.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}

.form-field label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}
.req {
    color: #f87171;
    font-size: 14px;
    line-height: 0;
    margin-left: 4px;
    position: relative;
    top: 3px;
}

.form-field input[type="number"]::-webkit-inner-spin-button,
.form-field input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.form-field input[type="number"] {
    -moz-appearance: textfield;
}
/* Date field overlay — applies on all screen sizes */
.date-wrapper {
    position: relative;
    width: 100%;
}
.date-display {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #9ca3af;
    background: #fff;
    line-height: 1.4;
    min-height: 40px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.date-display:empty::before {
    content: 'Выберите дату';
    color: #9ca3af;
}
.date-display.has-value {
    color: #1f2933;
}
.date-wrapper .date-field {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.001;
    cursor: pointer;
    z-index: 1;
    -webkit-appearance: none;
    appearance: none;
}
.date-wrapper--error .date-display {
    border-color: #b91c1c;
}
.date-wrapper--focused .date-display {
    border-color: #0B1F33;
    box-shadow: 0 0 0 3px rgba(23, 90, 156, 0.12);
}

.form-field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="file"]):not([type="date"]),
.form-field textarea,
.form-field select {
    padding: 9px 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #1f2933;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.form-field input::placeholder,
.form-field textarea::placeholder,
.autocomplete-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
    outline: none;
    border-color: #0B1F33;
    box-shadow: 0 0 0 3px rgba(23, 90, 156, 0.12);
}

.form-field textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

/* ── Errors ─────────────────────────────────────────────── */
.errorlist,
.form-field .errorlist {
    list-style: none;
    padding: 0;
    margin: 4px 0 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.errorlist li {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 400;
}

.form-errors {
    background: #fff5f5;
    border: 1.5px solid #fca5a5;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
    color: #b91c1c;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
}

/* ── Submit button ──────────────────────────────────────── */
.form-submit {
    padding: 10px 28px;
    background: #0B1F33;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
    box-sizing: border-box;
}

.form-submit:hover {
    background: #13477a;
    transform: translateY(-1px);
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-submit--orange {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 18px;
    font-size: 13px;
    font-weight: 500;
    background: #f97316;
    border: 1px solid transparent;
    color: #fff;
}
.form-submit--orange:hover {
    background: #ea6c0b;
    transform: none;
}

.form-submit--draft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 18px;
    font-size: 13px;
    font-weight: 500;
    background: #fff;
    border: 1px solid #d1d5db;
    color: #374151;
}
.form-submit--draft:hover {
    background: #f9fafb;
    transform: none;
}

/* ── Checkbox ───────────────────────────────────────────── */
.form-field--checkbox {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.form-field--checkbox label {
    font-weight: normal;
    margin: 0;
}

/* ── Select placeholder ──────────────────────────────────── */
select.select--placeholder { color: #9ca3af; }
select.select--placeholder option:not([value=""]) { color: #111827; }

/* ── Autocomplete ────────────────────────────────────────── */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-input {
    padding: 9px 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #1f2933;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
    box-sizing: border-box;
}

.autocomplete-input:focus {
    outline: none;
    border-color: #0B1F33;
    box-shadow: 0 0 0 3px rgba(23, 90, 156, 0.12);
}

.autocomplete-input:disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
    border-color: #e5e7eb;
}

.autocomplete-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    max-height: 220px;
    overflow-y: auto;
    z-index: 200;
}

.autocomplete-suggestion {
    padding: 9px 12px;
    font-size: 14px;
    color: #1f2933;
    cursor: pointer;
}

.autocomplete-suggestion:hover,
.autocomplete-suggestion--active {
    background: #f0f4f8;
}

.autocomplete-no-results {
    padding: 9px 12px;
    font-size: 14px;
    color: #9ca3af;
}

/* ── Price row ───────────────────────────────────────────── */
.price-input-row {
    display: flex;
    gap: 12px;
    align-items: center;
}
.price-input-row input[type="number"] {
    flex: 1;
    min-width: 0;
}

/* ── Currency chips ──────────────────────────────────────── */
.currency-chips {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.currency-chip {
    padding: 7px 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #374151;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    user-select: none;
}
.currency-chip:hover {
    border-color: #9ca3af;
}
.currency-chip--active {
    border-color: #f97316;
    background: #f97316;
    color: #fff;
}

/* flatpickr selected day */
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: #0b1f33 !important;
    border-color: #0b1f33 !important;
}

/* flatpickr header overrides */
.flatpickr-current-month {
    font-size: 15px !important;
    font-family: 'Manrope', sans-serif !important;
}
.flatpickr-current-month .flatpickr-monthDropdown-months {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23606060'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 4px center !important;
    padding-right: 18px !important;
}
/* custom year dropdown */
.fp-year-btn {
    display: inline-block;
    cursor: pointer;
    user-select: none;
}
.fp-year-list {
    display: none;
    position: absolute;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 99999;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    min-width: 72px;
}
.fp-year-list--open {
    display: block;
}
.fp-year-item {
    padding: 7px 16px;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Manrope', sans-serif;
    color: #374151;
    white-space: nowrap;
}
.fp-year-item:hover { background: #f3f4f6; }
.fp-year-item:first-child { border-radius: 10px 10px 0 0; }
.fp-year-item:last-child  { border-radius: 0 0 10px 10px; }
.fp-year-item--active {
    color: #0b1f33;
    font-weight: 600;
}
.fp-year-item--disabled {
    color: #d1d5db;
    cursor: default;
    pointer-events: none;
}
