/* ============================================================================
 *  apply-form.css — the "Apply / Investor enquiry" panel a visitor fills in
 * ============================================================================
 *  Loaded only on careers.html and Investor.html. Every class starts with
 *  gf-apply- so it can never clash with the rest of the website.
 *  The panel is built by script.js/apply-form.js.
 * ========================================================================== */

.gf-apply {
  --gf-apply-purple: #6c5ce7;
  --gf-apply-purple-dark: #4834d4;
  --gf-apply-pink: #fd79a8;
  --gf-apply-ink: #1d1b36;
  --gf-apply-soft: #6b6880;
  --gf-apply-line: #e6e3f2;
  --gf-apply-bad: #d63031;
  --gf-apply-green: #25d366;

  position: fixed;
  inset: 0;
  z-index: 2147481000; /* above the page and the WhatsApp button, below the admin editor */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--gf-apply-ink);
  cursor: auto;
}

.gf-apply * {
  box-sizing: border-box;
  cursor: auto;
}

.gf-apply__veil {
  position: absolute;
  inset: 0;
  background: rgba(19, 16, 43, 0.62);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.gf-apply__card {
  position: relative;
  width: min(620px, 100%);
  max-height: min(100%, 860px);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(24, 18, 62, 0.35);
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.gf-apply.is-open .gf-apply__veil {
  opacity: 1;
}

.gf-apply.is-open .gf-apply__card {
  opacity: 1;
  transform: none;
}

/* ---- header -------------------------------------------------------------- */

.gf-apply__head {
  position: relative;
  padding: 22px 56px 18px 26px;
  background: linear-gradient(135deg, #6c5ce7, #4834d4);
  color: #ffffff;
}

.gf-apply__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
}

.gf-apply__chip {
  display: inline-block;
  margin-top: 10px;
  padding: 5px 12px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 0.82rem;
  font-weight: 600;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.gf-apply__note {
  margin: 10px 0 0;
  font-size: 0.86rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.86);
}

.gf-apply__x {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.gf-apply__x:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* ---- the scrolling middle ------------------------------------------------ */

.gf-apply__body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 26px 8px;
}

.gf-apply__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.gf-apply__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.gf-apply__field--wide {
  grid-column: 1 / -1;
}

.gf-apply__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gf-apply-ink);
}

.gf-apply__star {
  color: var(--gf-apply-pink);
  margin-left: 2px;
}

.gf-apply__input,
.gf-apply__select,
.gf-apply__area {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--gf-apply-line);
  border-radius: 12px;
  background: #fbfaff;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--gf-apply-ink);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.gf-apply__area {
  min-height: 92px;
  resize: vertical;
  line-height: 1.5;
}

.gf-apply__input:focus,
.gf-apply__select:focus,
.gf-apply__area:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--gf-apply-purple);
  box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.14);
}

.gf-apply__input::placeholder,
.gf-apply__area::placeholder {
  color: #a9a5be;
}

.gf-apply__phone {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 8px;
}

.gf-apply__help {
  font-size: 0.75rem;
  color: var(--gf-apply-soft);
}

.gf-apply__count {
  align-self: flex-end;
  font-size: 0.72rem;
  color: var(--gf-apply-soft);
}

.gf-apply__error {
  display: none;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gf-apply-bad);
}

.gf-apply__field.is-bad .gf-apply__input,
.gf-apply__field.is-bad .gf-apply__select,
.gf-apply__field.is-bad .gf-apply__area,
.gf-apply__field.is-bad .gf-apply__drop {
  border-color: var(--gf-apply-bad);
  background: #fff6f6;
}

.gf-apply__field.is-bad .gf-apply__error {
  display: block;
}

/* ---- the resume box ------------------------------------------------------ */

.gf-apply__drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 14px;
  border: 1.5px dashed #c9c3e8;
  border-radius: 16px;
  background: #fbfaff;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.gf-apply__drop:hover,
.gf-apply__drop.is-over {
  border-color: var(--gf-apply-purple);
  background: rgba(108, 92, 231, 0.07);
}

.gf-apply__drop strong {
  font-size: 0.92rem;
  color: var(--gf-apply-purple-dark);
}

.gf-apply__drop span {
  font-size: 0.76rem;
  color: var(--gf-apply-soft);
}

.gf-apply__file {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid var(--gf-apply-line);
  border-radius: 12px;
  background: #ffffff;
}

.gf-apply__file.is-on {
  display: flex;
}

.gf-apply__file-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.86rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gf-apply__file-size {
  font-size: 0.76rem;
  color: var(--gf-apply-soft);
  white-space: nowrap;
}

.gf-apply__file-x {
  border: 0;
  background: #f4f2fb;
  color: var(--gf-apply-soft);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

.gf-apply__file-x:hover {
  background: #ffe9e9;
  color: var(--gf-apply-bad);
}

/* ---- consent ------------------------------------------------------------- */

.gf-apply__consent {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f7f5ff;
}

.gf-apply__consent input {
  margin: 2px 0 0;
  width: 17px;
  height: 17px;
  accent-color: var(--gf-apply-purple);
  flex: 0 0 auto;
  cursor: pointer;
}

.gf-apply__consent-text {
  font-size: 0.84rem;
  line-height: 1.5;
}

.gf-apply__consent-small {
  display: block;
  margin-top: 4px;
  font-size: 0.74rem;
  color: var(--gf-apply-soft);
}

.gf-apply__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ---- bottom bar ---------------------------------------------------------- */

.gf-apply__foot {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  padding: 14px 26px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--gf-apply-line);
  background: #ffffff;
}

.gf-apply__send,
.gf-apply__ghost {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 9999px;
  padding: 12px 22px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.gf-apply__send {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 0;
  color: #ffffff;
  background: linear-gradient(135deg, #6c5ce7, #4834d4);
  box-shadow: 0 10px 24px rgba(72, 52, 212, 0.28);
}

.gf-apply__send:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(72, 52, 212, 0.34);
}

.gf-apply__send:disabled {
  opacity: 0.65;
  cursor: progress;
  box-shadow: none;
}

.gf-apply__send svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
  flex: 0 0 auto;
}

.gf-apply__ghost {
  border: 1.5px solid var(--gf-apply-line);
  background: #ffffff;
  color: var(--gf-apply-soft);
}

.gf-apply__ghost:hover {
  background: #f6f4ff;
  color: var(--gf-apply-ink);
}

.gf-apply__spin {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  animation: gf-apply-turn 0.8s linear infinite;
}

@keyframes gf-apply-turn {
  to {
    transform: rotate(360deg);
  }
}

/* ---- messages, success screen -------------------------------------------- */

.gf-apply__says {
  display: none;
  margin: 0 0 14px;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 0.86rem;
  line-height: 1.5;
  background: #fff4f4;
  color: #a32424;
  border: 1px solid #ffd3d3;
}

.gf-apply__says.is-on {
  display: block;
}

.gf-apply__done {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 8px 4px 16px;
}

.gf-apply.is-done .gf-apply__done {
  display: flex;
}

.gf-apply.is-done .gf-apply__form,
.gf-apply.is-done .gf-apply__foot {
  display: none;
}

.gf-apply__tick {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 211, 102, 0.14);
  color: var(--gf-apply-green);
  font-size: 1.7rem;
}

.gf-apply__done h3 {
  margin: 4px 0 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.gf-apply__done p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--gf-apply-soft);
  max-width: 34em;
}

.gf-apply__again {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 8px;
  padding: 13px 26px;
  border: 0;
  border-radius: 9999px;
  background: var(--gf-apply-green);
  color: #ffffff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(37, 211, 102, 0.3);
}

.gf-apply__again:hover {
  transform: translateY(-1px);
}

.gf-apply__again svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.gf-apply__more {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 6px;
}

.gf-apply__more button,
.gf-apply__more a {
  border: 1.5px solid var(--gf-apply-line);
  background: #ffffff;
  color: var(--gf-apply-ink);
  border-radius: 9999px;
  padding: 9px 16px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.gf-apply__more button:hover,
.gf-apply__more a:hover {
  background: #f6f4ff;
  border-color: #cfc8f3;
}

.gf-apply__saved {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--gf-apply-soft);
}

/* ---- while the panel is open --------------------------------------------- */

body.gf-apply-open {
  overflow: hidden;
}

/* The floating WhatsApp button would sit on top of the panel, so it steps
   aside while the panel is open and comes back when it closes. */
body.gf-apply-open .whatsapp-float {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ---- phones -------------------------------------------------------------- */

@media (max-width: 620px) {
  .gf-apply {
    padding: 0;
    align-items: flex-end;
  }

  .gf-apply__card {
    width: 100%;
    max-height: 100%;
    border-radius: 24px 24px 0 0;
  }

  .gf-apply__head {
    padding: 18px 52px 16px 20px;
  }

  .gf-apply__body {
    padding: 16px 20px 8px;
  }

  .gf-apply__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .gf-apply__foot {
    position: sticky;
    bottom: 0;
    padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 20px rgba(24, 18, 62, 0.08);
  }

  .gf-apply__send,
  .gf-apply__ghost {
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 380px) {
  .gf-apply__title {
    font-size: 1.1rem;
  }

  .gf-apply__phone {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .gf-apply__send,
  .gf-apply__ghost {
    padding: 12px 14px;
    font-size: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gf-apply__veil,
  .gf-apply__card,
  .gf-apply__send,
  .gf-apply__x {
    transition: none;
  }

  .gf-apply__spin {
    animation-duration: 2s;
  }
}
