/* Mindstorm Global — application form styles
 * Only the patterns Webflow doesn't already provide.
 * Brand: gold #d7be59 (var --fontcolor) on black, Exo + Montserrat fonts.
 */

/* ============================================================
 * Form chrome — overrides on Webflow's .w-input / .w-select
 * to match the brand palette.
 * ============================================================ */
.mg-form-shell .w-input,
.mg-form-shell .w-select,
.mg-form-shell textarea.w-input {
  background-color: #0d0d0d;
  border: 1px solid #2a2a2a;
  color: #f5f5f5;
  border-radius: 10px;
  height: auto;
  min-height: 48px;
  padding: 12px 14px;
  font-family: Montserrat, sans-serif;
  font-size: 15px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.mg-form-shell textarea.w-input {
  min-height: 110px;
  line-height: 1.5;
}

.mg-form-shell .w-input:focus,
.mg-form-shell .w-select:focus,
.mg-form-shell textarea.w-input:focus {
  border-color: var(--fontcolor, #d7be59);
  box-shadow: 0 0 0 3px rgba(215, 190, 89, .18);
  outline: none;
}

.mg-form-shell .w-input::placeholder,
.mg-form-shell textarea.w-input::placeholder {
  color: #6b6b6b;
}

.mg-form-shell .w-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%23d7be59' stroke-width='1.67' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

/* Disabled select — keep the dark theme. Webflow defaults to #eeeeee. */
.mg-form-shell .w-select[disabled],
.mg-form-shell .w-select:disabled,
.mg-form-shell .w-input[disabled],
.mg-form-shell .w-input:disabled {
  background-color: #050505 !important;
  border-color: #1a1a1a;
  color: #5a5a5a;
  cursor: not-allowed;
  opacity: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%235a5a5a' stroke-width='1.67' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.mg-form-shell .w-form-label {
  color: #e9e9e9;
  font-family: Exo, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
}

.mg-form-shell .mg-required {
  color: var(--fontcolor, #d7be59);
  margin-left: 2px;
}

.mg-form-shell .mg-help {
  color: #888;
  font-size: 12px;
  margin-top: 6px;
  display: block;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

/* ============================================================
 * Field grid — two columns on desktop, single column on mobile
 * ============================================================ */
.mg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 22px;
}

.mg-grid .mg-field--full {
  grid-column: 1 / -1;
}

.mg-field {
  display: flex;
  flex-direction: column;
}

@media (max-width: 767px) {
  .mg-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
 * Step bar (top of form, horizontal pills)
 * ============================================================ */
.mg-stepbar {
  list-style: none;
  margin: 0 0 36px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  counter-reset: mgstep;
}

.mg-stepbar__pill {
  flex: 1 1 140px;
  min-width: 110px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #111;
  border: 1px solid #1f1f1f;
  border-radius: 999px;
  color: #888;
  font-family: Exo, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.mg-stepbar__pill::before {
  counter-increment: mgstep;
  content: counter(mgstep);
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #1c1c1c;
  color: #999;
  font-size: 12px;
  font-weight: 700;
  flex: none;
}

.mg-stepbar__pill.is-active {
  background: #1a1605;
  border-color: var(--fontcolor, #d7be59);
  color: var(--fontcolor, #d7be59);
}

.mg-stepbar__pill.is-active::before {
  background: var(--fontcolor, #d7be59);
  color: #000;
}

.mg-stepbar__pill.is-done {
  background: #0e1a0e;
  border-color: #16c549;
  color: #16c549;
}

.mg-stepbar__pill.is-done::before {
  background: #16c549;
  color: #000;
  content: "\2713";
  counter-increment: mgstep;
}

/* ============================================================
 * Step container — only .is-active is visible
 * ============================================================ */
.mg-step {
  display: none;
  border: 0;
  padding: 0;
  margin: 0;
}

.mg-step.is-active {
  display: block;
  animation: mgFade .2s ease;
}

@keyframes mgFade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mg-step__legend {
  font-family: Exo, sans-serif;
  font-weight: 700;
  font-size: 28px;
  color: #fff;
  margin-bottom: 6px;
  display: block;
}

.mg-step__intro {
  color: #aaa;
  font-family: Montserrat, sans-serif;
  font-size: 15px;
  margin-bottom: 28px;
}

.mg-step__sublabel {
  color: #e9e9e9;
  font-family: Exo, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin: 28px 0 12px;
}

/* ============================================================
 * Tile grid (countries, services) — multi-select cards
 * ============================================================ */
.mg-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.mg-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  gap: 10px;
  padding: 20px 14px 16px;
  min-height: 130px;
  background: #0d0d0d;
  border: 1px solid #1f1f1f;
  border-radius: 14px;
  color: #e9e9e9;
  font-family: Exo, sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, transform .1s ease, box-shadow .15s ease;
  user-select: none;
  -webkit-user-select: none;
}

/* Flag image inside a country tile */
.mg-tile__flag {
  width: 64px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .55);
  background: #1c1c1c;
  display: block;
  flex: none;
  transition: transform .15s ease, box-shadow .15s ease;
}

.mg-tile:hover .mg-tile__flag {
  transform: translateY(-1px);
}

.mg-tile.is-selected .mg-tile__flag {
  box-shadow: 0 6px 18px rgba(215, 190, 89, .35);
}

.mg-tile:hover {
  border-color: #3a3a3a;
  transform: translateY(-1px);
}

.mg-tile.is-selected {
  border-color: var(--fontcolor, #d7be59);
  background: #1a1605;
  color: #fff;
  box-shadow: 0 0 0 1px var(--fontcolor, #d7be59) inset;
}

.mg-tile__check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--fontcolor, #d7be59);
  color: #000;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.mg-tile.is-selected .mg-tile__check {
  display: flex;
}

.mg-tile__sub {
  display: block;
  margin-top: 4px;
  color: #888;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .3px;
}

.mg-tile.is-selected .mg-tile__sub {
  color: #c9b770;
}

/* Service cards (wider with subtitle) */
.mg-tile--service {
  grid-column: span 1;
  align-items: flex-start;
  text-align: left;
  padding: 18px 18px 18px 20px;
}

.mg-tile--service .mg-tile__title {
  font-size: 15px;
}

.mg-tile--service .mg-tile__sub {
  margin-top: 2px;
  color: #888;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  line-height: 1.5;
}

/* Country tile with salary range subtitle (work permit page) */
.mg-tile-grid--country {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.mg-tile-grid--country .mg-tile {
  min-height: 150px;
  padding: 22px 14px 18px;
}

/* ============================================================
 * Chip row (sectors, languages, salary, etc.)
 * ============================================================ */
.mg-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.mg-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: #0d0d0d;
  border: 1px solid #1f1f1f;
  border-radius: 999px;
  color: #c9c9c9;
  font-family: Exo, sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
  user-select: none;
  -webkit-user-select: none;
}

.mg-chip:hover {
  border-color: #3a3a3a;
}

.mg-chip.is-selected {
  border-color: var(--fontcolor, #d7be59);
  background: var(--fontcolor, #d7be59);
  color: #000;
}

/* ============================================================
 * Hidden inputs that back tiles/chips/radios
 * ============================================================ */
.mg-hidden-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

/* ============================================================
 * Radio group (inline pill row)
 * ============================================================ */
.mg-radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.mg-radio-row .mg-chip input[type="radio"] {
  position: absolute;
  opacity: 0;
}

/* ============================================================
 * File upload field
 * ============================================================ */
.mg-file-field {
  border: 1px dashed #2a2a2a;
  border-radius: 14px;
  background: #0a0a0a;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mg-file-field__label {
  color: var(--fontcolor, #d7be59);
  font-family: Exo, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.mg-file-field__hint {
  color: #777;
  font-size: 12px;
  margin: 0;
}

.mg-file-field input[type="file"] {
  background: transparent;
  border: 0;
  color: #c9c9c9;
  padding: 6px 0;
  font-family: Montserrat, sans-serif;
  font-size: 13px;
  cursor: pointer;
}

.mg-file-field input[type="file"]::-webkit-file-upload-button {
  background: var(--fontcolor, #d7be59);
  color: #000;
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  font-family: Exo, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-right: 12px;
  cursor: pointer;
}

.mg-file-field input[type="file"]::file-selector-button {
  background: var(--fontcolor, #d7be59);
  color: #000;
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  font-family: Exo, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-right: 12px;
  cursor: pointer;
}

/* ============================================================
 * Consent checkboxes (review step)
 * ============================================================ */
.mg-consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: #0d0d0d;
  border: 1px solid #1f1f1f;
  border-radius: 12px;
  margin-bottom: 10px;
  cursor: pointer;
}

.mg-consent input[type="checkbox"] {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--fontcolor, #d7be59);
  cursor: pointer;
}

.mg-consent__text {
  color: #d3d3d3;
  font-family: Montserrat, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

.mg-consent.is-checked {
  border-color: var(--fontcolor, #d7be59);
}

/* ============================================================
 * Review panel (final step)
 * ============================================================ */
.mg-review {
  margin: 0 0 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mg-review__group {
  background: #0d0d0d;
  border: 1px solid #1f1f1f;
  border-radius: 14px;
  padding: 20px 22px;
}

.mg-review__group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.mg-review__group-title {
  color: var(--fontcolor, #d7be59);
  font-family: Exo, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 0;
}

.mg-review__edit {
  background: transparent;
  border: 1px solid #2a2a2a;
  color: #c9c9c9;
  border-radius: 999px;
  padding: 4px 12px;
  font-family: Exo, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}

.mg-review__edit:hover {
  border-color: var(--fontcolor, #d7be59);
  color: var(--fontcolor, #d7be59);
}

.mg-review__row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid #181818;
  font-family: Montserrat, sans-serif;
  font-size: 14px;
}

.mg-review__row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.mg-review__label {
  color: #888;
  font-weight: 500;
}

.mg-review__value {
  color: #f0f0f0;
  word-break: break-word;
}

.mg-review__value.is-empty {
  color: #555;
  font-style: italic;
}

@media (max-width: 600px) {
  .mg-review__row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* ============================================================
 * Action bar (Back / Next / Submit)
 * ============================================================ */
.mg-wizard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #1c1c1c;
}

.mg-wizard-actions .button-primary {
  margin-top: 0;
}

.mg-wizard-actions .mg-back {
  background-color: transparent;
  color: #c9c9c9;
  border: 1px solid #2a2a2a;
}

.mg-wizard-actions .mg-back:hover {
  border-color: var(--fontcolor, #d7be59);
  color: var(--fontcolor, #d7be59);
  background-color: transparent;
  filter: none;
}

.mg-wizard-actions .mg-back[disabled] {
  opacity: .35;
  cursor: not-allowed;
}

/* ============================================================
 * Inline error helper
 * ============================================================ */
.mg-error {
  display: none;
  margin-top: 14px;
  padding: 10px 14px;
  background: #2a0d0d;
  border: 1px solid #5a1d1d;
  color: #ffb1b1;
  border-radius: 10px;
  font-family: Montserrat, sans-serif;
  font-size: 13px;
}

.mg-error.is-visible {
  display: block;
}

.mg-field--error .w-input,
.mg-field--error .w-select {
  border-color: #b03a3a;
  box-shadow: 0 0 0 3px rgba(176, 58, 58, .15);
}

/* ============================================================
 * Success panel (after submission)
 * ============================================================ */
.mg-success {
  display: none;
  background: #0d0d0d;
  border: 1px solid var(--fontcolor, #d7be59);
  border-radius: 16px;
  padding: 36px;
  text-align: center;
  margin-top: 16px;
}

.mg-success.is-visible {
  display: block;
}

.mg-success__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--fontcolor, #d7be59);
  color: #000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 16px;
}

.mg-success__heading {
  color: #fff;
  font-family: Exo, sans-serif;
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px;
}

.mg-success__lead {
  color: #c9c9c9;
  font-family: Montserrat, sans-serif;
  font-size: 15px;
  margin: 0 0 18px;
}

.mg-success__ref-label {
  color: #888;
  font-family: Exo, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
}

.mg-success__ref {
  color: var(--fontcolor, #d7be59);
  font-family: Exo, sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 3px;
  margin-bottom: 22px;
  display: block;
}

.mg-success__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 18px;
}

.mg-success__hint {
  color: #888;
  font-size: 12px;
  margin-top: 14px;
}

/* ============================================================
 * Failure panel
 * ============================================================ */
.mg-fail {
  display: none;
  background: #2a0d0d;
  border: 1px solid #5a1d1d;
  color: #ffb1b1;
  border-radius: 12px;
  padding: 16px 18px;
  margin-top: 16px;
  font-family: Montserrat, sans-serif;
  font-size: 14px;
}

.mg-fail.is-visible {
  display: block;
}

/* ============================================================
 * Form section background — dark canvas matching the brand
 * ============================================================ */
.mg-form-section {
  background: #050505;
  background-image: radial-gradient(1200px 600px at 50% -10%, rgba(215, 190, 89, .07), transparent 60%);
}

.mg-form-shell {
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-radius: 24px;
  padding: 36px 40px 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}

@media (max-width: 600px) {
  .mg-form-shell {
    padding: 22px 18px 26px;
    border-radius: 18px;
  }
  .mg-step__legend { font-size: 22px; }
  .mg-stepbar__pill { font-size: 11px; padding: 8px 12px; min-width: 90px; }
  .mg-stepbar__pill::before { width: 22px; height: 22px; font-size: 11px; }
  .mg-wizard-actions { flex-direction: column; align-items: stretch; gap: 10px; }
  .mg-wizard-actions .button-primary { text-align: center; }
  .mg-tile-grid {
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
    gap: 10px;
  }
  .mg-tile-grid--country {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  .mg-tile { min-height: 110px; padding: 14px 10px; font-size: 13px; }
  .mg-tile-grid--country .mg-tile { min-height: 130px; }
  .mg-tile__flag { width: 52px; height: 34px; }
}

/* ============================================================
 * Hero overrides on the apply pages — the default
 * .uui-max-width-medium (35rem) makes the subtitle wrap into
 * an awkward narrow column. Centered + wider reads better.
 * ============================================================ */
.mg-apply-hero .uui-heroheader01_component {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
}

.mg-apply-hero .uui-heroheader01_content._2 {
  max-width: 56rem;
  margin: 0 auto;
  text-align: center;
}

.mg-apply-hero .uui-heading-xlarge-3 {
  max-width: none;
  text-align: center;
}

.mg-apply-hero .uui-max-width-medium {
  max-width: 48rem;
  margin: 0 auto;
  display: block;
}

.mg-apply-hero .uui-text-size-xlarge-3._2 {
  text-align: center;
}

@media (max-width: 600px) {
  .mg-apply-hero .uui-max-width-medium { max-width: 100%; }
}
