/**
 * Hiire Design System
 * Master styles for all Hiire portals (admin, candidate, client).
 * Direction 02 "Sharp" — flat fills, no shadows, no gradients.
 */

@import url("https://fonts.googleapis.com/css2?family=Archivo:wght@700;800&family=IBM+Plex+Sans:wght@400;500;600&display=swap");

/* --------------------------------------------------------------------------
   Design tokens
   -------------------------------------------------------------------------- */

:root {
  /* Colour */
  --hiire-primary:       #15233F;
  --hiire-secondary:     #2C3E5E;
  --hiire-accent:        #C45D2E;
  --hiire-accent-hover:  #B15428;
  --hiire-accent-soft:   rgba(196, 93, 46, 0.10);
  --hiire-background:    #F6F1E8;
  --hiire-surface:       #FCFAF4;
  --hiire-surface-alt:   #FFFFFF;
  --hiire-border:        #E3DACB;
  --hiire-border-strong: #D6CAB4;
  --hiire-text-primary:  #15233F;
  --hiire-text-secondary:#5C6678;
  --hiire-text-muted:    #8A8F9A;
  --hiire-success:       #357A57;
  --hiire-success-soft:  rgba(53, 122, 87, 0.10);
  --hiire-warning:       #C2872C;
  --hiire-warning-soft:  rgba(194, 135, 44, 0.12);
  --hiire-error:         #B23A2C;
  --hiire-error-soft:    rgba(178, 58, 44, 0.10);
  --hiire-on-primary:    #FFFFFF;
  --hiire-on-accent:     #FFFFFF;

  /* Typography */
  --hiire-font-heading: 'Archivo', sans-serif;
  --hiire-font-body:    'IBM Plex Sans', sans-serif;

  /* Layout */
  --hiire-radius:        4px;
  --hiire-radius-lg:     8px;
  --hiire-max-width:     1200px;

  /* Motion */
  --hiire-transition:    0.15s ease;

  /* Legacy VS aliases. VS was dark; Hiire is light. Any leftover
     var(--dark-3) / var(--text) rules must resolve here, not to
     the old #1A1A1A / #E8E8E8 fallbacks in shared CSS. */
  --gold:                var(--hiire-primary);
  --gold-light:          var(--hiire-accent-hover);
  --dark:                var(--hiire-background);
  --dark-2:              var(--hiire-surface);
  --dark-3:              #FFFFFF;
  --dark-4:              var(--hiire-background);
  --border:              var(--hiire-border);
  --text:                var(--hiire-text-primary);
  --text-muted:          var(--hiire-text-muted);
  --muted:               var(--hiire-text-secondary);
  --accent:              var(--hiire-accent);
  --accent-hover:        var(--hiire-accent-hover);
  --navy:                var(--hiire-primary);
  --cream:               var(--hiire-background);
  --ok:                  var(--hiire-success);
  --err:                 var(--hiire-error);
  --success:             var(--hiire-success);
  --warning:             var(--hiire-warning);
  --error:               var(--hiire-error);
}

/* --------------------------------------------------------------------------
   Base reset and typography
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  color-scheme: light;
}

body.hiire,
.hiire-root {
  margin: 0;
  font-family: var(--hiire-font-body);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.5;
  color: var(--hiire-text-primary);
  background: var(--hiire-background);
}

h1, h2, h3, h4, h5, h6,
.hiire-h1,
.hiire-h2,
.hiire-h3,
.hiire-h4 {
  margin: 0;
  font-family: var(--hiire-font-heading);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--hiire-primary);
}

.hiire-h1 { font-size: clamp(28px, 4vw, 40px); }
.hiire-h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 700; }
.hiire-h3 { font-size: 18px; font-weight: 700; }
.hiire-h4 { font-size: 15px; font-weight: 700; }

p,
.hiire-body {
  margin: 0;
  font-family: var(--hiire-font-body);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.6;
  color: var(--hiire-text-primary);
}

.hiire-body-sm {
  font-size: 13px;
  line-height: 1.5;
  color: var(--hiire-text-secondary);
}

.hiire-label {
  display: block;
  font-family: var(--hiire-font-heading);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hiire-text-secondary);
}

.hiire-eyebrow {
  font-family: var(--hiire-font-heading);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hiire-accent);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.hiire-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  font-family: var(--hiire-font-heading);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
  line-height: 1;
  border-radius: var(--hiire-radius);
  padding: 10px 18px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--hiire-transition),
              border-color var(--hiire-transition),
              color var(--hiire-transition);
}

.hiire-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hiire-btn-lg {
  font-size: 16px;
  padding: 14px 26px;
}

.hiire-btn-sm {
  font-size: 12px;
  padding: 7px 12px;
}

/* Primary navy */
.hiire-btn-primary {
  color: var(--hiire-on-primary);
  background: var(--hiire-primary);
  border-color: var(--hiire-primary);
}

.hiire-btn-primary:hover:not(:disabled) {
  background: #1a2d4f;
  border-color: #1a2d4f;
}

/* Accent orange */
.hiire-btn-accent {
  color: var(--hiire-on-accent);
  background: var(--hiire-accent);
  border-color: var(--hiire-accent);
}

.hiire-btn-accent:hover:not(:disabled) {
  background: var(--hiire-accent-hover);
  border-color: var(--hiire-accent-hover);
}

/* Ghost */
.hiire-btn-ghost {
  color: var(--hiire-primary);
  background: transparent;
  border-color: var(--hiire-border-strong);
}

.hiire-btn-ghost:hover:not(:disabled) {
  border-color: var(--hiire-primary);
  color: var(--hiire-primary);
}

/* --------------------------------------------------------------------------
   Metric cards
   -------------------------------------------------------------------------- */

.hiire-metric-card {
  background: var(--hiire-surface);
  border: 1px solid var(--hiire-border);
  border-radius: var(--hiire-radius);
  padding: 16px 18px;
}

.hiire-metric-card .hiire-label {
  margin-bottom: 10px;
}

.hiire-metric-value {
  display: block;
  font-family: var(--hiire-font-heading);
  font-weight: 800;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--hiire-primary);
}

.hiire-metric-delta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--hiire-success);
}

.hiire-metric-foot {
  margin-top: 4px;
  font-size: 12px;
  color: var(--hiire-text-muted);
}

.hiire-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

/* --------------------------------------------------------------------------
   Candidate rows
   -------------------------------------------------------------------------- */

.hiire-candidate-list {
  background: var(--hiire-surface);
  border: 1px solid var(--hiire-border);
  border-radius: var(--hiire-radius);
  overflow: hidden;
}

.hiire-candidate-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--hiire-border);
}

.hiire-candidate-list-title {
  font-family: var(--hiire-font-heading);
  font-weight: 700;
  font-size: 14px;
  color: var(--hiire-primary);
}

.hiire-candidate-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--hiire-border);
  transition: background var(--hiire-transition);
}

.hiire-candidate-row:last-child {
  border-bottom: none;
}

.hiire-candidate-row:hover {
  background: rgba(21, 35, 63, 0.03);
}

.hiire-candidate-row.is-selected {
  background: var(--hiire-accent-soft);
}

.hiire-candidate-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hiire-candidate-name {
  font-family: var(--hiire-font-heading);
  font-weight: 700;
  font-size: 14px;
  color: var(--hiire-text-primary);
}

.hiire-candidate-role {
  font-size: 13px;
  color: var(--hiire-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hiire-candidate-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  flex-shrink: 0;
}

.hiire-candidate-stage {
  font-size: 12px;
  color: var(--hiire-text-muted);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Status badges
   -------------------------------------------------------------------------- */

.hiire-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--hiire-font-heading);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: var(--hiire-radius);
  border: 1px solid transparent;
  white-space: nowrap;
}

.hiire-badge-active {
  color: var(--hiire-accent);
  background: var(--hiire-accent-soft);
  border-color: rgba(196, 93, 46, 0.28);
}

.hiire-badge-review {
  color: var(--hiire-warning);
  background: var(--hiire-warning-soft);
  border-color: rgba(194, 135, 44, 0.30);
}

.hiire-badge-new {
  color: var(--hiire-secondary);
  background: rgba(44, 62, 94, 0.08);
  border-color: rgba(44, 62, 94, 0.20);
}

.hiire-badge-placed {
  color: var(--hiire-success);
  background: var(--hiire-success-soft);
  border-color: rgba(53, 122, 87, 0.28);
}

/* --------------------------------------------------------------------------
   Avatar circles
   -------------------------------------------------------------------------- */

.hiire-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--hiire-radius);
  background: var(--hiire-primary);
  color: var(--hiire-on-primary);
  font-family: var(--hiire-font-heading);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.hiire-avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 11px;
}

.hiire-avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 15px;
}

.hiire-avatar-accent {
  background: var(--hiire-accent);
}

.hiire-avatar-secondary {
  background: var(--hiire-secondary);
}

/* --------------------------------------------------------------------------
   Pipeline stage bars
   -------------------------------------------------------------------------- */

.hiire-pipeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hiire-pipeline-track {
  display: flex;
  gap: 4px;
  align-items: stretch;
}

.hiire-pipeline-stage {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--hiire-border);
  transition: background var(--hiire-transition);
}

.hiire-pipeline-stage.is-complete {
  background: var(--hiire-primary);
}

.hiire-pipeline-stage.is-current {
  background: var(--hiire-accent);
}

.hiire-pipeline-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.hiire-pipeline-label {
  flex: 1;
  font-size: 11px;
  font-weight: 500;
  color: var(--hiire-text-muted);
  text-align: center;
}

.hiire-pipeline-label.is-current {
  color: var(--hiire-accent);
  font-weight: 600;
}

.hiire-pipeline-label.is-complete {
  color: var(--hiire-primary);
  font-weight: 600;
}

/* Single progress bar variant */
.hiire-progress {
  height: 6px;
  background: var(--hiire-border);
  border-radius: 3px;
  overflow: hidden;
}

.hiire-progress-fill {
  display: block;
  height: 100%;
  background: var(--hiire-accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* --------------------------------------------------------------------------
   AI score panel
   -------------------------------------------------------------------------- */

.hiire-ai-panel {
  background: var(--hiire-surface-alt);
  border: 1px solid var(--hiire-border);
  border-radius: var(--hiire-radius-lg);
  padding: 20px;
}

.hiire-ai-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hiire-ai-tag {
  font-family: var(--hiire-font-heading);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hiire-on-primary);
  background: var(--hiire-secondary);
  padding: 4px 9px;
  border-radius: var(--hiire-radius);
}

.hiire-ai-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--hiire-font-heading);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hiire-success);
}

.hiire-ai-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--hiire-success);
}

.hiire-ai-subject {
  margin-top: 14px;
  font-family: var(--hiire-font-heading);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--hiire-primary);
}

.hiire-ai-score-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 12px;
}

.hiire-ai-score-num {
  font-family: var(--hiire-font-heading);
  font-weight: 800;
  font-size: 46px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--hiire-primary);
}

.hiire-ai-score-of {
  font-size: 13px;
  color: var(--hiire-text-secondary);
}

.hiire-ai-grade {
  margin-left: auto;
  font-family: var(--hiire-font-heading);
  font-weight: 800;
  font-size: 16px;
  color: var(--hiire-success);
  border: 1px solid rgba(53, 122, 87, 0.35);
  border-radius: var(--hiire-radius);
  padding: 4px 11px;
}

.hiire-ai-summary {
  margin-top: 16px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--hiire-text-primary);
}

.hiire-ai-section-label {
  display: block;
  margin-top: 16px;
  margin-bottom: 8px;
}

.hiire-ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.hiire-ai-chip {
  font-family: var(--hiire-font-body);
  font-weight: 500;
  font-size: 12px;
  color: var(--hiire-secondary);
  background: var(--hiire-surface);
  border: 1px solid var(--hiire-border-strong);
  border-radius: var(--hiire-radius);
  padding: 5px 10px;
}

.hiire-ai-chip.is-strong {
  color: var(--hiire-primary);
  border-color: var(--hiire-primary);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Form controls — light surface, navy text
   VS native controls + dark fallbacks painted black-on-black on Hiire.
   -------------------------------------------------------------------------- */

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="reset"]):not([type="color"]),
textarea,
select {
  background-color: var(--hiire-surface-alt, #FFFFFF);
  color: var(--hiire-text-primary, #15233F);
  -webkit-text-fill-color: var(--hiire-text-primary, #15233F);
  caret-color: var(--hiire-text-primary, #15233F);
  color-scheme: light;
}

input::placeholder,
textarea::placeholder {
  color: var(--hiire-text-muted, #8A8F9A);
  -webkit-text-fill-color: var(--hiire-text-muted, #8A8F9A);
  opacity: 1;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--hiire-text-primary, #15233F);
  caret-color: var(--hiire-text-primary, #15233F);
  box-shadow: 0 0 0 1000px #FFFFFF inset;
  transition: background-color 99999s ease-out;
}

select option {
  background-color: #FFFFFF;
  color: #15233F;
}

/* Primary actions: orange on white. VS used gold-on-black; after the
   --gold/--dark remap that became navy-on-cream (grey on grey on dark leftovers). */
.btn-primary,
.btn-gold,
.btn-main,
.btn-next.primary,
button.primary,
.cbtn.gold,
.pb-gold,
.pe-save:not(.secondary),
.doc-btn.primary {
  background: var(--hiire-accent, #C45D2E) !important;
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
  border-color: var(--hiire-accent, #C45D2E) !important;
}

.btn-primary:hover:not(:disabled),
.btn-gold:hover:not(:disabled),
.btn-main:hover:not(:disabled),
.btn-next.primary:hover:not(:disabled),
.pe-save:not(.secondary):hover:not(:disabled) {
  background: var(--hiire-accent-hover, #B15428) !important;
  border-color: var(--hiire-accent-hover, #B15428) !important;
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
