/* mobile-select (date wheel): its root sets `transform: translate(0,0)`, which
   makes the root the containing block for its position:fixed panel + backdrop.
   Because the root is position:absolute spanning the whole (tall) document, the
   panel then resolves to the document bottom instead of the viewport and lands
   off-screen once the page is scrolled — leaving a full-page backdrop that
   blocks the page. Dropping the transform makes the fixed children pin to the
   viewport as intended. */
.ms-mobile-select {
    transform: none !important;
}

/**
 * Insurance questionnaire: turn MDB floating labels into fixed labels that sit
 * above the input and never animate/jump. Scoped to #questionsForm so other
 * site forms keep their original styling.
 */
#questionsForm .md-form {
    display: flex;
    flex-direction: column;
    margin-top: 0;
    /* drop MDB's extra bottom margin; row spacing comes from .form-row.mb-4,
       and this keeps select fields (no .md-form) aligned with input fields */
    margin-bottom: 0;
}

#questionsForm .md-form > label {
    position: static !important;
    transform: none !important;
    transition: none !important;
    left: auto !important;
    top: auto !important;
    font-size: 1rem !important;
    color: #495057 !important;
    order: 1;
    margin-bottom: 0.35rem;
    /* Reserve room for up to two lines and anchor text to the bottom so the
       inputs line up across columns even when a label wraps. */
    display: flex;
    align-items: flex-end;
    min-height: 3em;
}

#questionsForm .md-form > input,
#questionsForm .md-form > textarea,
#questionsForm .md-form > select,
#questionsForm .md-form > .iti {
    order: 2;
    margin-bottom: 0;
}

#questionsForm .md-form > .iti {
    width: 100%;
    /* match a plain MDB input's top offset so the phone row lines up */
    margin-top: 3.2px;
}

/* Keep the intl-tel-input field within its column (flag adds left padding) and
   match the height of plain MDB inputs so the phone field aligns with them. */
#questionsForm .iti input,
#questionsForm .iti input[type="tel"] {
    width: 100% !important;
    height: 52px !important;
    box-sizing: border-box !important;
}

#questionsForm .md-form > [data-validate-for],
#questionsForm .md-form > br {
    order: 3;
}

/* Same fixed-height label treatment for select fields (e.g. Dodatna pokrića),
   so inputs align with .md-form fields sitting next to them in a row. Fields are
   top-aligned (no bottom-anchoring), so a short field next to a tall one — e.g.
   Destinacija beside the Teritorija radio group — stays up by its label. */
#questionsForm label.font-weight-bold:has(+ select),
#questionsForm label.font-weight-bold:has(+ .ts-wrapper) {
    display: flex;
    align-items: flex-end;
    min-height: 3em;
    margin-bottom: 0.35rem;
}

/* Date field: wrapper takes the order:2 slot that the bare input used to occupy */
#questionsForm .md-form > .date-field-wrapper {
    order: 2;
    margin-bottom: 0;
    position: relative;
    display: flex;
    align-items: center;
}

#questionsForm .md-form > .date-field-wrapper > input {
    flex: 1;
    padding-right: 2rem;
    color: #212529;
}

/* Placeholder stays light; entered value is dark */
#questionsForm .md-form > .date-field-wrapper > input::placeholder {
    color: #adb5bd;
    opacity: 1;
}

.date-clear-btn {
    position: absolute;
    right: 6px;
    background: none;
    border: none;
    padding: 0 2px;
    cursor: pointer;
    color: #666;
    font-size: 28px;
    line-height: 1;
    display: flex;
    align-items: center;
}

.date-clear-btn:hover {
    color: #212529;
}

.required-star {
    color: #dc3545;
    margin-left: 2px;
}

.ms-mobile-select .ms-ensure {
    border: 1.5px solid #1e83d3;
    border-radius: 6px;
    width: auto;
    min-width: 76px;
    padding: 0 10px;
    top: 7px;
    height: 31px;
    line-height: 31px;
    font-weight: 600;
    font-size: 13px;
}

.ms-mobile-select .ms-ensure .ion-checkmark {
    font-size: 15px;
    vertical-align: middle;
    margin-right: 2px;
}
