/* Account pages: log in, first-login profile, edit profile and workspace.
   The colours come from the variables at the top of styles.css. */

/* ---------- Page frame ---------- */
.page-form {
  --accent: var(--brand-orange-dark);          /* .btn and its focus ring in styles.css use --accent */
  --accent-soft: var(--export-soft);
  --input-border: #9c857c;             /* dark enough to see the edge of every box */
}
.page-form main {
  justify-content: flex-start;
  padding-top: 8px;
}

/* On very small screens the links drop below the logo instead of pushing past the edge. */
.page-form header {
  flex-wrap: wrap;
  gap: 4px 8px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.header-actions a,
.link-btn {
  appearance: none;
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.header-actions a:hover,
.link-btn:hover { background: var(--accent-soft); }
.link-inline {
  min-height: 0;
  padding: 2px 4px;
  color: var(--brand-orange-dark);
  text-decoration: underline;
}
.brand:focus-visible,
.header-actions a:focus-visible,
.link-btn:focus-visible,
.chip-add:focus-visible,
.chip-remove:focus-visible {
  outline: 3px solid var(--brand-orange-dark);
  outline-offset: 2px;
}

/* ---------- The card that holds a form ---------- */
.form-shell {
  width: 100%;
  max-width: 760px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.form-shell.narrow { max-width: 460px; }
.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--brand-orange-dark);
}
.form-shell h1 {
  margin: 0 0 6px;
  font-size: clamp(24px, 3.4vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.3px;
}
.lead {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- Progress indicator: Step 1, 2, 3 ---------- */
.steps {
  list-style: none;
  margin: 24px 0 4px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.steps li {
  border-top: 4px solid var(--border);
  padding-top: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.steps .step-num {
  display: block;
  font-size: 12px;
  font-weight: 500;
}
.steps li.done {
  border-top-color: var(--brand-teal);
  color: var(--text);
}
.steps li[aria-current="step"] {
  border-top-color: var(--brand-orange-dark);
  color: var(--brand-orange-dark);
}

/* ---------- Questions ---------- */
.form-step {
  border: 0;
  margin: 22px 0 0;
  padding: 0;
  min-width: 0;
}
.form-step legend {
  padding: 0;
  margin-bottom: 14px;
  font-size: 18px;
  font-weight: 700;
}
.field-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}
@media (min-width: 640px) {
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-wide { grid-column: 1 / -1; }
}
.field-grid.single { grid-template-columns: minmax(0, 1fr); }
.field { min-width: 0; }
.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
}
.field .optional {
  font-weight: 400;
  color: var(--muted);
}
.field input,
.field select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px; /* 16px stops phones from zooming in when you tap a box */
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--input-border);
  border-radius: 10px;
}
.field input::placeholder { color: #857a73; }
.field input:focus,
.field select:focus {
  outline: 3px solid rgba(201, 88, 58, 0.35);
  outline-offset: 0;
  border-color: var(--brand-orange-dark);
}
.field.has-error input,
.field.has-error select { border-color: var(--danger); }
.hint {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}
.field-error {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
}
.field-error:empty { display: none; }

/* Number + unit, side by side */
.qty-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 175px);
  gap: 8px;
}

/* Chips for products and countries */
.chip-entry {
  display: flex;
  gap: 8px;
}
.chip-entry input {
  flex: 1;
  min-width: 0;
}
.chip-add {
  flex: none;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--brand-orange-dark);
  border-radius: 10px;
  background: transparent;
  color: var(--brand-orange-dark);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.chip-add:hover { background: var(--accent-soft); }
.chips {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chips:empty { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 2px 2px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 14px;
}
.chip-remove {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--brand-orange-dark);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.chip-remove:hover { background: rgba(201, 88, 58, 0.14); }

/* Exporter / Importer choice on the sign-up page */
.role-pick {
  border: 0;
  margin: 20px 0 18px;
  padding: 0;
}
.role-pick legend {
  padding: 0;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
}
.role-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.role-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--input-border);
  border-radius: 12px;
  background: #ffffff;
  cursor: pointer;
}
.role-option input {
  accent-color: var(--brand-orange-dark);
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  flex: none;
}
.role-option strong {
  display: block;
  font-size: 15px;
}
.role-option small {
  color: var(--muted);
  font-size: 13px;
}
.role-option:has(input:checked) {
  border-color: var(--brand-orange-dark);
  box-shadow: inset 0 0 0 1px var(--brand-orange-dark);
}
.role-option:has(input:focus-visible) {
  outline: 3px solid var(--brand-orange-dark);
  outline-offset: 2px;
}

/* ---------- Buttons and messages ---------- */
.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
}
.form-actions .btn {
  margin-top: 0;
  min-height: 48px;
  min-width: 120px;
}
.push-right { margin-left: auto; }
.btn-block { width: 100%; }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--input-border);
}
.btn-secondary:hover {
  background: var(--accent-soft);
  filter: none;
}
.form-error,
.form-success {
  margin: 18px 0 0;
  font-weight: 600;
}
.form-error { color: var(--danger); }
.form-success { color: #18794e; }
.form-error:empty,
.form-success:empty { display: none; }
.switch {
  margin: 18px 0 0;
  text-align: center;
  color: var(--muted);
}

/* ---------- Workspace ---------- */
.ws {
  width: 100%;
  max-width: 960px;
}
.ws-head { margin-bottom: 20px; }
.ws-head h1 {
  margin: 0 0 6px;
  font-size: clamp(26px, 4vw, 34px);
  letter-spacing: -0.3px;
}
.ws-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.ws-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ws-card h2 {
  margin: 0;
  font-size: 19px;
}
.ws-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}
.ws-card .btn { align-self: flex-start; }
.summary {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: 10px 16px;
  margin: 0;
  font-size: 14px;
}
.summary dt { color: var(--muted); }
.summary dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  .ws-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .form-shell { padding: 20px; }
  .role-options { grid-template-columns: minmax(0, 1fr); }
  .qty-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
  .page-form .logo { height: 34px; }
  .form-actions .btn {
    flex: 1 1 0;
    min-width: 0;
  }
  .summary { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .summary dd { margin-bottom: 10px; }
}

/* Tick boxes ("Services you offer"): tick every option that applies */
.choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
}
.field .choice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid var(--input-border);
  border-radius: 10px;
  background: #ffffff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}
.field .choice input {
  width: 20px;
  height: 20px;
  min-height: 0;
  margin: 0;
  padding: 0;
  flex: none;
  accent-color: var(--brand-orange-dark);
}
@supports selector(:has(a)) {
  .field .choice input:focus { outline: none; }   /* the whole box gets the ring instead, below */
}
.choice:has(input:checked) {
  border-color: var(--brand-orange-dark);
  background: var(--accent-soft);
}
.choice:has(input:focus-visible) {
  outline: 3px solid var(--brand-orange-dark);
  outline-offset: 2px;
}
.field.has-error .choice { border-color: var(--danger); }
