/* Candidate Portal, Employer Portal & LOS shared component styles -
   layered on top of style.css's navy/gold/cream tokens, never
   redefining them. */

/* Deliberately NOT named .portal-panel - style.css already owns that
   class for the old dark "Coming Soon" component (white h1/p forced by
   .portal-panel h1/.portal-panel p there), which this white-background
   card would silently inherit and render invisible white-on-white. */
.portal-auth-panel {
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: 0 18px 40px rgba(7, 26, 47, 0.08);
}

.portal-auth-tabs {
  display: flex;
  gap: 4px;
  margin: 18px 0 22px;
  border-bottom: 1px solid var(--hairline);
}
.portal-auth-tab {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 4px;
  margin-right: 20px;
  font: inherit;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
}
.portal-auth-tab.is-active { color: var(--navy); border-bottom-color: var(--gold); }
.portal-auth-tab:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.portal-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 640px) {
  .portal-form-grid { grid-template-columns: 1fr 1fr; }
  .portal-form-field-full { grid-column: 1 / -1; }
}
.portal-form-field { display: flex; flex-direction: column; gap: 6px; }
.portal-form-field label { font-weight: 700; font-size: 0.92rem; color: var(--navy); }
.portal-form-field small { color: var(--text-muted); font-size: 0.8rem; }
.portal-form-field input,
.portal-form-field select,
.portal-form-field textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--white);
  color: var(--text);
  width: 100%;
}
.portal-form-field input:focus-visible,
.portal-form-field select:focus-visible,
.portal-form-field textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.portal-form { margin-top: 8px; }
.portal-form .button { margin-top: 16px; }
.portal-form-message { min-height: 1.4em; margin-top: 12px; font-weight: 700; color: var(--navy); }
.portal-form-message.is-error { color: #a3312c; }
.portal-form-footnote { margin-top: 10px; }

.link-button {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--navy);
  text-decoration: underline;
  cursor: pointer;
}
.link-button:hover { color: var(--gold); }

.portal-inline-form { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.portal-inline-form input {
  flex: 1 1 200px;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
}

/* Dashboard shell */
.portal-dashboard-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.portal-dashboard-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
}

.portal-notification-bell {
  position: relative;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  padding: 6px;
}
.portal-notification-count {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--gold);
  color: var(--navy);
  font-size: 0.7rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
}
.portal-notification-panel {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 30;
  width: min(340px, 90vw);
  max-height: 380px;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(7, 26, 47, 0.16);
  padding: 12px;
  margin-top: 8px;
}
.portal-notification-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.portal-notification-item { padding: 10px; border-radius: 8px; background: var(--light); }
.portal-notification-item.is-unread { background: rgba(201, 162, 39, 0.14); cursor: pointer; }
.portal-notification-item p { margin: 4px 0; }

/* Cards & grids */
.portal-card {
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.portal-card h2 { margin-top: 0; color: var(--navy); }
.portal-card-note { color: var(--text-muted); font-size: 0.92rem; }
.portal-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 800px) {
  .portal-grid-2 { grid-template-columns: 1fr 1fr; }
}

/* Checklist */
.portal-checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.portal-checklist-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--light);
  color: var(--text-muted);
  font-size: 0.88rem;
}
.portal-checklist-item.is-complete { background: rgba(201, 162, 39, 0.16); color: var(--navy); font-weight: 700; }
.portal-checklist-mark { font-size: 0.9rem; }
.portal-checklist-summary { list-style: none; font-weight: 700; color: var(--navy); margin-left: auto; }

/* Tags (skills) */
.portal-tag-list { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.portal-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--light);
  border-radius: 999px;
  padding: 6px 8px 6px 14px;
  font-size: 0.9rem;
}
.portal-tag-remove {
  appearance: none;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 2px 4px;
}
.portal-tag-remove:hover { color: #a3312c; }

/* Experience */
.portal-experience-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.portal-experience-item-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* Vacancies & applications */
.portal-vacancy-list,
.portal-application-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.portal-vacancy-item,
.portal-application-item {
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 16px;
}
.portal-vacancy-item-header,
.portal-application-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.portal-badge {
  display: inline-block;
  background: rgba(201, 162, 39, 0.18);
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.portal-badge-urgent { background: rgba(163, 49, 44, 0.14); color: #a3312c; }
.portal-badge-muted { background: var(--light); color: var(--text-muted); }
.portal-empty-note { color: var(--text-muted); }

.portal-progress-track { background: var(--light); border-radius: 999px; height: 8px; margin: 10px 0; overflow: hidden; }
.portal-progress-fill { background: var(--gold); height: 100%; }

/* Modal */
.portal-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
}
/* The [hidden] attribute is only display:none in the user-agent
   stylesheet, which author CSS overrides at equal specificity - without
   this, .portal-modal's own display:flex above wins and every modal
   (Candidate/Employer/LOS) renders open by default. */
.portal-modal[hidden] {
  display: none;
}
.portal-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 16, 28, 0.55);
}
.portal-modal-panel {
  position: relative;
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  width: min(560px, 100%);
  z-index: 1;
  margin-top: 40px;
}
.portal-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.portal-modal-close {
  appearance: none;
  border: 1px solid var(--hairline);
  background: none;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font: inherit;
}
.portal-timeline { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.portal-timeline li { border-left: 3px solid var(--gold); padding-left: 12px; }

@media (max-width: 480px) {
  .portal-panel { padding: 24px 18px; }
  .portal-dashboard-header { flex-direction: column; }
  .portal-notification-panel { right: -8px; width: min(300px, 94vw); }
}
