/* =====================================================================
   Thibyan public forms: shared alignment and field styling
   Used by careers.php, institution_affiliation.php,
   thibshore__affiliation.php, 1st_standard_affiliation.php (.enroll-form)
   and admission.php (.kt-login .kt-form). Layout only, no markup changes.
   ===================================================================== */

/* ---------- Affiliation / careers (.enroll-form) ---------- */

/* Rows: equal-width columns whether a row has 2 or 3 fields */
.enroll-form .inner-enroll-form {
    flex-wrap: wrap;
    align-items: flex-end;
}
.enroll-form .inner-enroll-form .input-wrap,
.enroll-form .inner-enroll-form.column-2 .input-wrap,
.enroll-form .inner-enroll-form.column-3 .input-wrap {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    margin-bottom: 18px;
}

/* Labels sit directly above their field; long labels wrap without pushing the field out of line */
.enroll-form .input-wrap label {
    display: block;
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    color: #3d3d3d;
}

/* One look for every text box, dropdown and date field */
.enroll-form input[type="text"],
.enroll-form input[type="email"],
.enroll-form input[type="tel"],
.enroll-form input[type="number"],
.enroll-form input[type="date"],
.enroll-form input[type="Date"],
.enroll-form select,
.enroll-form .form-control {
    display: block;
    width: 100%;
    height: 44px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid #cfd4da;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: none;
    font-size: 14px;
    line-height: 42px;
    color: #333;
    text-indent: 0;
    text-overflow: ellipsis;
}
.enroll-form select {
    padding-right: 34px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23777' stroke-width='1.6' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}
.enroll-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cfd4da;
    border-radius: 8px;
    font-size: 14px;
}
.enroll-form input[type="file"] {
    width: 100%;
    padding: 9px 12px;
    border: 1px dashed #cfd4da;
    border-radius: 8px;
    background: #fafbfc;
    font-size: 13px;
}
.enroll-form input:focus,
.enroll-form select:focus,
.enroll-form textarea:focus {
    border-color: #5dba3b;
    box-shadow: 0 0 0 3px rgba(93, 186, 59, .15);
    outline: none;
}
.enroll-form ::placeholder { color: #9aa0a6; }

/* Section headings inside the form */
.enroll-form h3,
.enroll-form .h3 { margin: 10px 0 18px; }

/* Declaration checkbox: box and text on one line */
.enroll-form .inner-enroll-form > .col-md-1 {
    flex: 0 0 auto;
    width: auto;
    padding-right: 0;
}
.enroll-form .inner-enroll-form > .col-md-11 {
    flex: 1 1 0;
    width: auto;
    line-height: 1.5;
}
.enroll-form input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 3px 0 0;
    accent-color: #5dba3b;
}

/* Submit button row */
.enroll-form .inner-enroll-form > .col-md-8:empty { display: none; }
.enroll-form .inner-enroll-form > .col-md-4 {
    flex: 1 1 100%;
    display: flex;
    justify-content: center;
    margin-top: 10px;
}
.enroll-form button[type="submit"] { margin: 10px auto 0; }

/* Phones and small tablets: one field per line, full width */
@media (max-width: 767px) {
    .enroll-form .inner-enroll-form { flex-direction: column; align-items: stretch; }
    .enroll-form .inner-enroll-form .input-wrap,
    .enroll-form .inner-enroll-form.column-2 .input-wrap,
    .enroll-form .inner-enroll-form.column-3 .input-wrap { flex: 0 0 auto; width: 100%; margin-bottom: 14px; }
    .enroll-form .inner-enroll-form:has(> .col-md-1) { flex-direction: row; align-items: flex-start; }
}

/* ---------- Admission (admission.php) ---------- */

/* Even spacing between rows instead of stray <br> gaps */
.kt-login .kt-form .form-group.row + br,
.kt-login .kt-form .form-group.row > br { display: none; }
.kt-login .kt-form .form-group.row { margin-bottom: 0; }
.kt-login .kt-form .form-group.row > [class*="col-"] { margin-bottom: 16px; }
/* Empty "&nbsp;" spacer labels above the dropdowns (the instructions list label is kept) */
.kt-login .kt-form [class*="col-"] > lable:not(:has(*)) { display: none; }

/* Same field look for inputs, dropdowns and the date picker */
.kt-login .kt-form .form-control,
.kt-login.kt-login--v1 .kt-login__wrapper .kt-login__body .kt-login__form .kt-form .form-group .form-control {
    height: 46px;
    margin-top: 0;
    padding: 0 16px;
    border: 1px solid #d6dae0;
    border-radius: 8px;
    background-color: #fff;
    font-size: 14px;
    color: #333;
    box-shadow: none;
}
.kt-login .kt-form select.form-control,
.kt-login.kt-login--v1 .kt-login__wrapper .kt-login__body .kt-login__form .kt-form .form-group select.form-control {
    padding-right: 36px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23777' stroke-width='1.6' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}
.kt-login .kt-form textarea.form-control { height: auto; min-height: 90px; padding: 12px 16px; }
.kt-login .kt-form .form-control:focus,
.kt-login.kt-login--v1 .kt-login__wrapper .kt-login__body .kt-login__form .kt-form .form-group .form-control:focus {
    border-color: #5dba3b;
    box-shadow: 0 0 0 3px rgba(93, 186, 59, .15);
}
.kt-login .kt-form .form-control::placeholder { color: #8f959c; text-transform: none; }

/* Instructions list and submit button */
.kt-login .kt-form ul { padding-left: 18px; margin-bottom: 4px; line-height: 1.6; }
.kt-login .kt-form .modal-footer { justify-content: center; border-top: 0; padding-top: 4px; }
.kt-login .kt-form .modal-footer .btn { min-width: 160px; height: 46px; border-radius: 8px; font-weight: 600; }

/* Stray <br> spacers between rows make uneven gaps; rows already carry their own spacing */
.enroll-form > br,
.enroll-form .inner-enroll-form + br { display: none; }
.enroll-form .inner-enroll-form:empty { display: none; }

/* Labels and fields placed directly in the form (outside .input-wrap) match the rest */
.enroll-form > label {
    display: block;
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    color: #3d3d3d;
}
.enroll-form > input,
.enroll-form > select { margin-bottom: 18px; }

/* Space above the declaration so it doesn't stick to the last field */
.enroll-form .inner-enroll-form:has(input[type="checkbox"]) { margin-top: 8px; margin-bottom: 6px; }

/* Photo upload: the avatar preview sits on its own line, left-aligned with the fields */
.kt-login .kt-form .kt-avatar { margin: 4px 0 6px; }
.kt-login .kt-form .kt-avatar + .form-text,
.kt-login .kt-form .form-text { display: block; margin-top: 6px; }

/* Any other text-like input (e.g. type="mail") gets the same field style */
.enroll-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]) {
    display: block;
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #cfd4da;
    border-radius: 8px;
    background-color: #fff;
    font-size: 14px;
    color: #333;
}
/* Fields placed straight in the form (e.g. Address) keep the same gap as fields in rows */
.enroll-form > input[name],
.enroll-form > select[name] { margin-bottom: 18px; }

/* Careers: centre the Send button under the form */
.enroll-form > button[type="submit"] { display: block; margin: 16px auto 0; }

/* ---------- Admission: searchable dropdowns (select2) match the other fields ---------- */
.kt-login .kt-form .select2-container { width: 100% !important; }
.kt-login .kt-form .select2-container .select2-selection--single {
    height: 46px;
    border: 1px solid #d6dae0;
    border-radius: 8px;
    background-color: #fff;
}
.kt-login .kt-form .select2-container .select2-selection--single .select2-selection__rendered {
    line-height: 44px;
    padding-left: 16px;
    padding-right: 36px;
    font-size: 14px;
    color: #333;
}
.kt-login .kt-form .select2-container .select2-selection--single .select2-selection__placeholder { color: #8f959c; }
.kt-login .kt-form .select2-container .select2-selection--single .select2-selection__arrow { height: 44px; right: 10px; }
.kt-login .kt-form .select2-container--focus .select2-selection--single,
.kt-login .kt-form .select2-container--open .select2-selection--single { border-color: #5dba3b; }

/* Admission photo upload: visible box even when the default picture is missing */
.kt-login .kt-form .kt-avatar .kt-avatar__holder {
    background-color: #f5f7f9;
    border: 2px dashed #cfd4da;
    background-size: cover;
    background-position: center;
}
.kt-login .kt-form .select2-container .select2-selection--single {
    display: flex !important;
    align-items: center;
    padding: 0 !important;
}
.kt-login .kt-form .select2-container .select2-selection--single .select2-selection__rendered {
    flex: 1;
    margin: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 1.4 !important;
}
.kt-login .kt-form .select2-container .select2-selection--single .select2-selection__arrow { top: 0; }

/* Field blocks placed straight in the form (not inside a row) keep the standard gap */
.enroll-form > .input-wrap { margin-bottom: 18px; }
.enroll-form > .input-wrap label { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 500; line-height: 1.35; color: #3d3d3d; }

/* Admission dropdown arrow centred vertically */
.kt-login .kt-form .select2-container .select2-selection--single .select2-selection__arrow {
    position: absolute;
    top: 50% !important;
    transform: translateY(-50%);
    height: 20px !important;
}
.kt-login .kt-form .select2-container .select2-selection--single .select2-selection__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
}
.kt-login .kt-form .select2-container .select2-selection--single .select2-selection__arrow::before { line-height: 1; }

/* Admission: the 3rd dropdown (Institution) takes the full row instead of leaving a half-empty gap */
.kt-login .kt-form .form-group.row > [class*="col-"]:has(> #select_centers) {
    flex: 0 0 100%;
    max-width: 100%;
}

/* Careers: keep the payment QR code a scannable but sensible size */
.qr-code-section { text-align: center; margin: 6px 0 4px; }
.qr-code-section img,
.qr-code-img img,
img.qr-code-img { width: 180px !important; max-width: 100%; height: auto; display: inline-block; }

/* ---------- Shared: section headings, required marker, actions ---------- */
.enroll-form .tb-form-section {
    margin: 26px 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f1f3f5;
    font-family: 'Baloo', cursive;
    font-size: 19px;
    color: #222;
}
.enroll-form .tb-form-section:first-child { margin-top: 4px; }
.enroll-form .tb-req { color: #e53935; }
.enroll-form .tb-field-hint { display: block; margin-top: 5px; font-size: 12px; color: #8a8f96; }
.enroll-form .tb-form-actions { display: flex; justify-content: center; margin-top: 18px; }
.enroll-form .tb-form-actions button[type="submit"] { margin: 0; }
/* An empty half column keeps a single field at half width */
.enroll-form .inner-enroll-form .input-wrap:empty { margin-bottom: 0; }

/* ---------- Careers: payment box with the QR code centred ---------- */
.careers-form .tb-pay-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 0 0 18px;
    padding: 20px 16px 16px;
    border: 1px solid #e3e6ea;
    border-radius: 12px;
    background: #fafbfc;
}
.careers-form .tb-pay-qr {
    width: 170px;
    max-width: 70%;
    height: auto;
    padding: 8px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
}
.careers-form .tb-pay-amount { margin-top: 12px; font-size: 16px; font-weight: 700; color: #222; }
.careers-form .tb-pay-hint { max-width: 340px; margin-top: 4px; font-size: 12.5px; line-height: 1.5; color: #7a7f86; }

/* Careers: the illustration stays in view beside the long form on desktop */
.careers-side-img { width: 100%; max-width: 520px; height: auto; display: block; margin: 70px auto 0; }
@media (min-width: 992px) {
    .careers-side-img { position: sticky; top: 30px; }
}
@media (max-width: 991px) {
    .careers-side-img { max-width: 360px; margin-top: 10px; }
}
@media (max-width: 767px) {
    .enroll-form .inner-enroll-form .input-wrap:empty { display: none; }
}

/* Careers (desktop): stretch both columns so the illustration can follow the form while scrolling */
@media (min-width: 992px) {
    .contact-content .row:has(.careers-form) { display: flex; }
    .contact-content .row:has(.careers-form)::before,
    .contact-content .row:has(.careers-form)::after { display: none; }
    .contact-content .row:has(.careers-form) > .col-md-6 > .apply-form-wrap:has(.careers-side-img) { height: 100%; }
}

/* ---------- Standard submit button (all public forms) ---------- */
body form button.tb-submit,
.kt-login .kt-form button.tb-submit {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 240px;
    height: 50px;
    margin: 8px auto 0 !important;
    padding: 0 30px !important;
    overflow: visible;
    border: 0 !important;
    border-radius: 10px !important;
    background: linear-gradient(135deg, #5dba3b, #46a12a) !important;
    box-shadow: 0 6px 16px rgba(70, 161, 42, .28);
    color: #fff !important;
    font-family: "Baloo", "Poppins", sans-serif;
    font-size: 19px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: .02em;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
body form button.tb-submit::before { display: none !important; }
body form button.tb-submit::after,
.kt-login .kt-form button.tb-submit::after {
    content: "" !important;
    position: static !important;
    display: inline-block !important;
    width: 18px;
    height: 18px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat !important;
    transform: none !important;
}
body form button.tb-submit:hover,
.kt-login .kt-form button.tb-submit:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 9px 20px rgba(70, 161, 42, .34);
}
body form button.tb-submit:active { transform: translateY(0); box-shadow: 0 4px 10px rgba(70, 161, 42, .25); }
body form button.tb-submit:focus-visible { outline: 3px solid rgba(93, 186, 59, .4); outline-offset: 3px; }
/* The button's row: always centred */
.enroll-form .tb-form-actions,
.enroll-form .inner-enroll-form > .col-md-4:has(> .tb-submit),
.kt-login .kt-form .modal-footer { display: flex; justify-content: center; }
@media (max-width: 575px) {
    body form button.tb-submit,
    .kt-login .kt-form button.tb-submit { width: 100%; min-width: 0; }
}
body form button.tb-submit::after,
.kt-login .kt-form button.tb-submit::after {
    z-index: 1 !important;
    margin: 0 !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    clip-path: none !important;
    opacity: 1 !important;
    flex: 0 0 18px;
}

/* ---------- Thibshore: "Existing Thibyan Institution?" choice step ---------- */
.enroll-form[method="GET"]:has(button[name="ex"]) { max-width: 560px; margin: 0 auto; text-align: center; }
.enroll-form[method="GET"]:has(button[name="ex"]) h3 { text-align: center; margin-bottom: 18px; }
.enroll-form[method="GET"]:has(button[name="ex"]) .inner-enroll-form {
    flex-direction: row;
    justify-content: center;
    gap: 16px;
    margin: 0;
}
.enroll-form[method="GET"]:has(button[name="ex"]) .input-wrap {
    flex: 0 0 auto !important;
    width: auto !important;
    padding: 0;
    margin: 0;
}
.enroll-form[method="GET"]:has(button[name="ex"]) button[name="ex"] { margin: 0 !important; min-width: 170px; }
@media (max-width: 575px) {
    .enroll-form[method="GET"]:has(button[name="ex"]) .inner-enroll-form { flex-direction: column; align-items: stretch; }
    .enroll-form[method="GET"]:has(button[name="ex"]) button[name="ex"] { width: 100%; }
}
