/*
  Visual redesign for the public "Quick Offer Letter" flow (apps/home/views.py:
  generate_demo_offer, template home/demo_offer.html, layout
  layouts/base-new-reg-flow.html).

  Mirrors the design system introduced in company-details-redesign.css (same
  "compact" scale: 33/35px inputs, tight section gaps, 140x72 logo, 260px header)
  rather than the raw dimensions from the design mockup, so the two public flows
  read as one system. New selectors use a "qof-" (quick offer flow) prefix and
  are added alongside the existing hooks the inline script depends on
  (form-field-1..10, input-demo, terms-check, terms, etc. are not renamed).
*/

.qof-card {
  position: relative;
  z-index: 1;
  background: #ffffff !important;
  border-radius: 16px;
  box-shadow: 1px 4px 20.2px 0px rgba(0, 0, 0, 0.14);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
  padding-top: 6px;
  margin: 0 auto 40px;
  width: 961px;
  max-width: calc(100vw - 24px);
}

/* Card header: title + stepper */
.qof-card-header {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0 24px;
}
.qof-card-header-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  width: 553px;
  max-width: 100%;
}
.qof-title-block {
  display: flex;
  flex-direction: column;
  gap: 0px;
  align-items: center;
  text-align: center;
  width: 100%;
}
.qof-title-block .qof-main-title {
  font-size: 20px;
  color: #0b66c3;
  font-weight: 600;
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
}
.qof-title-block .qof-main-subtitle {
  font-size: 14px;
  color: #6b6b6b;
  font-weight: 400;
  font-family: 'Segoe UI Variable', 'Segoe UI', sans-serif;
  margin: 0;
}

/* Step nav pills */
.qof-step-nav {
  background: #f6f6f6;
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 8px;
  position: relative;
  border-radius: 20px;
  flex-shrink: 0;
  margin-top: 4px;
}
.qof-step-nav .qof-connector-line {
  position: absolute;
  height: 2px;
  left: 125.5px;
  width: 288px;
  display: flex;
  top: calc(50% + 0.5px);
}
.qof-step-nav .qof-seg {
  flex: 1;
  height: 100%;
  background: #ddd;
  transition: background 0.2s ease;
}
.qof-step-nav .qof-seg.qof-seg-done { background: #0b66c3; }
.qof-step-pill {
  position: relative;
  border-radius: 26px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 4px 12px 4px 4px;
  gap: 5px;
  background: #ffffff;
  border: none;
  cursor: default;
  transition: background 0.2s ease, border 0.2s ease;
}
.qof-step-pill.qof-clickable { cursor: pointer; }
.qof-step-pill.qof-active { border: 1px solid #0b66c3; }
.qof-step-pill.qof-done { background: #0b66c3; border: 1px solid #0b66c3; }
.qof-step-badge {
  overflow: hidden;
  position: relative;
  border-radius: 24px;
  flex-shrink: 0;
  width: 23px;
  height: 23px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eee;
}
.qof-step-badge.qof-active { background: #0b66c3; }
.qof-step-badge span {
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  color: #d4d4d4;
}
.qof-step-badge.qof-active span { color: #ffffff; }
.qof-step-check {
  overflow: hidden;
  position: relative;
  border-radius: 24px;
  flex-shrink: 0;
  width: 23px;
  height: 23px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
}
.qof-step-pill .qof-step-label {
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
  color: #929ca9;
}
.qof-step-pill.qof-active .qof-step-label { color: #0b66c3; }
.qof-step-pill.qof-done .qof-step-label { color: #ffffff; }

/* Form content area */
.qof-form-fields {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 8px;
}
.qof-form-content-outer {
  border-radius: 18px;
  border: 2px solid #f6f6f6;
  overflow: hidden;
  width: 913px;
  max-width: 100%;
}
.qof-form-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: #ffffff;
  padding-bottom: 20px;
}

.qof-panel { display: none; width: 100%; flex-direction: column; }
.qof-panel.qof-visible { display: flex; }

/* Section */
.qof-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0;
  width: 100%;
}
.qof-section-heading {
  /* A single max-content column sizes itself to its widest child (the title),
     then every other child defaults to justify-self: stretch and fills that
     same width — this is what keeps the progress track's length pinned to
     the heading text above it instead of a fixed px value. */
  display: grid;
  grid-template-columns: max-content;
  gap: 8px;
  align-items: flex-start;
  padding-left: 24px;
  padding-right: 24px;
  max-width: 465px;
  width: 100%;
}
.qof-section-title {
  font-size: 18px;
  font-weight: 600;
  color: #000000;
  font-family: 'Inter', sans-serif;
  margin: 0;
  white-space: nowrap;
}
.qof-progress-track {
  height: 3px;
  border-radius: 18px;
  overflow: hidden;
  min-width: 100px;
  background: #e6e6e6;
}
.qof-progress-fill {
  background: #0b66c3;
  height: 100%;
}
.qof-section-divider {
  height: 2px;
  width: 100%;
  background: #f6f6f6;
}

/* Fields */
.qof-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 24px;
  width: 100%;
}
.qof-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}
.qof-field.qof-flex-col {
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.qof-row {
  display: flex;
  gap: 12px;
  width: 100%;
}
.qof-row.qof-items-end { align-items: flex-end; }

.qof-label {
  font-size: 14px;
  font-weight: 500;
  color: #000000;
  padding: 0 4px;
  font-family: 'Inter', sans-serif;;
  display: block;
  margin-bottom: 0px;
}
.qof-label .qof-muted { color: #808080; font-weight: 600; }
.qof-required { color: #d0342c; }

.qof-input {
  width: 100%;
  height: 33px !important;
  padding: 6px 12px;
  font-size: 14px;
  color: #222222;
  background: #ffffff;
  outline: none;
  border-radius: 8px;
  border: 1px solid #c3c4c4;
  font-family: 'Segoe UI Variable', 'Segoe UI', sans-serif;
}
.qof-input::placeholder { color: #777777; }
.qof-input:focus { border-color: #0b66c3; }
.qof-input[readonly] { background: #f6f6f6; color: #555555; }

select.qof-input {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 11'%3e%3cpath fill='%23979797' d='M2.76181 3.83872L4.98347 7.68666C5.26706 8.17822 5.73112 8.17822 6.01472 7.68666L8.23637 3.83837C8.52031 3.34681 8.28794 2.94531 7.72075 2.94531H3.27744C2.71025 2.94531 2.47787 3.34716 2.76181 3.83872Z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 15px 15px;
  padding-right: 28px;
}

/* Phone field */
.qof-phone-row {
  border: 1px solid #c3c4c4;
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 6px 12px;
  gap: 8px;
  height: 35px;
}
.qof-phone-row:focus-within { border-color: #0b66c3; }
.qof-phone-code {
  color: #111111;
  font-size: 14px;
  white-space: nowrap;
  flex-shrink: 0;
}
.qof-phone-divider {
  background: #c3c4c4;
  height: 22px;
  width: 1px;
  flex-shrink: 0;
}
.qof-phone-row .qof-input.qof-phone-input {
  flex: 1;
  min-width: 0;
  border: none;
  padding: 0;
  height: auto !important;
}

/* Hint / error text */
.qof-hint-text {
  font-size: 10px;
  color: #636363;
  padding-left: 6px;
  font-family: 'Segoe UI Variable', 'Segoe UI', sans-serif;
  margin: 0;
}
.qof-hint-text.qof-hint-error {
  color: red;
}
.qof-link {
  color: #0b66c3;
  font-weight: 600;
  cursor: pointer;
}
.qof-link:hover { text-decoration: underline; }

/* Terms notice */
.qof-terms-box {
  position: relative;
  background: #eff6ff;
  border-radius: 8px;
  width: 100%;
  border: 1px dashed rgba(11, 102, 195, 0.51);
  padding: 4px 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.qof-terms-checkbox { margin-top: 3px; flex-shrink: 0; }
.qof-terms-text {
  font-size: 12px;
  color: #636363;
  font-family: 'Segoe UI Variable', 'Segoe UI', sans-serif;
  margin: 0;
}

/* Live salary breakdown */
.qof-breakdown-box {
  background: #eff6ff;
  border-radius: 8px;
  border: 1px dashed rgba(11, 102, 195, 0.51);
  width: 100%;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.qof-breakdown-box .qof-breakdown-heading {
  font-weight: 600;
  font-size: 14px;
  color: #222222;
}
.qof-salary-rows { display: flex; flex-direction: column; gap: 2px; width: 100%; }
.qof-salary-row {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #d4e4fa;
}
.qof-salary-row:last-child { border-bottom: none; }
.qof-salary-row .qof-label-text { font-size: 13px; color: #222222; }
.qof-salary-row .qof-amount { font-size: 13px; font-weight: 600; color: #222222; }

/* Footer nav */
.qof-footer {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px 36px 24px;
}
.qof-btn {
  height: 38px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 14px;
  cursor: pointer;
  border: none;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.qof-btn-back {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.11);
  color: #0b66c3;
}
.qof-btn-back:hover { background: #f9fafb; }
.qof-btn-next {
  background: #0b66c3;
  color: #ffffff;
}
.qof-btn-next:hover { background: #0a5ab0; }
.qof-btn-next:disabled { background: #7fa8d6; cursor: not-allowed; }

/* Responsive */
@media (max-width: 980px) {
  .qof-card { width: 96vw; }
  .qof-form-content-outer { width: 100%; }
}
@media (max-width: 720px) {
  .qof-row { flex-wrap: wrap; }
  .qof-section-heading, .qof-fields { padding-left: 12px; padding-right: 12px; }
  .qof-card-header-inner { width: 100%; }
  .qof-step-nav { gap: 10px; }
  .qof-step-nav .qof-connector-line { display: none; }
  .qof-step-label { display: none; }
  .qof-footer { justify-content: center; flex-wrap: wrap; padding: 0 16px 16px; }
}
