/* Careers public UI — list, detail, apply form. Loaded after styles.css so
   Tailwind utilities still win in the cascade where they matter. */

.careers-loading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #94a3b8;
    padding: 2rem;
    justify-content: center;
}

.careers-empty,
.careers-error {
    grid-column: 1 / -1;
    padding: 2rem;
    border-radius: 1rem;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    background: rgba(11, 14, 20, 0.6);
    text-align: center;
    margin-top: 1.5rem;
}

.careers-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    background: linear-gradient(180deg, rgba(11, 14, 20, 0.95), rgba(10, 13, 20, 0.95));
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.careers-card:hover,
.careers-card:focus-visible {
    border-color: rgba(239, 153, 15, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 30px 60px -45px rgba(0, 0, 0, 0.9);
    outline: none;
}

.careers-card-body {
    padding: 1.6rem;
}

.careers-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.9rem;
    font-size: 0.85rem;
    color: #94a3b8;
    align-items: center;
}

/* Job detail typography — mirrors blog-prose but a touch tighter for
   short-form structured copy. */
.job-prose {
    color: #cbd5e1;
    line-height: 1.7;
}

.job-prose h2,
.job-prose h3 {
    color: #fff;
    margin: 1.4em 0 0.6em;
    font-weight: 700;
}

.job-prose h2 { font-size: 1.6rem; }
.job-prose h3 { font-size: 1.25rem; }
.job-prose p { margin: 0.6em 0; }
.job-prose ul,
.job-prose ol { margin: 0.6em 0 0.6em 1.4em; padding-left: 0.4em; }
.job-prose li { margin: 0.25em 0; }
.job-prose strong { color: #fff; }
.job-prose a { color: #EF990F; text-decoration: underline; text-underline-offset: 3px; }
.job-prose code { background: rgba(255, 255, 255, 0.05); padding: 0.1em 0.4em; border-radius: 4px; font-size: 0.95em; }

/* Apply form */
.apply-form {
    display: block;
}

.apply-label {
    display: block;
    font-size: 0.85rem;
    color: #cbd5e1;
    margin-bottom: 0.4rem;
    font-weight: 500;
}

.apply-required {
    color: #EF990F;
}

.apply-input,
.apply-file {
    width: 100%;
    background: rgba(11, 14, 20, 0.85);
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 0.7rem 0.95rem;
    font: inherit;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.apply-input:focus,
.apply-file:focus {
    outline: none;
    border-color: #EF990F;
    background: rgba(11, 14, 20, 0.95);
    box-shadow: 0 0 0 3px rgba(239, 153, 15, 0.15);
}

.apply-file {
    padding: 0.55rem 0.95rem;
}

.apply-file::file-selector-button {
    background: rgba(239, 153, 15, 0.15);
    color: #f1f5f9;
    border: 1px solid rgba(239, 153, 15, 0.4);
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    margin-inline-end: 0.8rem;
    cursor: pointer;
    font: inherit;
}

.apply-file-name {
    color: #94a3b8;
    font-size: 0.8rem;
    margin-top: 0.4rem;
    min-height: 1.1em;
}

.apply-message {
    padding: 0.7rem 1rem;
    border-radius: 0.65rem;
    font-size: 0.9rem;
    line-height: 1.4;
    border: 1px solid transparent;
}

.apply-message[data-kind="info"] {
    background: rgba(45, 127, 249, 0.12);
    border-color: rgba(45, 127, 249, 0.3);
    color: #93c5fd;
}

.apply-message[data-kind="success"] {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.apply-message[data-kind="error"] {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fcd34d;
}

/* Visually-hidden honeypot input — same trick the chat widget uses. */
.pchat-honeypot {
    position: absolute !important;
    left: -10000px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* ===================================================================
 * Apply success → status portal CTA
 * Shown directly under #apply-message after a successful submission.
 * =================================================================== */
.apply-status-portal {
    margin-top: 18px;
    padding: 20px 22px;
    border: 1px solid rgba(239, 153, 15, 0.28);
    background: linear-gradient(180deg, rgba(239, 153, 15, 0.07), rgba(239, 153, 15, 0.02));
    border-radius: 14px;
    color: #f5f5f5;
}
.apply-status-portal-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}
.apply-status-portal-explain {
    color: #d4d4d4;
    font-size: 0.875rem;
    line-height: 1.55;
    margin-bottom: 14px;
}
.apply-status-portal-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.apply-status-portal-input {
    flex: 1 1 240px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.35);
    border-radius: 8px;
    color: #fafafa;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8125rem;
}
.apply-status-portal-input:focus {
    outline: 2px solid #EF990F;
    outline-offset: 2px;
}
.apply-status-portal-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 8px;
    background: #EF990F;
    color: #050505;
    font-weight: 600;
    border: 0;
    cursor: pointer;
    font-size: 0.8125rem;
    transition: filter 0.15s;
}
.apply-status-portal-copy:hover { filter: brightness(1.05); }
.apply-status-portal-open {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #EF990F;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
}
.apply-status-portal-open:hover { text-decoration: underline; }

/* ===================================================================
 * Candidate status portal — /careers/status, /he/careers/status
 * Single centered card. "Boutique" tone — not a dashboard.
 * =================================================================== */
.status-portal {
    position: relative;
    background: rgba(15, 15, 18, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 18px;
    padding: 36px 36px 32px;
    box-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.6);
}
.status-portal-state[hidden] { display: none; }
.status-portal-state-inner[hidden] { display: none; }

.status-portal-spinner {
    text-align: center;
    color: #EF990F;
    font-size: 1.75rem;
    margin-bottom: 12px;
}
.status-portal-loading-text {
    text-align: center;
    color: #a1a1aa;
    font-size: 0.9375rem;
}

.status-portal-eyebrow {
    display: inline-block;
    font-size: 0.6875rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #EF990F;
    font-weight: 600;
    margin-bottom: 12px;
}
.status-portal-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 24px;
}
.status-portal-stage {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 20px;
    border: 1px solid rgba(239, 153, 15, 0.22);
    background: linear-gradient(180deg, rgba(239, 153, 15, 0.06), rgba(239, 153, 15, 0.02));
    border-radius: 12px;
    margin-bottom: 16px;
}
.status-portal-stage-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #d4d4d8;
    font-weight: 600;
}
.status-portal-stage-value {
    font-size: 1.375rem;
    font-weight: 700;
    color: #fff;
}
.status-portal-body {
    color: #d4d4d4;
    line-height: 1.65;
    margin-bottom: 20px;
}
.status-portal-body strong { color: #fff; font-weight: 600; }
.status-portal-inline {
    color: #EF990F;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.status-portal-next {
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.025);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 28px;
}
.status-portal-next-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}
.status-portal-next-body {
    color: #d4d4d4;
    line-height: 1.65;
    font-size: 0.9375rem;
    margin: 0;
}
.status-portal-actions {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 18px;
}
.status-portal-withdraw {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 9px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #f5f5f5;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.9375rem;
    transition: all 0.15s;
}
.status-portal-withdraw:hover {
    border-color: #f87171;
    color: #fca5a5;
    background: rgba(248, 113, 113, 0.05);
}
.status-portal-withdraw-note {
    margin-top: 10px;
    color: #a1a1aa;
    font-size: 0.8125rem;
    line-height: 1.5;
}
.status-portal-withdraw-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.status-portal-withdraw-yes {
    padding: 10px 18px;
    border-radius: 9px;
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.35);
    color: #fca5a5;
    font-weight: 600;
    cursor: pointer;
}
.status-portal-withdraw-yes:hover { background: rgba(248, 113, 113, 0.2); }
.status-portal-withdraw-no {
    padding: 10px 18px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fafafa;
    font-weight: 500;
    cursor: pointer;
}
.status-portal-withdraw-no:hover { background: rgba(255, 255, 255, 0.08); }
.status-portal-signature {
    margin-top: 32px;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.status-portal-signature-name {
    font-family: "Playfair Display", "Heebo", serif;
    font-style: italic;
    color: #f5f5f5;
    font-size: 1.125rem;
}
.status-portal-signature-role {
    font-size: 0.75rem;
    color: #a1a1aa;
    margin-top: 2px;
    letter-spacing: 0.02em;
}
.status-portal-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #EF990F;
    font-weight: 600;
    margin-top: 12px;
    text-decoration: none;
}
.status-portal-back:hover { text-decoration: underline; }

/* RTL adjustments — flip arrow direction handled inline (template uses
 * ph-arrow-right vs ph-arrow-left per locale) so no CSS flip needed. */
[dir="rtl"] .status-portal-eyebrow { letter-spacing: 0.1em; }

/* ===================================================================
 * Candidate account portal — /careers/account
 * Magic-link login + "my applications" list.
 * =================================================================== */
.account-portal {
    position: relative;
    background: rgba(15, 15, 18, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 18px;
    padding: 36px 36px 32px;
    box-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.6);
}
.account-portal-state[hidden] { display: none; }

.account-portal-spinner {
    text-align: center;
    color: #EF990F;
    font-size: 1.75rem;
    margin-bottom: 12px;
}
.account-portal-loading-text {
    text-align: center;
    color: #a1a1aa;
    font-size: 0.9375rem;
}

.account-portal-eyebrow {
    display: inline-block;
    font-size: 0.6875rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #EF990F;
    font-weight: 600;
    margin-bottom: 12px;
}
[dir="rtl"] .account-portal-eyebrow { letter-spacing: 0.1em; }

.account-portal-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 18px;
}
.account-portal-body {
    color: #d4d4d4;
    line-height: 1.65;
    margin-bottom: 20px;
}
.account-portal-body strong { color: #fff; font-weight: 600; }
.account-portal-inline {
    color: #EF990F;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.account-portal-fineprint {
    margin-top: 22px;
    font-size: 0.8125rem;
    color: #a1a1aa;
    line-height: 1.55;
}

/* Login form */
.account-portal-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 6px;
}
.account-portal-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #d4d4d8;
    font-weight: 600;
}
.account-portal-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.35);
    border-radius: 10px;
    color: #fafafa;
    font-size: 0.9375rem;
    font-family: inherit;
}
.account-portal-input:focus {
    outline: 2px solid #EF990F;
    outline-offset: 2px;
}
.account-portal-checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #d4d4d4;
    font-size: 0.875rem;
    cursor: pointer;
}
.account-portal-checkbox-row input { accent-color: #EF990F; }
.account-portal-submit {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 10px;
    background: #EF990F;
    color: #050505;
    font-weight: 700;
    border: 0;
    cursor: pointer;
    font-size: 0.9375rem;
    transition: filter 0.15s;
}
.account-portal-submit:hover { filter: brightness(1.05); }
.account-portal-submit:disabled { opacity: 0.6; cursor: progress; }
.account-portal-link-btn {
    background: transparent;
    border: 0;
    color: #EF990F;
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    padding: 0;
}
.account-portal-inline-error {
    margin-top: 6px;
    color: #fca5a5;
    font-size: 0.8125rem;
}

/* Dashboard header */
.account-portal-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 22px;
}
.account-portal-logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 9px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f5f5f5;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.8125rem;
}
.account-portal-logout:hover {
    border-color: #EF990F;
    color: #EF990F;
}

/* Applications list */
.account-portal-apps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.account-portal-app {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 18px 20px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.account-portal-app[data-terminal="true"] {
    border-color: rgba(239, 153, 15, 0.22);
    background: linear-gradient(180deg, rgba(239, 153, 15, 0.05), rgba(239, 153, 15, 0.01));
}
.account-portal-app[data-withdrawn="true"] {
    opacity: 0.7;
    border-color: rgba(255, 255, 255, 0.04);
    background: rgba(255, 255, 255, 0.02);
}
.account-portal-app[data-erased="true"] { opacity: 0.55; }

.account-portal-app-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px;
    min-width: 96px;
    text-align: center;
}
.account-portal-app-stage-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: oklch(72% 0.16 75); /* default amber */
    box-shadow: 0 0 0 3px oklch(72% 0.16 75 / 18%);
}
.account-portal-app-stage[data-state-key="reviewing"] .account-portal-app-stage-dot,
.account-portal-app-stage[data-state-key="new"] .account-portal-app-stage-dot {
    background: oklch(72% 0.16 75);
    box-shadow: 0 0 0 3px oklch(72% 0.16 75 / 18%);
}
.account-portal-app-stage[data-state-key="interview"] .account-portal-app-stage-dot {
    background: oklch(74% 0.15 230);
    box-shadow: 0 0 0 3px oklch(74% 0.15 230 / 20%);
}
.account-portal-app-stage[data-state-key="offer"] .account-portal-app-stage-dot,
.account-portal-app-stage[data-state-key="hired"] .account-portal-app-stage-dot {
    background: oklch(78% 0.18 145);
    box-shadow: 0 0 0 3px oklch(78% 0.18 145 / 20%);
}
.account-portal-app-stage[data-state-key="rejected"] .account-portal-app-stage-dot {
    background: oklch(60% 0.08 30);
    box-shadow: 0 0 0 3px oklch(60% 0.08 30 / 18%);
}
.account-portal-app-stage-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #f5f5f5;
    line-height: 1.25;
}

.account-portal-app-body { min-width: 0; }
.account-portal-app-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}
.account-portal-app-meta {
    font-size: 0.8125rem;
    color: #a1a1aa;
}
.account-portal-app-note {
    margin-top: 8px;
    font-size: 0.8125rem;
    color: #fcd34d;
    line-height: 1.5;
}
.account-portal-app-desc {
    margin-top: 8px;
    font-size: 0.8125rem;
    color: #a1a1aa;
    line-height: 1.55;
}

.account-portal-submit.is-loading {
    opacity: 0.85;
    cursor: progress;
    position: relative;
}
.account-portal-submit.is-loading::after {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-inline-start: 8px;
    border: 2px solid rgba(5, 5, 5, 0.18);
    border-top-color: #050505;
    border-radius: 50%;
    animation: account-spin 0.7s linear infinite;
    vertical-align: middle;
}
@keyframes account-spin { to { transform: rotate(360deg); } }

/* Skeleton state shown while /api/account/me is in flight (Azure
 * Function cold-start can take 2-3s on the first request). */
.account-portal-skeleton {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 18px 20px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 14px;
}
.account-portal-skeleton-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    animation: account-pulse 1.4s ease-in-out infinite;
}
.account-portal-skeleton-bar {
    height: 12px;
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.09), rgba(255,255,255,0.04));
    background-size: 200% 100%;
    animation: account-shimmer 1.6s linear infinite;
    margin-bottom: 8px;
}
.account-portal-skeleton-bar.short { width: 50%; }
.account-portal-skeleton-bar.long { width: 78%; }
@keyframes account-pulse {
    0%, 100% { opacity: 0.5; }
    50%      { opacity: 0.9; }
}
@keyframes account-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.account-portal-app-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}
.account-portal-app-withdraw {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f5f5f5;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
}
.account-portal-app-withdraw:hover {
    border-color: #f87171;
    color: #fca5a5;
}
.account-portal-app-confirm {
    background: rgba(248, 113, 113, 0.06);
    border: 1px solid rgba(248, 113, 113, 0.25);
    border-radius: 10px;
    padding: 10px;
    font-size: 0.8125rem;
}
.account-portal-app-confirm p {
    margin-bottom: 8px;
    color: #fca5a5;
}
.account-portal-app-confirm-yes,
.account-portal-app-confirm-no {
    width: 100%;
    padding: 6px 10px;
    margin-bottom: 4px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: transparent;
    color: #f5f5f5;
    cursor: pointer;
    font: inherit;
    font-size: 0.8125rem;
}
.account-portal-app-confirm-yes { border-color: rgba(248, 113, 113, 0.5); color: #fca5a5; }
.account-portal-app-confirm-no:hover { background: rgba(255, 255, 255, 0.05); }

.account-portal-empty {
    padding: 28px 20px;
    text-align: center;
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

/* Stacking on narrow viewports */
@media (max-width: 580px) {
    .account-portal { padding: 24px 20px; }
    .account-portal-app {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .account-portal-app-stage {
        flex-direction: row;
        min-width: 0;
        padding: 0;
        gap: 8px;
    }
}
