/* =========================================================
   Al-Bait Village - Job Application Form
   Add this file AFTER public-site.css
   ========================================================= */

/* Page background and spacing */
.application-section {
    position: relative;
    padding: 72px 0 96px;
    background:
        radial-gradient(circle at 10% 10%, rgba(152, 201, 60, .09), transparent 28%),
        linear-gradient(180deg, #f8fbf9 0%, #f3f7f5 100%);
}

.application-wrap {
    max-width: 1120px;
    margin-inline: auto;
}

.job-application-form {
    display: grid;
    gap: 26px;
}

/* Cards / sections */
.form-card {
    min-inline-size: 0;
    margin: 0;
    padding: 30px;
    border: 1px solid rgba(13, 91, 77, .12);
    border-radius: 24px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 18px 50px rgba(5, 48, 40, .07);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.form-card:hover {
    border-color: rgba(13, 91, 77, .22);
    box-shadow: 0 22px 58px rgba(5, 48, 40, .09);
}

.form-card legend {
    width: auto;
    max-width: 100%;
    margin: 0 0 6px;
    padding: 0 14px;
    color: var(--green, #0d5b4d);
    background: #fff;
    border: 0;
    font-size: 20px;
    font-weight: 900;
    line-height: 1.5;
}

.form-help {
    margin: 0 0 20px;
    padding: 11px 14px;
    border-inline-start: 4px solid var(--lime, #98c93c);
    border-radius: 10px;
    color: var(--muted, #64736f);
    background: #f7faf5;
    font-size: 13px;
    line-height: 1.8;
}

/* Common form layout */
.application-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.application-grid .wide {
    grid-column: 1 / -1;
}

.job-application-form label {
    display: block;
    margin: 0 0 7px;
    color: #24483f;
    font-size: 13px;
    font-weight: 800;
}

.job-application-form input:not([type="hidden"]):not(.honeypot),
.job-application-form select,
.job-application-form textarea {
    display: block;
    width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 11px 14px;
    border: 1px solid #d8e2de;
    border-radius: 12px;
    outline: 0;
    color: #173a32;
    background: #fff;
    font: inherit;
    font-size: 14px;
    line-height: 1.6;
    box-shadow: 0 1px 0 rgba(5, 48, 40, .02);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.job-application-form textarea {
    min-height: 118px;
    resize: vertical;
}

.job-application-form select {
    cursor: pointer;
}

.job-application-form input::placeholder,
.job-application-form textarea::placeholder {
    color: #97a6a1;
    opacity: 1;
}

.job-application-form input:not([type="hidden"]):not(.honeypot):hover,
.job-application-form select:hover,
.job-application-form textarea:hover {
    border-color: #b9cdc6;
}

.job-application-form input:not([type="hidden"]):not(.honeypot):focus,
.job-application-form select:focus,
.job-application-form textarea:focus {
    border-color: var(--green, #0d5b4d);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(13, 91, 77, .10);
}

/* Academic qualifications */
.repeater-table {
    display: grid;
    gap: 14px;
}

.repeater-row {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1.45fr 1.2fr .72fr .82fr;
    gap: 12px;
    align-items: end;
    padding: 18px;
    border: 1px solid #e2ebe7;
    border-radius: 16px;
    background: linear-gradient(180deg, #fbfdfc 0%, #f6faf8 100%);
}

.repeater-row:nth-child(even) {
    background: #fff;
}

.repeater-row::before {
    content: "";
    position: absolute;
    inset-block: 12px;
    inset-inline-start: 0;
    width: 4px;
    border-radius: 4px;
    background: var(--lime, #98c93c);
}

/* Experience */
.experience-row {
    position: relative;
    margin-top: 14px;
    padding: 22px;
    border: 1px solid #e1eae6;
    border-radius: 17px;
    background: #fbfdfc;
}

.experience-row + .experience-row {
    margin-top: 16px;
}

.experience-row:last-child {
    border-bottom: 1px solid #e1eae6;
}

.experience-row::after {
    content: "";
    position: absolute;
    top: 0;
    inset-inline-start: 22px;
    inset-inline-end: 22px;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, var(--green, #0d5b4d), var(--lime, #98c93c));
    opacity: .7;
}

/* References */
.references-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.reference-card {
    position: relative;
    display: grid;
    gap: 13px;
    padding: 22px;
    border: 1px solid #dfe9e5;
    border-radius: 18px;
    background: linear-gradient(180deg, #fff 0%, #fafcfb 100%);
    box-shadow: 0 8px 24px rgba(5, 48, 40, .035);
}

.reference-card h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 4px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e7eeeb;
    color: var(--green, #0d5b4d);
    font-size: 16px;
    font-weight: 900;
}

.reference-card h3::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--lime, #98c93c);
    box-shadow: 0 0 0 5px rgba(152, 201, 60, .14);
}

/* Validation */
.validation-summary-errors {
    margin: 0;
    padding: 16px 18px;
    border: 1px solid #efc5c5;
    border-radius: 14px;
    color: #8f2f2f;
    background: #fff4f4;
    box-shadow: 0 8px 24px rgba(143, 47, 47, .05);
}

.validation-summary-errors ul {
    margin: 8px 0 0;
    padding-inline-start: 22px;
}

.field-validation-error {
    display: block;
    margin-top: 6px;
    color: #b23b3b;
    font-size: 12px;
    font-weight: 700;
}

.input-validation-error {
    border-color: #d65a5a !important;
    background: #fffafa !important;
    box-shadow: 0 0 0 3px rgba(214, 90, 90, .08) !important;
}

/* Submit area */
.application-submit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 26px;
    border: 1px solid rgba(13, 91, 77, .12);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(5, 48, 40, .06);
}

.application-submit .btn {
    min-width: 210px;
    min-height: 52px;
    border-radius: 14px;
    font-size: 15px;
}

.application-submit small {
    max-width: 560px;
    color: var(--muted, #64736f);
    font-size: 12px;
    line-height: 1.8;
}

/* Honeypot */
.honeypot {
    position: absolute !important;
    left: -99999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* RTL / LTR details */
body.rtl .job-application-form input[type="email"],
body.rtl .job-application-form input[type="tel"],
body.rtl .job-application-form input[type="number"],
body.rtl .job-application-form input[type="date"] {
    direction: rtl;
    text-align: right;
}

body.ltr .job-application-form input,
body.ltr .job-application-form textarea,
body.ltr .job-application-form select {
    text-align: left;
}

/* Tablet */
@media (max-width: 1050px) {
    .repeater-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .repeater-row > div:last-child {
        grid-column: span 2;
    }
}

@media (max-width: 820px) {
    .application-section {
        padding: 52px 0 70px;
    }

    .application-grid,
    .references-grid {
        grid-template-columns: 1fr;
    }

    .application-grid .wide {
        grid-column: auto;
    }

    .form-card {
        padding: 24px 20px;
        border-radius: 20px;
    }

    .experience-row,
    .reference-card {
        padding: 18px;
    }

    .application-submit {
        align-items: stretch;
        flex-direction: column;
    }

    .application-submit .btn {
        width: 100%;
    }
}

/* Mobile */
@media (max-width: 560px) {
    .application-section {
        padding: 38px 0 58px;
    }

    .application-wrap {
        width: min(100% - 24px, 1120px);
    }

    .job-application-form {
        gap: 18px;
    }

    .form-card {
        padding: 20px 14px 18px;
        border-radius: 17px;
    }

    .form-card legend {
        padding: 0 8px;
        font-size: 17px;
    }

    .form-help {
        font-size: 12px;
    }

    .application-grid,
    .repeater-row,
    .references-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .repeater-row {
        padding: 16px 13px;
    }

    .repeater-row > div:last-child {
        grid-column: auto;
    }

    .experience-row,
    .reference-card {
        padding: 16px 13px;
        border-radius: 14px;
    }

    .job-application-form input:not([type="hidden"]):not(.honeypot),
    .job-application-form select,
    .job-application-form textarea {
        min-height: 46px;
        padding: 10px 12px;
        font-size: 13px;
    }

    .application-submit {
        padding: 18px 14px;
        border-radius: 16px;
    }
}
