/* TechBru Career Portal – scoped to .tb-portal / .tb-grid so Divi styles don't leak in or out. */

.tb-portal, .tb-grid {
    --tb-accent: #2563eb;
    --tb-ink: #0f172a;
    --tb-body: #334155;
    --tb-muted: #64748b;
    --tb-line: #e2e8f0;
    --tb-soft: #f8fafc;
    --tb-ok: #16a34a;
    --tb-bad: #dc2626;
    --tb-warn: #d97706;
    --tb-radius: 14px;
    box-sizing: border-box;
    color: var(--tb-body);
    font-size: 16px;
    line-height: 1.55;
    text-align: left;
}
.tb-portal *, .tb-portal *::before, .tb-portal *::after,
.tb-grid *, .tb-grid *::before, .tb-grid *::after { box-sizing: border-box; }

.tb-portal { position: relative; max-width: 920px; margin: 0 auto; scroll-margin-top: 120px; }

/* Typography resets (beat Divi's .entry-content / .et_pb_text rules) */
.tb-portal .tb-h3, .tb-grid .tb-card-title { color: var(--tb-ink); font-size: 24px; line-height: 1.25; font-weight: 700; margin: 0 0 8px; padding: 0; }
.tb-portal .tb-h4 { color: var(--tb-ink); font-size: 16px; font-weight: 700; margin: 0 0 8px; padding: 0; }
.tb-portal .tb-p { margin: 0 0 12px; padding: 0; }
.tb-portal .tb-muted { color: var(--tb-muted); }
.tb-portal .tb-hint { color: var(--tb-muted); font-size: 14px; margin: 10px 0 0; padding: 0; }
.tb-portal ul.tb-list, .tb-portal ul.tb-rules, .tb-portal ol.tb-expect-list, .tb-portal ol.tb-qual-list, .tb-portal ol.tb-steps { margin: 0; padding: 0; list-style: none; }
.tb-portal a { color: var(--tb-accent); }

/* Loading */
.tb-portal .tb-boot { display: flex; align-items: center; gap: 12px; justify-content: center; padding: 36px 16px; color: var(--tb-muted); border: 1px solid var(--tb-line); border-radius: var(--tb-radius); background: #fff; }
.tb-portal .tb-spinner { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--tb-line); border-top-color: var(--tb-accent); animation: tb-spin .8s linear infinite; flex: none; }
@keyframes tb-spin { to { transform: rotate(360deg); } }

/* Panels */
.tb-portal .tb-card-panel { background: #fff; border: 1px solid var(--tb-line); border-radius: var(--tb-radius); padding: 28px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06); }
@media (max-width: 600px) { .tb-portal .tb-card-panel { padding: 20px 16px; } }

/* Progress */
.tb-portal .tb-steps { display: flex; gap: 8px; margin: 0 0 16px; flex-wrap: wrap; }
.tb-portal .tb-step { display: flex; align-items: center; gap: 8px; flex: 1 1 0; min-width: 0; padding: 10px 12px; border-radius: 10px; background: var(--tb-soft); border: 1px solid var(--tb-line); color: var(--tb-muted); font-size: 14px; font-weight: 600; }
.tb-portal .tb-step-n { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 1px solid var(--tb-line); font-size: 12px; }
.tb-portal .tb-step-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-portal .tb-step.is-current { border-color: var(--tb-accent); color: var(--tb-ink); background: #fff; }
.tb-portal .tb-step.is-current .tb-step-n { background: var(--tb-accent); border-color: var(--tb-accent); color: #fff; }
.tb-portal .tb-step.is-done .tb-step-n { background: var(--tb-ok); border-color: var(--tb-ok); color: #fff; }
@media (max-width: 640px) { .tb-portal .tb-step-l { display: none; } .tb-portal .tb-step.is-current .tb-step-l { display: inline; } .tb-portal .tb-step { flex: 0 0 auto; } .tb-portal .tb-step.is-current { flex: 1 1 auto; } }

/* Forms */
.tb-portal .tb-label { display: block; font-weight: 600; color: var(--tb-ink); font-size: 14px; margin: 0 0 6px; }
.tb-portal .tb-input, .tb-portal .tb-select {
    display: block; width: 100%; height: auto; min-height: 46px; padding: 11px 14px; margin: 0;
    font: inherit; font-size: 16px; color: var(--tb-ink); background: #fff;
    border: 1px solid #cbd5e1; border-radius: 10px; box-shadow: none; outline: none; appearance: auto;
}
.tb-portal .tb-select { margin-bottom: 18px; }
.tb-portal .tb-input:focus, .tb-portal .tb-select:focus { border-color: var(--tb-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tb-accent) 20%, transparent); }
.tb-portal .tb-file { display: block; width: 100%; padding: 10px; border: 1px dashed #cbd5e1; border-radius: 10px; background: var(--tb-soft); font-size: 14px; }
.tb-portal .tb-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 18px 0 8px; }
.tb-portal .tb-span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .tb-portal .tb-form-grid { grid-template-columns: 1fr; } }
.tb-portal .tb-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--tb-body); cursor: pointer; }
.tb-portal .tb-check input { margin: 4px 0 0; width: 18px; height: 18px; flex: none; accent-color: var(--tb-accent); }

/* Segmented yes/no */
.tb-portal .tb-seg { display: inline-flex; border: 1px solid #cbd5e1; border-radius: 10px; overflow: hidden; margin: 0 0 8px; background: #fff; }
.tb-portal .tb-seg-opt { position: relative; cursor: pointer; margin: 0; }
.tb-portal .tb-seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.tb-portal .tb-seg-opt span { display: block; padding: 9px 18px; font-weight: 600; font-size: 14px; color: var(--tb-body); }
.tb-portal .tb-seg-opt + .tb-seg-opt span { border-left: 1px solid #cbd5e1; }
.tb-portal .tb-seg-opt input:checked + span { background: var(--tb-accent); color: #fff; }
.tb-portal .tb-seg-opt input:focus-visible + span { outline: 2px solid var(--tb-accent); outline-offset: -4px; }

/* Buttons (own classes so Divi's .et_pb_button rules don't apply) */
.tb-portal .tb-btn, .tb-grid .tb-card-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 44px; padding: 10px 20px; margin: 0;
    font: inherit; font-size: 15px; font-weight: 700; line-height: 1.2; letter-spacing: 0; text-transform: none; text-decoration: none;
    border-radius: 10px; border: 1px solid transparent; cursor: pointer; transition: filter .15s, background .15s, transform .05s;
}
.tb-portal .tb-btn::after, .tb-grid .tb-card-btn::after { display: none !important; content: none !important; }
.tb-portal .tb-btn:active { transform: translateY(1px); }
.tb-portal .tb-btn:disabled { opacity: .55; cursor: not-allowed; }
.tb-portal .tb-btn-primary, .tb-grid .tb-card-btn { background: var(--tb-accent); color: #fff; }
.tb-portal .tb-btn-primary:hover:not(:disabled), .tb-grid .tb-card-btn:hover { filter: brightness(1.08); color: #fff; }
.tb-portal .tb-btn-secondary { background: #fff; color: var(--tb-accent); border-color: var(--tb-accent); }
.tb-portal .tb-btn-ghost { background: transparent; color: var(--tb-body); border-color: var(--tb-line); }
.tb-portal .tb-btn-lg { min-height: 50px; padding: 12px 26px; font-size: 16px; }
.tb-portal .tb-btn-rec { background: var(--tb-bad); color: #fff; }
.tb-portal .tb-btn-rec.is-recording { background: var(--tb-ink); }
.tb-portal .tb-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--tb-accent) 40%, transparent); outline-offset: 2px; }

.tb-portal .tb-actions { display: flex; gap: 12px; align-items: center; justify-content: flex-end; flex-wrap: wrap; margin-top: 22px; }
.tb-portal .tb-actions .tb-hint { margin: 0 auto 0 0; }
.tb-portal .tb-actions-left { justify-content: flex-start; margin-top: 12px; }

/* Alerts */
.tb-portal .tb-alert { padding: 12px 16px; border-radius: 10px; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; margin: 12px 0; font-size: 15px; }
.tb-portal .tb-alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.tb-portal .tb-alert[hidden] { display: none; }

/* Upload progress */
.tb-portal .tb-upload-progress { height: 6px; border-radius: 3px; background: var(--tb-line); overflow: hidden; margin-top: 12px; }
.tb-portal .tb-upload-progress[hidden] { display: none; }
.tb-portal .tb-bar { display: block; height: 100%; width: 0; background: var(--tb-accent); transition: width .2s; }

/* Role details */
.tb-portal .tb-role { border-top: 1px solid var(--tb-line); padding-top: 22px; }
.tb-portal .tb-card-panel > .tb-role:first-child { border-top: 0; padding-top: 0; }
.tb-portal .tb-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.tb-portal .tb-chip { font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--tb-soft); border: 1px solid var(--tb-line); color: var(--tb-body); }
.tb-portal .tb-desc { margin-bottom: 18px; }
.tb-portal .tb-desc p { margin: 0 0 10px; padding: 0; }
.tb-portal .tb-desc ul, .tb-portal .tb-desc ol { margin: 0 0 10px 20px; padding: 0; }
.tb-portal .tb-reqs, .tb-portal .tb-expect { background: var(--tb-soft); border: 1px solid var(--tb-line); border-radius: 12px; padding: 16px 18px; margin: 0 0 16px; }
.tb-portal .tb-list li { position: relative; padding: 4px 0 4px 26px; }
.tb-portal .tb-list li::before { content: "✓"; position: absolute; left: 0; top: 4px; color: var(--tb-ok); font-weight: 700; }
.tb-portal .tb-expect-list { counter-reset: tbx; }
.tb-portal .tb-expect-list li { counter-increment: tbx; display: flex; gap: 10px; flex-wrap: wrap; padding: 6px 0; align-items: baseline; }
.tb-portal .tb-expect-list li::before { content: counter(tbx); width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--tb-accent); color: #fff; font-size: 12px; font-weight: 700; flex: none; }
.tb-portal .tb-expect-list strong { color: var(--tb-ink); min-width: 120px; }
.tb-portal .tb-empty { text-align: center; padding: 16px; }

/* Qualifying */
.tb-portal .tb-qual { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--tb-line); }
.tb-portal .tb-qual:last-child { border-bottom: 0; }
.tb-portal .tb-qual-q { margin: 0; padding: 0; color: var(--tb-ink); font-weight: 500; }
.tb-portal .tb-qual .tb-seg { margin: 0; flex: none; }
@media (max-width: 560px) { .tb-portal .tb-qual { flex-direction: column; align-items: flex-start; gap: 8px; } }

/* Video */
.tb-portal .tb-video-list { display: grid; gap: 14px; margin-top: 12px; }
.tb-portal .tb-video-slot { border: 1px solid var(--tb-line); border-radius: 12px; padding: 16px 18px; background: #fff; }
.tb-portal .tb-video-slot.is-done { border-color: color-mix(in srgb, var(--tb-ok) 45%, white); background: #f0fdf4; }
.tb-portal .tb-video-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 6px; color: var(--tb-ink); }
.tb-portal .tb-video-status { font-size: 13px; font-weight: 600; color: var(--tb-muted); }
.tb-portal .tb-video-slot.is-done .tb-video-status { color: var(--tb-ok); }
.tb-portal .tb-video-wrap { position: relative; margin-top: 10px; max-width: 560px; }
.tb-portal .tb-video { display: block; width: 100%; aspect-ratio: 4 / 3; background: #0f172a; border-radius: 10px; object-fit: cover; }
.tb-portal .tb-rec-timer { position: absolute; top: 10px; right: 10px; background: rgba(15, 23, 42, .75); color: #fff; font-weight: 700; font-size: 13px; padding: 4px 10px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.tb-portal .tb-rec-timer.is-live { background: var(--tb-bad); }

/* Assessment */
.tb-portal .tb-rules { margin: 12px 0 0; }
.tb-portal .tb-rules li { position: relative; padding: 8px 0 8px 28px; border-bottom: 1px solid var(--tb-line); }
.tb-portal .tb-rules li::before { content: "•"; position: absolute; left: 8px; color: var(--tb-accent); font-weight: 900; }
.tb-portal .tb-quiz-bar { position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: -28px -28px 20px; padding: 14px 28px; background: #fff; border-bottom: 1px solid var(--tb-line); border-radius: var(--tb-radius) var(--tb-radius) 0 0; }
@media (max-width: 600px) { .tb-portal .tb-quiz-bar { margin: -20px -16px 16px; padding: 12px 16px; } }
.tb-portal .tb-timer { font-size: 20px; font-weight: 800; color: var(--tb-ink); font-variant-numeric: tabular-nums; }
.tb-portal .tb-timer.is-low { color: var(--tb-bad); }
.tb-portal .tb-answered { font-size: 14px; color: var(--tb-muted); font-weight: 600; }
.tb-portal .tb-qnum { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--tb-muted); font-weight: 700; margin: 0 0 6px; padding: 0; }
.tb-portal .tb-qtext { font-size: 20px; line-height: 1.4; color: var(--tb-ink); font-weight: 700; margin: 0 0 16px; padding: 0; user-select: none; }
.tb-portal .tb-options { display: grid; gap: 10px; }
.tb-portal .tb-option { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid #cbd5e1; border-radius: 12px; cursor: pointer; background: #fff; transition: border-color .15s, background .15s; user-select: none; margin: 0; }
.tb-portal .tb-option:hover { border-color: var(--tb-accent); }
.tb-portal .tb-option input { position: absolute; opacity: 0; pointer-events: none; }
.tb-portal .tb-option:focus-within { outline: 3px solid color-mix(in srgb, var(--tb-accent) 35%, transparent); }
.tb-portal .tb-option.is-selected { border-color: var(--tb-accent); background: color-mix(in srgb, var(--tb-accent) 8%, white); }
.tb-portal .tb-option-key { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--tb-soft); border: 1px solid var(--tb-line); font-weight: 700; font-size: 14px; color: var(--tb-body); }
.tb-portal .tb-option.is-selected .tb-option-key { background: var(--tb-accent); border-color: var(--tb-accent); color: #fff; }
.tb-portal .tb-option-text { color: var(--tb-ink); }
.tb-portal .tb-quiz-actions { justify-content: space-between; }
.tb-portal .tb-quiz-actions .tb-btn-primary { margin-left: auto; }
.tb-portal .tb-qnav-wrap { margin-top: 20px; border-top: 1px solid var(--tb-line); padding-top: 14px; }
.tb-portal .tb-qnav-wrap summary { cursor: pointer; font-weight: 600; color: var(--tb-body); font-size: 14px; }
.tb-portal .tb-qnav { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; margin-top: 12px; }
.tb-portal .tb-qnav-btn { height: 40px; padding: 0; margin: 0; border-radius: 8px; border: 1px solid var(--tb-line); background: #fff; font: inherit; font-size: 14px; font-weight: 600; color: var(--tb-body); cursor: pointer; }
.tb-portal .tb-qnav-btn.is-answered { background: color-mix(in srgb, var(--tb-accent) 12%, white); border-color: color-mix(in srgb, var(--tb-accent) 40%, white); color: var(--tb-ink); }
.tb-portal .tb-qnav-btn.is-current { outline: 2px solid var(--tb-accent); outline-offset: 1px; }
.tb-portal .tb-toast { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; padding: 10px 14px; border-radius: 10px; margin: 0 0 14px; font-weight: 600; font-size: 14px; }
.tb-portal .tb-toast[hidden] { display: none; }

/* Modal */
.tb-portal .tb-modal { position: fixed; inset: 0; z-index: 100000; display: grid; place-items: center; padding: 16px; background: rgba(15, 23, 42, .55); }
.tb-portal .tb-modal-box { width: 100%; max-width: 440px; background: #fff; border-radius: var(--tb-radius); padding: 24px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }

/* Done */
.tb-portal .tb-done { text-align: center; padding: 40px 28px; }
.tb-portal .tb-done-icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: #dcfce7; color: var(--tb-ok); font-size: 30px; font-weight: 800; }
.tb-portal .tb-done-icon-warn { background: #fef3c7; color: var(--tb-warn); }

/* ------------------------------------------------------------------ */
/* Vacancies grid                                                      */
/* ------------------------------------------------------------------ */
.tb-grid { display: grid; gap: 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tb-grid.tb-cols-1 { grid-template-columns: 1fr; }
.tb-grid.tb-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tb-grid.tb-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .tb-grid.tb-cols-3, .tb-grid.tb-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .tb-grid.tb-grid { grid-template-columns: 1fr; } }
.tb-grid .tb-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--tb-line); border-radius: var(--tb-radius); padding: 24px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); transition: box-shadow .2s, transform .2s, border-color .2s; }
.tb-grid .tb-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--tb-accent) 40%, white); box-shadow: 0 10px 28px rgba(15, 23, 42, .1); }
.tb-grid .tb-card-dept { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tb-accent); margin-bottom: 8px; }
.tb-grid .tb-card-title { font-size: 20px; }
.tb-grid .tb-card-meta { font-size: 14px; color: var(--tb-muted); margin: 0 0 10px; padding: 0; }
.tb-grid .tb-card-desc { font-size: 15px; margin: 0 0 18px; padding: 0; flex: 1; }
.tb-grid .tb-card-btn { align-self: flex-start; margin-top: auto; }
.tb-grid .tb-empty { grid-column: 1 / -1; text-align: center; color: var(--tb-muted); }

/* Salary + personality */
.tb-portal .tb-salary { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--tb-line); }
.tb-portal .tb-salary .tb-form-grid { margin-top: 8px; }
.tb-portal .tb-money { display: flex; align-items: stretch; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; overflow: hidden; }
.tb-portal .tb-money:focus-within { border-color: var(--tb-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tb-accent) 20%, transparent); }
.tb-portal .tb-money .tb-input { border: 0; border-radius: 0; box-shadow: none; min-width: 0; flex: 1; }
.tb-portal .tb-money-prefix, .tb-portal .tb-money-suffix { display: flex; align-items: center; padding: 0 12px; background: var(--tb-soft); color: var(--tb-muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.tb-portal .tb-money-prefix { border-right: 1px solid var(--tb-line); color: var(--tb-ink); }
.tb-portal .tb-money-suffix { border-left: 1px solid var(--tb-line); }
.tb-portal .tb-pers-block { margin-top: 20px; }
.tb-portal .tb-pers-n { color: var(--tb-muted); font-weight: 600; }
.tb-portal .tb-open-list { display: grid; gap: 18px; margin-top: 8px; }
.tb-portal .tb-textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.tb-portal .tb-char-count { display: block; text-align: right; font-size: 13px; color: var(--tb-warn); margin-top: 4px; }
.tb-portal .tb-char-count.is-ok { color: var(--tb-muted); }

/* Progress: stacked number + label so 5 steps fit without truncation */
.tb-portal .tb-steps { gap: 6px; }
.tb-portal .tb-step { flex-direction: column; justify-content: center; text-align: center; gap: 4px; padding: 8px 6px; font-size: 13px; line-height: 1.25; }
.tb-portal .tb-step-l { white-space: normal; overflow: visible; text-overflow: clip; }
@media (max-width: 640px) {
    .tb-portal .tb-step, .tb-portal .tb-step.is-current { flex: 1 1 0; }
    .tb-portal .tb-step-l { display: none; }
    .tb-portal .tb-step.is-current .tb-step-l { display: none; }
}

/* "Application in progress" notice shown when a vacancy card is clicked mid-application */
.tb-portal .tb-inprogress { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin: 0 0 14px; }
.tb-portal .tb-inprogress .tb-p { margin: 0; flex: 1 1 260px; }

/* Required-field summary and highlighted incomplete fields (3.3.0) */
.tb-portal .tb-problems { margin: 8px 0 0 18px; padding: 0; list-style: disc; }
.tb-portal .tb-problems li { margin: 2px 0; }
.tb-portal .tb-input.tb-invalid, .tb-portal .tb-file.tb-invalid { border-color: #dc2626 !important; box-shadow: 0 0 0 3px rgba(220, 38, 38, .15); }
.tb-portal .tb-file.tb-invalid { border: 1px solid #dc2626; border-radius: 8px; padding: 6px; }
.tb-portal .tb-qual.tb-invalid { background: #fef2f2; box-shadow: inset 3px 0 0 #dc2626; padding-left: 12px; padding-right: 8px; border-radius: 6px; }
.tb-portal .tb-check.tb-invalid { background: #fef2f2; outline: 1px solid #fecaca; border-radius: 8px; padding: 8px; }
.tb-portal .tb-video-slot.tb-invalid { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, .12); }
.tb-portal .tb-btn.is-blocked { opacity: .6; }
