/* ============================================================
   Infinity Recruitment Pro — public-facing styles
   Apply form, save-job button, candidate dashboard panels.
   Reuses theme tokens (--c-navy, --c-red, --c-text, etc.)
   ============================================================ */

/* ---------- Apply form (#apply on single-job page) ---------- */
.irp-apply { font-family: var(--font-en, Montserrat, Arial, sans-serif); }
.irp-apply__form { display: flex; flex-direction: column; gap: 16px; }
.irp-apply__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.irp-apply__field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.irp-apply__field--full { grid-column: 1 / -1; }
.irp-apply__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--c-navy, #0A152E);
    letter-spacing: 0.01em;
}
.irp-apply__req { color: var(--c-red, #DE1F26); font-weight: 700; }
.irp-apply__field input[type="text"],
.irp-apply__field input[type="email"],
.irp-apply__field input[type="tel"],
.irp-apply__field input[type="url"],
.irp-apply__field textarea,
.irp-apply__field input[type="file"] {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    border: 1px solid var(--c-border, #E5E7EB);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    color: var(--c-navy, #0A152E);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.irp-apply__field textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.irp-apply__field input:focus,
.irp-apply__field textarea:focus {
    outline: none;
    border-color: var(--c-navy, #0A152E);
    box-shadow: 0 0 0 3px rgba(10, 21, 46, 0.08);
}
.irp-apply__hint {
    color: var(--c-text-muted, #6B7280);
    font-size: 12px;
}
.irp-apply__cv-options {
    display: flex; flex-wrap: wrap; gap: 14px; margin: 4px 0;
}
.irp-apply__radio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
}
.irp-apply__consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--c-text-muted, #6B7280);
    line-height: 1.55;
}
.irp-apply__consent input { margin-top: 4px; flex-shrink: 0; }
.irp-apply__submit { align-self: flex-start; }
.irp-apply__login-hint {
    margin: 0;
    color: var(--c-text-muted, #6B7280);
    font-size: 13px;
}
.irp-apply__login-hint a {
    color: var(--c-red, #DE1F26);
    font-weight: 600;
    border-bottom: 1px solid currentColor;
}
.irp-apply__alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin: 0 0 4px;
}
.irp-apply__alert--error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}
.irp-apply__notice {
    padding: 24px;
    background: var(--c-bg-subtle, #FAFAF7);
    border: 1px solid var(--c-border, #E5E7EB);
    border-radius: 12px;
    text-align: center;
}
.irp-apply__notice--success { background: #ECFDF5; border-color: #A7F3D0; }
.irp-apply__notice-title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--c-navy, #0A152E);
}
.irp-apply__notice-lead {
    color: var(--c-text-muted, #6B7280);
    line-height: 1.55;
    margin: 0 0 16px;
}
.irp-apply__pill {
    display: inline-block;
    padding: 4px 12px;
    color: #fff;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

@media (max-width: 640px) {
    .irp-apply__grid { grid-template-columns: 1fr; }
    .irp-apply__submit { width: 100%; }
}

/* ---------- Save-job button (heart/bookmark) ---------- */
.irp-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--c-border, #E5E7EB);
    background: #fff;
    color: var(--c-text, #4A5568);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
    line-height: 1;
}
.irp-save-btn:hover { border-color: var(--c-navy, #0A152E); color: var(--c-navy, #0A152E); }
.irp-save-btn:disabled { opacity: 0.6; cursor: wait; }
.irp-save-btn.is-saved {
    background: var(--c-navy, #0A152E);
    color: #fff;
    border-color: var(--c-navy, #0A152E);
}
.irp-save-btn.is-saved svg path {
    fill: #fff;
    stroke: #fff;
}
.irp-save-btn--hero { font-size: 14px; padding: 10px 18px; margin-left: 12px; }
.irp-save-btn--card {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    padding: 6px 10px;
    font-size: 11px;
    box-shadow: 0 2px 6px rgba(10, 21, 46, 0.08);
}
body.rtl .irp-save-btn--card,
body.infinity-ar .irp-save-btn--card { right: auto; left: 14px; }
body.rtl .irp-save-btn--hero,
body.infinity-ar .irp-save-btn--hero { margin-left: 0; margin-right: 12px; }

/* Job-card wrapper relative-position so the absolute save button sits inside */
.job_listing .job-card__save-wrap { position: relative; z-index: 1; }
.job_listing { position: relative; }

/* ---------- Dashboard: My applications ---------- */
.ia-apps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.ia-app {
    background: #fff;
    border: 1px solid var(--c-border, #E5E7EB);
    border-radius: 12px;
    padding: 20px;
}
.ia-app__head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    margin-bottom: 4px;
}
.ia-app__title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--c-navy, #0A152E);
}
.ia-app__title a { color: inherit; text-decoration: none; }
.ia-app__title a:hover { color: var(--c-red, #DE1F26); }
.ia-app__pill {
    display: inline-block;
    padding: 4px 10px;
    color: #fff;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    flex-shrink: 0;
}
.ia-app__meta {
    color: var(--c-text-muted, #6B7280);
    font-size: 13px;
    margin: 0 0 18px;
}
.ia-app__meta a { color: var(--c-red, #DE1F26); font-weight: 600; border-bottom: 1px solid currentColor; }

.ia-app__progress {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
    position: relative;
}
.ia-app__progress::before {
    content: '';
    position: absolute;
    left: 8%; right: 8%;
    top: 8px;
    height: 2px;
    background: var(--c-border, #E5E7EB);
    z-index: 0;
}
.ia-app__step {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    text-align: center;
    position: relative;
    z-index: 1;
}
.ia-app__step-dot {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--c-border, #E5E7EB);
    transition: background 0.15s ease, border-color 0.15s ease;
}
.ia-app__step-label {
    font-size: 11px;
    color: var(--c-text-muted, #6B7280);
    font-weight: 600;
}
.ia-app__step.is-done .ia-app__step-dot {
    background: #15803D;
    border-color: #15803D;
}
.ia-app__step.is-current .ia-app__step-dot {
    background: var(--c-red, #DE1F26);
    border-color: var(--c-red, #DE1F26);
    box-shadow: 0 0 0 4px rgba(222, 31, 38, 0.2);
}
.ia-app__step.is-current .ia-app__step-label,
.ia-app__step.is-done .ia-app__step-label {
    color: var(--c-navy, #0A152E);
}
.ia-app__progress.is-rejected .ia-app__step-dot {
    background: #FEE2E2;
    border-color: #FCA5A5;
}
.ia-app__progress.is-rejected .ia-app__step.is-done .ia-app__step-dot {
    background: var(--c-red, #DE1F26);
    border-color: var(--c-red, #DE1F26);
}
.ia-app__final {
    margin: 14px 0 0;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
}
.ia-app__final--success { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.ia-app__final--rejected { background: #FEF2F2; color: #991B1B; border: 1px solid #FCA5A5; }

@media (max-width: 640px) {
    .ia-app__progress {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        row-gap: 18px;
    }
    .ia-app__progress::before { display: none; }
}

/* ---------- Dashboard: Saved jobs ---------- */
.ia-saved { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ia-saved__row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid var(--c-border, #E5E7EB);
    border-radius: 10px;
}
.ia-saved__title {
    color: var(--c-navy, #0A152E);
    font-weight: 600;
    text-decoration: none;
    font-size: 15px;
}
.ia-saved__title:hover { color: var(--c-red, #DE1F26); }
.ia-saved__remove {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 0;
    background: transparent;
    color: var(--c-text-muted, #6B7280);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}
.ia-saved__remove:hover { background: var(--c-red, #DE1F26); color: #fff; }

/* ---------- Dashboard: Messages ---------- */
.ia-msgs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ia-msg {
    background: #fff;
    border: 1px solid var(--c-border, #E5E7EB);
    border-left: 3px solid var(--c-navy, #0A152E);
    border-radius: 8px;
    padding: 14px 18px;
}
body.rtl .ia-msg,
body.infinity-ar .ia-msg { border-left: 1px solid var(--c-border, #E5E7EB); border-right: 3px solid var(--c-navy, #0A152E); }
.ia-msg__head {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    margin-bottom: 6px;
}
.ia-msg__head strong { color: var(--c-navy, #0A152E); font-size: 14px; }
.ia-msg__time { color: var(--c-text-muted, #6B7280); font-size: 12px; }
.ia-msg__body {
    color: var(--c-text, #4A5568);
    font-size: 14px;
    line-height: 1.55;
}
.ia-msg__body p:first-child { margin-top: 0; }
.ia-msg__body p:last-child { margin-bottom: 0; }

.ia-empty {
    color: var(--c-text-muted, #6B7280);
    font-size: 14px;
    padding: 24px;
    border: 1px dashed var(--c-border, #E5E7EB);
    border-radius: 10px;
    text-align: center;
}
.ia-empty a {
    color: var(--c-red, #DE1F26);
    font-weight: 600;
    border-bottom: 1px solid currentColor;
}
