/* Jobs Armada site: additions to the design stylesheet (ja-design.css = Design/www/css/style.css, unchanged).
   Only what the Laravel pages need beyond the static design: account menu, alerts, confirm dialog,
   searchable selects, real images in avatar/logo tiles, small layout helpers. Uses the design's tokens. */

/* ---------- Header: Browse menu separator, account dropdown ---------- */

.nav-menu-sep { display: block; height: 1px; margin: 6px 8px; background: var(--line); }

.header-actions .account-drop .nav-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  display: none;
  min-width: 220px;
  padding: 8px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}
.header-actions .account-drop:hover .nav-menu,
.header-actions .account-drop:focus-within .nav-menu,
.header-actions .account-drop.is-open .nav-menu { display: flex; }
.header-actions .account-drop::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 8px; } /* hover bridge */
.account-drop .nav-menu a,
.account-drop .nav-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--ink);
}
.account-drop .nav-menu a:hover,
.account-drop .nav-menu button:hover { background: var(--lav-50); color: var(--purple); }
.account-drop .nav-menu .icon { width: 18px; height: 18px; }

/* ---------- Page head ---------- */

.page-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.page-head .breadcrumb span { overflow-wrap: anywhere; }

/* ---------- Alerts (x-alert theme="site") ---------- */

.alert .alert-body, .alert > div { flex: 1; min-width: 0; }
.alert--danger { background: #fdecee; }
.alert--danger .icon { color: #c22537; }
.alert-close {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: -3px -6px -3px 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
.alert-close:hover { background: rgba(23, 18, 58, .06); color: var(--ink); }
.alert .alert-close .icon { width: 16px; height: 16px; margin: 0; color: inherit; }
.cg-flash-stack { display: grid; gap: 12px; }
.jobs .cg-flash-stack { margin-bottom: 24px; }
.auth-card .alert { margin-top: 22px; }

/* ---------- Buttons and links ---------- */

.link-button { padding: 0; border: 0; background: none; cursor: pointer; }
button.text-link { display: inline-flex; align-items: center; gap: 6px; }
.pager-next .icon { transform: scaleX(-1); }
.btn-block { width: 100%; }
.footer-cta { margin-top: 14px; }
.go-back .icon { width: 16px; height: 16px; }

/* ---------- Layout helpers ---------- */

.nowrap { white-space: nowrap; }
.home-tags { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.aside-skills { margin-top: 18px; }
.job-skills--flush { margin: 0; }
.check-row--spaced { margin-top: 20px; }
.form-actions--flush { margin-top: 0; }
.stat-grid--3 { grid-template-columns: repeat(3, 1fr); }
.kv-para + .kv-para { margin-top: 12px; }
.kv-line + .kv-line { margin-top: 6px; }
.kv-line .badge { margin-left: 6px; }
.apply-options { margin-top: 18px; }
.apply-saved { margin-bottom: 20px; }
.apply-message strong { display: block; color: var(--ink); }
.upload-row-drop { flex: 1; min-width: 0; }
.auth-inline-form { margin-top: 16px !important; display: flex !important; justify-content: center; }
.auth-card .auth-sub + .btn-google { margin-top: 26px; }
.repeat-row > .field { gap: 6px; }

/* Real images in the design's letter tiles */
.thumb--img { object-fit: cover; background: var(--lav-50); }
.company-logo { flex: none; width: 60px; height: 58px; border-radius: 14px; object-fit: cover; background: var(--lav-50); }
.comment img.avatar, .side-user img.avatar { object-fit: cover; background: var(--lav-100); }

/* Job descriptions and CMS pages come from a rich text editor */
.prose { overflow-wrap: anywhere; }
.prose img { max-width: 100%; height: auto; }
.prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.prose td, .prose th { padding: 6px 10px; border: 1px solid var(--line); }
.comment-content > * + * { margin-top: 8px; }
.comment-content { margin-top: 4px; font-size: var(--text-size); letter-spacing: -.02em; overflow-wrap: anywhere; }
.comment-body .comment-form { margin-top: 16px; padding: 18px; border-radius: 14px; background: var(--lav-50); }
.comment-form-fields { display: grid; gap: 12px; }
.comment-form-fields .form-actions { margin-top: 0; }
.comments + .pager { margin-top: 24px; }

/* Account side menu: Logout is a form button */
.side-nav form { margin: 0; }
.side-nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--ink);
}
.side-nav button:hover { color: #c22537; background: #fdecee; }
.side-nav button .icon { width: 20px; height: 20px; }
.side-user > div:last-child { min-width: 0; }
.side-user b { overflow-wrap: anywhere; }

/* Password rules turn green as they are met */
.criteria li.is-valid { color: var(--green); }
.criteria li.is-valid .icon { color: var(--green); }

/* ---------- Confirm dialog (forms with data-confirm; never the browser's confirm()) ---------- */

.ja-dialog {
  width: min(440px, calc(100% - 32px));
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
  color: var(--text);
  box-shadow: 0 24px 60px rgba(30, 10, 80, .25);
}
.ja-dialog::backdrop { background: rgba(21, 16, 51, .45); }
.ja-dialog h2 { font-size: 22px; font-weight: 700; letter-spacing: -.03em; color: var(--ink); }
.ja-dialog p { margin-top: 8px; font-size: var(--text-size); letter-spacing: -.02em; }
.ja-dialog .form-actions { margin-top: 22px; }

/* ---------- Searchable select (public/js/admin/searchable-select.js) in the design's field style ---------- */

.ja-ss { position: relative; }
.ja-ss-trigger {
  display: flex;
  align-items: center;
  width: 100%;
  height: var(--control-h);
  padding: 0 40px 0 14px;
  border: 1px solid #d9d5e6;
  border-radius: 12px;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2317123a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 13px center / 18px;
  text-align: left;
  font-size: 16px;
  letter-spacing: -.015em;
  color: var(--ink);
}
.ja-ss-trigger:focus, .ja-ss.is-open .ja-ss-trigger { outline: 0; border-color: var(--purple-bright); box-shadow: 0 0 0 3px rgba(138, 43, 236, .18); }
.ja-ss-trigger.is-invalid { border-color: #d62a45; }
.ja-ss-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ja-ss-value.ja-ss-placeholder { color: #8a86a0; }
.ja-ss-panel {
  display: none;
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  width: max(100%, 280px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  box-shadow: var(--shadow-md);
}
.ja-ss.is-open .ja-ss-panel { display: block; }
.ja-ss-search {
  display: block;
  width: calc(100% - 16px);
  height: 40px;
  margin: 8px;
  padding: 0 12px;
  border: 1px solid #d9d5e6;
  border-radius: 10px;
  outline: 0;
  font-size: 15px;
}
.ja-ss-search:focus { border-color: var(--purple-bright); }
.ja-ss-list { max-height: 260px; margin: 0; padding: 0 0 6px; overflow-y: auto; overscroll-behavior: contain; list-style: none; border-top: 1px solid var(--line); }
.ja-ss-list li { display: flex; align-items: center; gap: 8px; padding: 9px 14px; font-size: 15px; cursor: pointer; outline: none; }
.ja-ss-list li:hover, .ja-ss-list li:focus { background: var(--lav-50); }
.ja-ss-list li.is-selected { font-weight: 700; color: var(--purple); }
.ja-ss-list li.is-selected::after { content: "\2713"; margin-left: auto; }
.ja-ss-multiple .ja-ss-list li::before { content: ""; flex: 0 0 16px; height: 16px; border: 1px solid #c9c4da; border-radius: 4px; background: var(--white); }
.ja-ss-multiple .ja-ss-list li.is-selected::before { border-color: var(--purple); background: var(--purple); }
.ja-ss-multiple .ja-ss-list li.is-selected::after { content: none; }
.ja-ss-list li.ja-ss-empty { color: var(--muted); cursor: default; }
.ja-ss-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ja-ss-chips:not(:empty) { margin-top: 8px; }
.ja-ss-chip { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 11px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--purple); background: var(--lav-100); }
.ja-ss-chip-remove { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; }
.ja-ss-chip-remove:hover, .ja-ss-chip-remove:focus-visible { background: var(--lav-200); }
.ja-ss-chip-remove i { font-style: normal; }
.ja-ss-chip-remove i::before { content: "\00d7"; font-size: 16px; line-height: 1; }

/* ---------- Responsive ---------- */

@media (max-width: 940px) {
  .home-tags { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .form-grid-spacer { display: none; }
  .stat-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .page-head-actions { justify-content: flex-start; }
  .toolbar { width: 100%; }
  .toolbar .select { flex: 1; min-width: 0; }
}

@media (max-width: 480px) {
  /* The design hides every .btn-soft on phones; guests still need "Login". */
  .header-actions .btn-soft--text { display: inline-flex; padding: 9px 10px; }
}

/* Password label sits in a .label-row (with "Forgot password?"): same look as other field labels */
.field .label-row label { font-size: 14.5px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }

/* ---------- Phones (checked in headless WebKit at 375 / 414 / 768 px) ---------- */

@media (max-width: 720px) {
  /* Account area: the side menu becomes one swipeable row of pills, so the page content starts near the top. */
  .side { padding: 12px; }
  .side-user { padding: 2px 2px 12px; margin-bottom: 10px; }
  .side-user .avatar { width: 40px; height: 40px; font-size: 14px; }
  .side-nav {
    display: flex;
    gap: 6px;
    margin: 0 -12px;
    padding: 0 12px 2px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-nav hr { display: none; }
  .side-nav form { flex: none; }
  .side-nav a, .side-nav button { flex: none; width: auto; padding: 9px 13px; font-size: 14.5px; white-space: nowrap; background: var(--lav-50); }
  .side-nav a.is-active { background: var(--lav-100); }
  .side-nav .icon { width: 18px; height: 18px; }
  .side-nav .count-pill { margin-left: 2px; }

}

@media (max-width: 940px) {
  /* Tables scroll sideways; keep the first (title) column readable instead of one word per line. */
  .data td:first-child { min-width: 200px; }
}

@media (max-width: 480px) {
  /* Guests: logo and menu button on the first row, theme / Login / Register on their own row. */
  .header-actions--guest { order: 5; width: 100%; justify-content: flex-end; gap: 8px; }
}

@media (max-width: 370px) {
  .header-actions { order: 5; width: 100%; justify-content: flex-end; gap: 8px; }
}

/* =====================================================================
   Dark mode: html[data-theme="dark"] (set in <head> from the saved choice or the device setting;
   switch in the header, public/js/ja-site.js). The design's tokens are re-pointed, then every
   surface the design hard-codes in light colours gets its dark twin. --white stays white: the
   design also uses it for text on purple buttons.
   ===================================================================== */

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0b22;
  --surface: #18132f;
  --surface-2: #211a40;
  --field: #140f2a;
  --field-line: #3a3266;
  --purple: #b48cff;
  --purple-bright: #a774ff;
  --purple-ink: #c4a3ff;
  --lav-50: #1c1638;
  --lav-100: #261e4b;
  --lav-200: #33296a;
  --ink: #f2effc;
  --text: #d2cde8;
  --muted: #a39dc2;
  --line: #2e2754;
  --green: #62d47c;
  --green-bg: #15341f;
  --navy: #0a0719;
  --navy-line: #262046;
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, .35);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, .45);
}

[data-theme="dark"] body { background: var(--bg); color: var(--text); }
[data-theme="dark"] ::selection { background: #5a2bb0; color: #fff; }

/* Header */
[data-theme="dark"] .btn-soft { background: var(--surface-2); color: var(--ink); }
[data-theme="dark"] .btn-soft:hover { background: var(--lav-200); color: var(--ink); }
[data-theme="dark"] .icon-btn .dot { border-color: var(--bg); }
[data-theme="dark"] .nav-menu,
[data-theme="dark"] .main-nav.is-open { background: var(--surface); border-color: var(--line); }
@media (max-width: 940px) {
  [data-theme="dark"] .main-nav { background: var(--surface); border-color: var(--line); }
  [data-theme="dark"] .main-nav .nav-menu { background: transparent; }
}

/* Hero, page head, hiring banner */
[data-theme="dark"] .hero-card,
[data-theme="dark"] .page-head {
  background:
    radial-gradient(900px 420px at 100% 0%, #2d1f5e 0%, rgba(45, 31, 94, 0) 70%),
    linear-gradient(180deg, #1d1641 0%, #161132 100%);
}
[data-theme="dark"] .search { background: var(--surface); }
[data-theme="dark"] .site-footer { border-top: 1px solid var(--line); }
[data-theme="dark"] .search-field--location { border-left-color: var(--line); }
@media (max-width: 720px) {
  [data-theme="dark"] .search-field--location { border-top-color: var(--line); }
}
[data-theme="dark"] .search select option { background: var(--surface); color: var(--ink); }
[data-theme="dark"] .chip { background: var(--surface); }
[data-theme="dark"] .hiring-icon { color: #6c1bd0; }
[data-theme="dark"] .btn-white { color: #5a14b8; }

/* Cards, panels, tags */
[data-theme="dark"] .job-card,
[data-theme="dark"] .panel,
[data-theme="dark"] .side,
[data-theme="dark"] .auth-card { background: var(--surface); border-color: var(--line); }
[data-theme="dark"] .job-card:hover { border-color: #4b3c8c; }
[data-theme="dark"] .job-card--featured { border-color: #5a43a8; background: linear-gradient(180deg, #221a46 0%, var(--surface) 60%); }
[data-theme="dark"] .job-logo--purple { color: #c4a3ff; background: #2c2262; }
[data-theme="dark"] .job-logo--pink { color: #ff7fae; background: #3c1a30; }
[data-theme="dark"] .job-logo--green { color: #62d47c; background: #15341f; }
[data-theme="dark"] .tag { background: var(--surface-2); }
[data-theme="dark"] .count-pill { background: #7c3aed; color: #fff; }

/* Buttons */
[data-theme="dark"] .btn-outline { background: transparent; box-shadow: inset 0 0 0 1.5px #4b3c8c; }
[data-theme="dark"] .btn-outline:hover { background: var(--lav-50); box-shadow: inset 0 0 0 1.5px var(--purple); }
[data-theme="dark"] .btn-plain,
[data-theme="dark"] .icon-action { background: var(--surface-2); color: var(--ink); }
[data-theme="dark"] .btn-plain:hover,
[data-theme="dark"] .icon-action:hover { background: var(--lav-200); color: var(--ink); }
[data-theme="dark"] .btn-danger { background: #3d1822; color: #ff8d9b; }
[data-theme="dark"] .btn-danger:hover { background: #52202d; }
[data-theme="dark"] .icon-action--danger:hover { background: #3d1822; color: #ff8d9b; }
[data-theme="dark"] .btn-google { background: transparent; box-shadow: inset 0 0 0 1px var(--field-line); }
[data-theme="dark"] .btn-google:hover { background: var(--lav-50); }

/* Form fields */
[data-theme="dark"] .input,
[data-theme="dark"] .select,
[data-theme="dark"] .textarea,
[data-theme="dark"] .ja-ss-trigger,
[data-theme="dark"] .ja-ss-search { background-color: var(--field); border-color: var(--field-line); color: var(--ink); }
[data-theme="dark"] .select,
[data-theme="dark"] .ja-ss-trigger {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ece8ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
[data-theme="dark"] .input::placeholder,
[data-theme="dark"] .textarea::placeholder { color: #7f78a3; }
[data-theme="dark"] .input[readonly] { background: #1a1536; color: var(--muted); }
[data-theme="dark"] .is-invalid,
[data-theme="dark"] .ja-ss-trigger.is-invalid { border-color: #ff6b81; }
[data-theme="dark"] .field-error { color: #ff8d9b; }
[data-theme="dark"] .field .req { color: #ff6b81; }
[data-theme="dark"] .choice span { background: transparent; box-shadow: inset 0 0 0 1px var(--field-line); }
[data-theme="dark"] .choice input:checked + span { background: var(--grad); box-shadow: none; color: #fff; }
[data-theme="dark"] .file-drop { border-color: #4b3c8c; }
[data-theme="dark"] .criteria .icon { color: #5d567f; }
[data-theme="dark"] .criteria li.is-valid .icon { color: var(--green); }

/* Alerts, badges, tables, pager */
[data-theme="dark"] .alert--warning { background: #382b0e; }
[data-theme="dark"] .alert--warning .icon { color: #f2b84b; }
[data-theme="dark"] .alert--danger { background: #3d1822; }
[data-theme="dark"] .alert--danger .icon { color: #ff8d9b; }
[data-theme="dark"] .alert-close:hover { background: rgba(255, 255, 255, .08); }
[data-theme="dark"] .badge--amber { color: #f2b84b; background: #382b0e; }
[data-theme="dark"] .badge--red { color: #ff8d9b; background: #3d1822; }
[data-theme="dark"] .badge--grey { color: var(--muted); background: #252043; }
[data-theme="dark"] .pager a,
[data-theme="dark"] .pager span { background: var(--surface); }
[data-theme="dark"] .pager .is-current { background: var(--grad); color: #fff; }
[data-theme="dark"] .pager .is-off { color: #5d567f; }

/* Account menu, dialog, searchable select */
[data-theme="dark"] .side-nav button:hover { background: #3d1822; color: #ff8d9b; }
[data-theme="dark"] .ja-dialog { background: var(--surface); border-color: var(--line); color: var(--text); }
[data-theme="dark"] .ja-dialog::backdrop { background: rgba(0, 0, 0, .6); }
[data-theme="dark"] .ja-ss-panel { background: var(--surface); border-color: var(--line); }
[data-theme="dark"] .ja-ss-multiple .ja-ss-list li::before { background: var(--field); border-color: var(--field-line); }
[data-theme="dark"] .ja-ss-multiple .ja-ss-list li.is-selected::before { background: #7c3aed; border-color: #7c3aed; }

/* Rich text from the editor may carry inline light backgrounds: keep text readable */
[data-theme="dark"] .prose [style*="background"] { background: transparent !important; }
[data-theme="dark"] .prose [style*="color"] { color: inherit !important; }

/* Sign-in logo and Google mark stay as they are; the TinyMCE editor switches to its dark skin (admin/shared/rich-editor). */
