/* ==============================================================
   INNOSOL — Careers (careers.php) and the job application dialog
   Loaded from header.php with service-line.css, company-pages.css and
   forms.css. Rules use the careers-, role- and apply- prefixes.
   ============================================================== */

/* -------------------- Culture and values -------------------- */
.careers-values-link { margin-top: 22px; text-align: center; }
.careers-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 1040px; margin: 0 auto; }
.careers-values div { padding: 20px 22px; border-radius: 16px; background: #fff; border: 1px solid rgba(44,48,147,0.1); border-left: 3px solid var(--brand-orange); }
.careers-values dt { font-family: var(--font-display); font-size: 0.975rem; font-weight: 600; color: var(--ink-900); }
.careers-values dd { margin: 2px 0 0; font-size: 0.8rem; line-height: 1.6; color: var(--text-2); }

/* -------------------- Open roles -------------------- */
.roles-count { max-width: 920px; margin: 0 auto 14px; font-size: 0.8rem; font-weight: 600; color: var(--text-2); }
.roles-list { display: grid; gap: 18px; max-width: 920px; margin: 0 auto; }
.role-card {
    padding: 26px 28px 22px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid rgba(11,18,32,0.1);
    border-left: 4px solid var(--brand-indigo);
    scroll-margin-top: calc(var(--nav-height) + 20px);
    transition: box-shadow var(--dur) ease;
}
.role-card:hover,
.role-card:focus-within { box-shadow: 0 16px 38px rgba(44,48,147,0.1); }
.role-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 20px; margin-bottom: 12px; }
.role-department { margin-bottom: 4px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brand-orange-dark); }
.role-card h3 { font-size: 1.2rem; line-height: 1.3; }
.role-closing {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    background: #FFF6EA;
    font-size: 0.75rem;
    font-weight: 600;
    color: #8A4604;
    white-space: nowrap;
}
.role-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; }
.role-meta li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(44,48,147,0.06);
    font-size: 0.775rem;
    font-weight: 500;
    color: var(--ink-700);
}
.role-meta svg { color: var(--brand-indigo); }
.role-summary { margin-bottom: 14px; font-size: 0.875rem; line-height: 1.7; }

.role-details { margin-bottom: 16px; border-top: 1px solid rgba(11,18,32,0.08); }
.role-details summary {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 8px 0;
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--brand-indigo);
    cursor: pointer;
    list-style: none;
}
.role-details summary::-webkit-details-marker { display: none; }
.role-details summary::before {
    content: "+";
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(44,48,147,0.08);
    font-size: 1rem;
    line-height: 1;
}
.role-details[open] summary::before { content: "−"; }
.role-details summary:hover { color: var(--brand-indigo-deep); text-decoration: underline; text-underline-offset: 4px; }
.role-details summary:focus-visible { outline: 3px solid var(--brand-indigo); outline-offset: 2px; border-radius: 6px; }
.role-details-body { display: grid; gap: 18px; padding: 6px 0 4px; }
.role-details h4 { margin-bottom: 6px; font-size: 0.875rem; }
.role-details p,
.role-details li { font-size: 0.85rem; line-height: 1.7; color: var(--ink-700); }
.role-list { display: grid; gap: 6px; padding-left: 20px; list-style: disc; }
.role-list li::marker { color: var(--brand-orange-dark); }

.role-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.role-apply-nojs { font-size: 0.825rem; color: var(--text-2); }
html.js .role-apply-nojs { display: none; }
html:not(.js) .role-apply { display: none; }

.roles-state {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 32px;
    border-radius: 22px;
    background: var(--surface-soft);
    border: 1px dashed rgba(44,48,147,0.25);
    text-align: center;
}
.roles-state .sl-card-icon { margin: 0 auto 16px; }
.roles-state h3 { margin-bottom: 8px; font-size: 1.15rem; }
.roles-state p { font-size: 0.875rem; line-height: 1.7; }
.roles-state .sl-link { margin-top: 6px; }

.careers-links .sl-card { padding-bottom: 14px; }

/* -------------------- Application dialog -------------------- */
.apply-dialog {
    width: min(640px, calc(100% - 32px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 22px;
    background: #fff;
    color: var(--ink-700);
    box-shadow: 0 30px 80px rgba(11,10,40,0.35);
    overflow: auto;
    overscroll-behavior: contain;
}
.apply-dialog::backdrop { background: rgba(11,10,40,0.6); }
.apply-dialog[open] { animation: apply-in 220ms ease-out; }
@keyframes apply-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
html.apply-open { overflow: hidden; }

.apply-dialog-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 22px 26px 16px;
    background: #fff;
    border-bottom: 1px solid rgba(11,18,32,0.08);
}
.apply-dialog-label { margin-bottom: 2px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brand-orange-dark); }
.apply-dialog h2 { font-size: 1.25rem; line-height: 1.3; }
.apply-close {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: var(--surface-soft);
    color: var(--ink-900);
    cursor: pointer;
}
.apply-close:hover { background: rgba(44,48,147,0.1); color: var(--brand-indigo); }
.apply-close:focus-visible { outline: 3px solid var(--brand-indigo); outline-offset: 2px; }

.apply-form-view { padding: 18px 26px 24px; }
.apply-desc { margin-bottom: 16px; font-size: 0.8rem; line-height: 1.6; color: var(--text-2); }
/* The form sits inside the dialog, so the card frame is not repeated. */
.contact-form.form-card.apply-form { padding: 0; border: 0; border-radius: 0; box-shadow: none; }
.apply-form input[type="file"] {
    width: 100%;
    min-height: 56px;
    padding: 12px;
    border: 1.5px dashed rgba(44,48,147,0.35);
    border-radius: 12px;
    background: var(--surface-soft);
    font-size: 0.825rem;
    cursor: pointer;
}
.apply-form input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 8px 14px;
    border: 0;
    border-radius: 999px;
    background: var(--brand-indigo);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 600;
    cursor: pointer;
}
.apply-form input[type="file"]:focus-visible { outline: 3px solid var(--brand-indigo); outline-offset: 2px; }
.apply-form .field.has-error input[type="file"] { border-color: #B2242C; }
.field-hint { margin-top: 6px; font-size: 0.75rem; color: var(--text-2); }
.apply-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.apply-actions .btn { flex: 1 1 auto; justify-content: center; }
.apply-form .btn[disabled] { opacity: 0.75; cursor: progress; transform: none; }

.apply-success { padding: 36px 28px 32px; text-align: center; }
.apply-success:focus { outline: none; }
.apply-success .sl-card-icon { margin: 0 auto 16px; background: rgba(21,128,61,0.1); color: #166534; }
.apply-success h3 { margin-bottom: 8px; font-size: 1.2rem; }
.apply-success p { margin-bottom: 20px; line-height: 1.7; }

/* -------------------- Responsive -------------------- */
@media (max-width: 1024px) {
    .careers-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .careers-values { grid-template-columns: minmax(0, 1fr); }
    .role-card { padding: 22px 18px 18px; }
    .role-actions .btn { width: 100%; }
    .roles-state { padding: 32px 20px; }
    .apply-dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); border-radius: 18px; }
    .apply-dialog-head { padding: 16px 18px 12px; }
    .apply-form-view { padding: 14px 18px 20px; }
    .apply-actions { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    .apply-dialog[open] { animation: none; }
    .role-card { transition: none; }
}
