/* ═══════════════════════════════════════════════
   PHS Forms — общие стили для всех форм
   Подключать через: <link rel="stylesheet" href="forms.css" />
   ═══════════════════════════════════════════════ */

/* ── Hire Form ── */
.hire-form * {
    box-sizing: border-box;
}

.hire-form {
    display: flex;
    flex-direction: column;
}

.hire-form__section {
    border: none;
    padding: 0;
    margin: 0 0 20px;
}

.hire-form__legend {
    font-size: 1.7rem;
    font-weight: 700;
    color: #2d3142;
    margin-bottom: 12px;
    padding-bottom: 6px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.hire-form__note {
    font-size: 0.9rem;
    color: #4f5d75;
    margin-bottom: 12px;
    font-style: italic;
}

.hire-form__row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

@media (min-width: 640px) {
    .hire-form__row {
        flex-direction: row;
        align-items: flex-start;
    }

    .hire-form__row .hire-form__field {
        flex: 1;
        min-width: 0;
    }

    /* строка с одним полем — ограничиваем до половины ширины */
    .hire-form__row .hire-form__field:only-child {
        max-width: 50%;
    }

    /* явные модификаторы оставляем для совместимости */
    .hire-form__row--full .hire-form__field:only-child {
        max-width: 100%;
    }
}

.hire-form__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.hire-form__field[hidden] {
    display: none !important;
}
.hire-form__label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3142;
    margin-bottom: 0;
}

.hire-form__required {
    color: #ef8354;
    margin-left: 2px;
}

.hire-form__hint {
    font-weight: 400;
    color: #4f5d75;
    font-size: 0.8rem;
}

.hire-form__input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #ccc;
    -webkit-appearance: none;
    display: block;
    font-family: Tahoma, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: #1f1f1f;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08), inset 0 1px 2px rgba(0, 0, 0, .04);
    transition: border-color .15s, box-shadow .15s;
}

/* Переопределяем глобальное правило line-height для date/time инпутов */
.hire-form input[type="date"],
.hire-form input[type="time"],
.hire-form input[type="datetime-local"],
.hire-form input[type="month"] {
    line-height: 1.4;
}

.hire-form__input:focus {
    outline: none;
    border-color: #888;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, .07), inset 0 1px 2px rgba(0, 0, 0, .04);
}

.hire-form__input:invalid:not(:placeholder-shown) {
    border-color: #e05;
}

.select {
    display: inline-block;
    position: relative;
    width: 100%;
}

.select::after {
    display: block;
    position: absolute;
    right: 5px;
    content: '\25BC';
    font-size: 0.6rem;
    top: 50%;
    pointer-events: none;
    transform: translateY(-50%);
}

.select select {
    width: 100%;
    padding: 7px 10px;
    padding-right: 24px;
    border: 1px solid #ccc;
    -webkit-appearance: none;
    display: block;
    font-family: Tahoma, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: #1f1f1f;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08), inset 0 1px 2px rgba(0, 0, 0, .04);
    transition: border-color .15s, box-shadow .15s;
}

.select select:focus {
    outline: none;
    border-color: #888;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, .07), inset 0 1px 2px rgba(0, 0, 0, .04);
}

.hire-form__textarea {
    resize: vertical;
    min-height: 60px;
    line-height: 1.5;
}

.hire-form__submit {
    display: flex;
    justify-content: flex-start;
    padding-top: 10px;
}

.hire-form__submit .btn-new {
    min-width: 200px;
    min-height: 38px;
    padding: 0 28px;
    line-height: 1;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity .2s, box-shadow .2s;
}

.hire-form__submit .btn-new:hover {
    opacity: .88;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
}

.hire-form__submit .btn-new:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* ── Field errors ── */
.phs-field-error {
    color: #dc2626;
    font-size: 0.8rem;
    margin-top: 4px;
    display: block;
}

.hire-form__field--error .hire-form__input {
    border-color: #dc2626;
}

.hire-form__field--error .phs-multiselect__trigger {
    border-color: #dc2626;
}

.phs-form-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    color: #dc2626;
    margin-top: 16px;
    padding: 12px 16px;
    font-size: 0.875rem;
    line-height: 1.5;
}


/* ── Success popup ── */
.phs-popup {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
}

.phs-popup.is-visible {
    opacity: 1;
    pointer-events: all;
}

.phs-popup__box {
    background: #fff;
    border-radius: 12px;
    padding: 40px 48px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
    transform: translateY(20px);
    transition: transform .25s;
}

.phs-popup.is-visible .phs-popup__box {
    transform: translateY(0);
}

.phs-popup__icon {
    width: 56px;
    height: 56px;
    background: #f0fdf4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
}

.phs-popup__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: #1a1a1a;
}

.phs-popup__msg {
    color: #555;
    margin: 0 0 24px;
    font-size: 0.95rem;
}

.phs-popup__close {
    cursor: pointer;
}

.phs-popup--letter .phs-popup__box {
    text-align: left;
    max-width: 520px;
}

.phs-popup__icon--info {
    background: #eff6ff;
    color: #2563eb;
    font-style: italic;
    font-weight: 700;
    font-size: 22px;
}

.phs-popup__msg--letter p {
    margin: 0 0 12px;
}

.phs-popup__msg--letter p:last-child {
    margin-bottom: 0;
}


/* ── Section clear button ── */
.hire-form__section-clear {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.8rem;
    font-weight: 400;
    color: #4f5d75;
    cursor: pointer;
    text-decoration: underline;
    transition: color .15s;
}

.hire-form__section-clear:hover {
    color: #ef8354;
}


/* ── Checkbox label ── */
.hire-form__checkbox-label {
    display: flex;
    gap: 8px;
    font-size: 0.9rem;
    color: #2d3142;
    cursor: pointer;
    line-height: 1.4;
    margin-bottom: 0;
    align-items: flex-end;
}

.hire-form__checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
}


/* ── intl-tel-input overrides ── */
.iti {
    width: 100%;
    display: block;
}

.iti__flag-container {
    z-index: 1;
}


/* ── Tooltips ── */
.phs-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 5px;
    vertical-align: middle;
}

.phs-tip__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #4f5d75;
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
    user-select: none;
    transition: background .15s;
}

.phs-tip:hover .phs-tip__icon {
    background: #2d3142;
}

.phs-tip__msg {
    display: none;
    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    transform: translateX(-50%);
    background: #1a1a1a;
    color: #fff;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.45;
    border-radius: 6px;
    padding: 5px 7px;
    max-width: 220px;
    width: max-content;
    white-space: normal;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
}

.phs-tip__msg::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1a1a1a;
}

.phs-tip:hover .phs-tip__msg,
.phs-tip:focus-within .phs-tip__msg {
    display: block;
}


/* ── Application wizard ── */
.hire-form--application-wizard {
    gap: 20px;
}

.hire-form__step-next,
.hire-form__step-submit {
    min-width: 280px;
}

.hire-form__wizard-steps {
    display: block;
    position: relative;
}

.hire-form__wizard-viewport {
    position: relative;
    /* overflow: hidden добавляется программно только во время анимации шагов,
       чтобы не обрезать phs-tip__msg у краёв контейнера */
}

.hire-form__step-panel[hidden] {
    display: none !important;
}

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

.hire-form__step-actions .btn-new {
    min-height: 42px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    padding: 0 24px;
}

.hire-form__conditional-fields {
    display: flex;
    flex: 1;
    gap: 10px;
    min-width: 0;
}

.hire-form__conditional-fields[hidden] {
    display: none !important;
}

.hire-form__conditional-fields .hire-form__field {
    flex: 1;
    min-width: 0;
}

@media (max-width: 639px) {
    .hire-form__step-next,
    .hire-form__step-submit {
        width: 100%;
        min-width: 0;
    }

    .hire-form__conditional-fields {
        flex-direction: column;
        width: 100%;
    }
}

/* ── Application wizard slider ── */
.hire-form__wizard-track {
    position: relative;
}

.hire-form__wizard-track > .hire-form__step-panel {
    width: 100%;
    box-sizing: border-box;
}

.hire-form__wizard-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0 4px;
    border-top: 1px solid #e5e7eb;
    margin-top: 8px;
}

.hire-form__wizard-step-label {
    flex: 1;
    text-align: center;
    font-size: 1.5rem;
    color: #4f5d75;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hire-form__wizard-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid #2d3142;
    background: none;
    cursor: pointer;
    font-size: 18px;
    color: #2d3142;
    line-height: 1;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s, opacity 0.15s, box-shadow 0.15s;
}

.hire-form__wizard-arrow:hover:not(:disabled) {
    background: #2d3142;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.hire-form__wizard-arrow:disabled {
    opacity: 0.25;
    cursor: default;
    border-color: #bfc5d0;
    color: #bfc5d0;
}

.hire-form__already-registered {
    padding: 10px 14px;
    margin-bottom: 12px;
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    border-radius: 6px;
    color: #065f46;
    font-size: 0.875rem;
    line-height: 1.5;
}

.phs-register-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    color: #dc2626;
    margin-top: 8px;
    padding: 12px 16px;
    font-size: 0.875rem;
    line-height: 1.5;
}



/* ── Attachments grid (step 5) ── */
.hire-form__attachments-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

@media (max-width: 800px) {
    .hire-form__attachments-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .hire-form__attachments-grid {
        grid-template-columns: 1fr;
    }
}

.hire-form__attachment-card {
    display: flex;
    gap: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 16px;
    background-color: rgba(243, 243, 243, 0.7);
    transition: border-color .15s, box-shadow .15s;
}

.hire-form__attachment-card:focus-within {
    border-color: #888;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, .07);
}

.hire-form__attachment-card--wide {
    grid-column: 1 / -1;
}

.hire-form__attachment-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-image: repeating-linear-gradient(to right, rgb(0, 0, 0) 0%, rgb(123, 124, 126) 50%, rgb(0, 0, 0) 100%);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.hire-form__attachment-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hire-form__attachment-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2d3142;
    line-height: 1.3;
    cursor: pointer;
}

.hire-form__attachment-formats {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 2px;
    letter-spacing: 0.01em;
}


/* ── Multiselect ── */
.phs-multiselect__native {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
    margin: 0;
}

.phs-multiselect {
    position: relative;
    width: 100%;
}

.phs-multiselect__trigger {
    width: 100%;
    padding: 7px 32px 7px 10px;
    border: 1px solid #ccc;
    -webkit-appearance: none;
    display: block;
    font-family: Tahoma, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: #1f1f1f;
    background: #fff;
    cursor: pointer;
    text-align: left;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08), inset 0 1px 2px rgba(0, 0, 0, .04);
    transition: border-color .15s, box-shadow .15s;
}

.phs-multiselect__trigger:focus {
    outline: none;
    border-color: #888;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, .07), inset 0 1px 2px rgba(0, 0, 0, .04);
}

.phs-multiselect--invalid .phs-multiselect__trigger {
    border-color: #e05;
}

.phs-multiselect--invalid .phs-multiselect__trigger:focus {
    border-color: #e05;
    box-shadow: 0 0 0 3px rgba(224, 0, 85, .12), inset 0 1px 2px rgba(0, 0, 0, .04);
}

.phs-multiselect__panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 30;
    max-height: 240px;
    overflow: auto;
    padding: 8px 0;
    border: 1px solid #ccc;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}

.phs-multiselect__option {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 10px;
    font-size: 14px;
    color: #1f1f1f;
    cursor: pointer;
    line-height: 1.4;
}

.phs-multiselect__option:hover {
    background: #f7f8fb;
}

.phs-multiselect__option input {
    margin-top: 2px;
    flex-shrink: 0;
}
