/* Hire Talent Flow Modal */

.hf-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: flex-end;
}

.hf-modal[hidden] {
  display: none;
}

.hf-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 7, 51, .72);
  backdrop-filter: blur(5px);
}

.hf-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: calc(100svh - 8px);
  border-radius: 28px 28px 0 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -8px 40px rgba(2, 7, 51, .18);
  height: calc(100svh - 8px);
}

@media (min-width: 640px) {
  .hf-modal {
    align-items: center;
    justify-content: center;
    padding: 16px;
  }

  .hf-panel {
    width: 100%;
    max-width: 560px;
    height: auto;
    max-height: 90vh;
    border-radius: 20px;
  }
}

/* Header */
.hf-header {
  display: flex;
  flex-direction: column;
  padding: 16px 20px 0;
  border-bottom: 1px solid #e5eaf2;
  flex: 0 0 auto;
  gap: 12px;
}

.hf-progress-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hf-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #e5eaf2;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #08244a;
  transition: background .15s;
  flex-shrink: 0;
}

.hf-close:hover {
  background: #d0d8e8;
}

.hf-close:focus-visible {
  outline: 3px solid rgba(8, 36, 74, .25);
  outline-offset: 2px;
}

.hf-progress-title {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: #08244a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.hf-step-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Segmented progress bar */
.hf-progress-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding-bottom: 16px;
}

.hf-progress-segment {
  height: 5px;
  border-radius: 999px;
  background: #e5eaf2;
  transition: background .2s;
}

.hf-progress-segment.is-active,
.hf-progress-segment.is-complete {
  background: #08244a;
}

/* Body scroll area */
.hf-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px;
  outline: none;
  display: flex;
  flex-direction: column;
}

/* Step wrapper */
.hf-step-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* Step headings */
.hf-step-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 800;
  color: var(--navy-2);
  letter-spacing: -.02em;
}

.hf-step-sub {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--muted);
}

/* Form */
.hf-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-height: 0;
}

.hf-step-wrap > .hf-footer,
.hf-form > .hf-footer,
.hf-step-wrap > .hf-review-actions {
  margin-top: auto;
}

.hf-form-row {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 10px;
}

.hf-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy-2);
}

.hf-form input,
.hf-form select,
.hf-form textarea {
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 15px;
  color: var(--text);
  background: #fff;
  transition: border-color .15s;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
}

.hf-form input,
.hf-form select {
  height: 44px;
}

.hf-form textarea {
  padding: 10px 14px;
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.hf-form select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23536070' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

.hf-form input:focus,
.hf-form select:focus,
.hf-form textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 128, 237, .12);
}

.hf-form input[aria-invalid="true"],
.hf-form select[aria-invalid="true"],
.hf-form textarea[aria-invalid="true"] {
  border-color: #b42318;
}

.hf-req {
  color: #d71920;
  font-weight: 700;
}

.hf-field-optional {
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
}

/* Status message */
.hf-status {
  font-size: 13px;
  color: #b42318;
  margin-top: 2px;
}

.hf-status[hidden] {
  display: none;
}

/* Footer */
.hf-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* Buttons */
.hf-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--navy-2);
  color: #fff;
  padding: 0 22px;
  height: 44px;
  border-radius: 999px;
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .15s;
  white-space: nowrap;
  font-family: inherit;
}

.hf-btn-primary:hover {
  background: var(--navy);
  transform: translateY(-1px);
}

.hf-btn-primary:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

.hf-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--navy-2);
  border: 1.5px solid var(--line);
  padding: 0 18px;
  height: 44px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
  white-space: nowrap;
  font-family: inherit;
}

.hf-btn-ghost:hover {
  border-color: var(--navy-2);
  transform: translateY(-1px);
}

.hf-btn-full {
  width: 100%;
  justify-content: center;
}

/* Review step — compact */
.hf-review-subtitle {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--muted);
}

.hf-review-compact {
  display: grid;
  gap: 12px;
}

.hf-review-group {
  padding: 18px 20px;
  border: 1px solid rgba(15, 23, 42, .07);
  border-radius: 18px;
  background: #f9fbfc;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .05);
}

.hf-review-group h3 {
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(15, 23, 42, .07);
  font-size: 11px;
  font-weight: 900;
  color: var(--navy-2);
  text-transform: uppercase;
  letter-spacing: .1em;
}

.hf-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 20px;
}

.hf-review-item--full {
  grid-column: 1 / -1;
}

.hf-review-item span {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.hf-review-item strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.35;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hf-review-actions {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.hf-review-actions .hf-submit {
  width: 100%;
  min-height: 48px;
  box-sizing: border-box;
  display: flex;
}

.hf-edit-link {
  display: block;
  margin-top: 10px;
  border: 0;
  background: transparent;
  color: var(--navy-2);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
}

.hf-edit-link:hover {
  color: #d71920;
}

.hf-secure-note {
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

/* Submitting state */
.hf-submitting {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

.hf-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--line);
  border-top-color: var(--navy-2);
  border-radius: 50%;
  animation: hf-spin .7s linear infinite;
  margin: 0 auto 20px;
}

@keyframes hf-spin {
  to { transform: rotate(360deg); }
}

/* Mobile overrides */
@media (max-width: 639px) {
  .hf-modal {
    align-items: stretch;
    padding: 0;
  }

  .hf-panel {
    position: fixed;
    inset: 10px 8px 8px;
    height: calc(100dvh - 18px);
    max-height: calc(100dvh - 18px);
    width: auto;
    max-width: none;
    border-radius: 20px;
    z-index: 1101;
  }

  .hf-body {
    padding: 22px 24px 24px;
  }

  .hf-footer {
    justify-content: space-between;
  }

  .hf-btn-primary {
    flex: 1;
  }
}

/* Review step compact — small mobile */
@media (max-width: 560px) {
  .hf-review-compact {
    gap: 10px;
  }

  .hf-review-group {
    padding: 14px 16px;
    border-radius: 16px;
  }

  .hf-review-group h3 {
    margin-bottom: 12px;
    padding-bottom: 10px;
  }

  .hf-review-grid {
    gap: 12px 14px;
  }

  .hf-review-item strong {
    font-size: 13px;
  }

  .hf-edit-link {
    text-align: center;
  }
}

/* Body scroll lock */
body.hire-modal-open {
  overflow: hidden;
}
