:root {
  --surface: rgba(18, 18, 18, 0.92);
  --surface-soft: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.22);
  --muted: #c7c7c7;
  --warning: #ffd45c;
  --danger: #ff7373;
  --success: #70dc8b;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

img {
  max-width: 100%;
}

code,
small,
p,
li,
span {
  overflow-wrap: anywhere;
}

/* Base Page Setup */
body {
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: url('background.jpg') no-repeat center center fixed;
  background-size: cover;
  color: white;
  line-height: 1.45;
}

/* Dark Overlay Background */
.overlay {
  background-color: rgba(0, 0, 0, 0.7);
  min-height: 100vh;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
}

/* Logo */
.logo {
  display: block;
  width: 110px;
  max-width: 30vw;
  margin: 0 auto 8px;
}

/* Headings */
h1, h2 {
  margin: 4px 0 12px;
  color: white;
}

h3 {
  margin: 0 0 10px;
}

p {
  margin: 6px 0;
}

a {
  color: #fff;
}

/* Centered Form Container */
.content {
  background: var(--surface);
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  max-width: 620px;
  width: 100%;
  margin: 8px auto 0;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
}

/* Optional wrapper inside content for alignment */
.form-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* Form Elements */
input,
textarea,
select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  margin: 5px 0 10px;
  font: inherit;
  color: #111;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid transparent;
  border-radius: 6px;
  box-sizing: border-box;
}

input:focus,
textarea:focus,
select:focus {
  outline: 3px solid rgba(255, 255, 255, 0.25);
  border-color: #fff;
}

input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: #111;
}

input[type="file"] {
  padding: 8px;
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: left;
}

form {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Primary Button */
.button {
  display: inline-block;
  width: auto;
  min-height: 42px;
  padding: 9px 16px;
  font-size: 0.95rem;
  font-weight: bold;
  text-align: center;
  color: white;
  background-color: black;
  border: 2px solid white;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
  margin: 6px 0;
}

.button:hover,
.button:focus-visible {
  background-color: white;
  color: black;
}

.button:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.35);
  outline-offset: 2px;
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
}

form > .button {
  width: 100%;
}

/* Secondary (light) button */
.btn-light {
  background-color: white;
  color: black;
  border: 2px solid black;
}

.btn-light:hover {
  background-color: #f0f0f0;
  color: black;
}

/* Centered "OR" text between buttons */
.or-text {
  margin: 10px 0;
  font-weight: bold;
  color: white;
}

/* Navbar Styles */
.navbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 4px 0 10px;
}

.navbar .button {
  min-width: 120px;
  margin: 0;
}

.worker-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  width: min(720px, 100%);
  margin: 2px auto 10px;
}

.worker-nav .button {
  width: 100%;
  min-width: 0;
  margin: 0;
}

.worker-nav .back-dashboard {
  color: #111;
  background: #fff;
  border-color: #fff;
}

.worker-nav .back-dashboard:hover,
.worker-nav .back-dashboard:focus-visible {
  color: #fff;
  background: #111;
}

.page-shell {
  width: min(1100px, 100%);
  margin: 0 auto;
}

.card {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  text-align: left;
}

.form-grid,
.details-grid,
.reference-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}

.registration-form {
  max-width: 820px;
}

.trade-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 4px;
}

.field-group {
  min-width: 0;
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0 12px;
  padding: 10px;
  background: var(--surface-soft);
  border-radius: 6px;
}

.consent-row label {
  font-weight: 400;
}

.action-grid,
.button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.action-grid .button,
.button-row .button {
  width: 100%;
  margin: 0;
}

.dashboard-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(250px, 0.8fr);
  gap: 14px;
  align-items: start;
}

.dashboard-profile,
.dashboard-alerts {
  grid-column: 1 / -1;
}

.dashboard-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  margin: 0 auto 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.dashboard-actions .button {
  width: 100%;
  margin: 0;
}

.jobs-shell {
  width: 100%;
}

.jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.job-card-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.availability-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--warning);
  color: #17130a;
  font-size: 0.82rem;
  font-weight: bold;
}

.job-details p {
  display: grid;
  grid-template-columns: minmax(105px, 0.8fr) minmax(0, 1.2fr);
  gap: 10px;
  margin: 0;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.job-description {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--muted);
}

.job-application-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.job-application-actions .button {
  margin: 0;
}

.application-badge {
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: #1d4ed8;
  font-weight: bold;
}

.application-under-review,
.application-shortlisted {
  background: var(--warning);
  color: #17130a;
}

.application-accepted {
  background: var(--success);
  color: #102417;
}

.application-rejected,
.application-withdrawn {
  background: var(--danger);
  color: #2b0b0b;
}

.button-disabled {
  opacity: 0.82;
}

.dashboard-notifications {
  text-align: left;
}

.notification-item {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.notification-item:last-child {
  border-bottom: 0;
}

.notification-item small {
  color: var(--muted);
}

.notification-unread {
  border-left: 4px solid var(--warning);
  padding-left: 10px;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
}

.details-grid p,
#bankDetailsDisplay p {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.2fr);
  gap: 10px;
  padding: 8px 0;
  margin: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.details-grid p:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.dashboard-alerts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.status-message,
#documentReminder,
#referencePopup,
#messageBox:not(:empty) {
  padding: 12px 14px;
  border: 1px solid rgba(255, 212, 92, 0.42);
  border-left: 4px solid var(--warning);
  border-radius: 7px;
  background: rgba(255, 212, 92, 0.1);
  text-align: left;
}

.status-message:empty,
#messageBox:empty {
  display: none;
}

#messageBox.error {
  background: rgba(255, 115, 115, 0.1);
  border-color: rgba(255, 115, 115, 0.4);
  border-left-color: var(--danger);
}

#messageBox.success {
  background: rgba(112, 220, 139, 0.1);
  border-color: rgba(112, 220, 139, 0.4);
  border-left-color: var(--success);
}

#documentReminder ul {
  margin: 6px 0 10px;
  padding-left: 20px;
}

#documentReminder .button,
#referencePopup .button {
  width: 100%;
}

.error,
.error-message,
#messageBox.error {
  color: var(--danger);
}

.success,
.ok,
#messageBox.success {
  color: var(--success);
}

.warn,
.notice {
  color: var(--warning);
}

.reference-grid {
  gap: 14px;
  margin-bottom: 12px;
}

.reference-card,
.requirements-card,
.upload-form {
  padding: 16px;
  background: var(--surface-soft);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
}

.requirements-card ul {
  margin: 8px 0;
  padding-left: 20px;
}

.requirements-card li + li {
  margin-top: 5px;
}

.content-box {
  max-width: 1100px;
}

#documentsContainer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  width: 100%;
  margin: 4px 0 18px;
}

.document-card {
  min-height: 245px;
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.document-card img {
  width: 100%;
  height: 105px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 5px;
}

.document-card small {
  color: var(--muted);
}

.document-card .delete-btn {
  width: 100%;
}

.delete-btn:hover,
.delete-btn:focus-visible {
  color: #fff;
  background: #9f2727;
  border-color: #d65b5b;
}

.upload-form {
  margin-top: 4px;
}

.button-group .button {
  width: 100%;
}

#bankDetailsDisplay {
  width: 100%;
}

@media (max-width: 768px) {
  body {
    background-attachment: scroll;
  }

  .overlay {
    min-height: 100svh;
    padding: 12px 12px 20px;
  }

  .logo {
    width: 86px;
    margin-bottom: 5px;
  }

  h1 {
    font-size: 1.55rem;
  }

  h2 {
    font-size: 1.3rem;
    margin-bottom: 9px;
  }

  .content,
  .card {
    width: 100%;
    max-width: none;
    padding: 16px;
    border-radius: 8px;
  }

  input,
  textarea,
  select {
    min-height: 44px;
    font-size: 16px;
  }

  .button {
    min-height: 44px;
    padding: 9px 13px;
  }

  .dashboard-shell,
  .trade-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-shell,
  .dashboard-alerts {
    gap: 10px;
  }

  .details-grid {
    grid-template-columns: 1fr;
  }

  .details-grid p,
  #bankDetailsDisplay p {
    grid-template-columns: minmax(105px, 42%) minmax(0, 1fr);
    gap: 8px;
    padding: 7px 0;
    font-size: 0.92rem;
  }

  .navbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  .navbar .button {
    min-width: 0;
    width: 100%;
  }

  .dashboard-actions {
    padding: 8px;
    margin-bottom: 10px;
  }

  .requirements-card,
  .reference-card,
  .upload-form {
    padding: 14px;
  }

  #documentsContainer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
  }

  .document-card {
    min-width: 0;
    min-height: 230px;
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .form-grid,
  .reference-grid,
  .action-grid,
  .button-row {
    grid-template-columns: 1fr;
  }

  .overlay {
    padding: 10px 10px 16px;
  }

  .content,
  .card {
    padding: 14px;
  }

  .navbar,
  .action-grid,
  .button-row,
  .worker-nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    width: 100%;
  }

  .navbar .button,
  .action-grid .button,
  .button-row .button,
  .worker-nav .button {
    width: 100%;
    margin: 0;
  }

  .dashboard-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  #documentsContainer {
    grid-template-columns: minmax(0, 1fr);
  }

  .document-card {
    min-height: 0;
  }

  .document-card img {
    height: 120px;
  }

  .requirements-card ul {
    padding-left: 18px;
  }

  .consent-row {
    padding: 9px;
  }

  #documentReminder,
  #referencePopup,
  #messageBox:not(:empty) {
    padding: 10px 12px;
  }
}
