/* Freight One Group recruiting chat + preview ribbon.
   Matches the live site tokens: ink #121214, red #D12030, paper #F6F4F1,
   Barlow Condensed / Inter. */

.fog-preview-ribbon {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  text-align: center;
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
  background: #D12030;
  padding: 0.4rem 0.75rem;
  line-height: 1.3;
}

body {
  padding-top: 2.15rem;
}
.site-header {
  top: 2.15rem;
}

.fog-chat {
  --ink: #121214;
  --ink-2: #1b1b1f;
  --ink-3: #26262b;
  --red: #D12030;
  --red-deep: #9C1523;
  --red-hover: #e02536;
  --paper: #F6F4F1;
  --paper-soft: rgba(246, 244, 241, 0.82);
  --paper-mute: rgba(246, 244, 241, 0.6);
  --line: rgba(255, 255, 255, 0.14);
  --header: "Barlow Condensed", "Arial Narrow", sans-serif;
  --label: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  font-family: var(--label);
  font-weight: 500;
  color: var(--paper);
}

.fog-chat-launcher {
  position: fixed;
  right: 1.25rem;
  bottom: 1.5rem;
  z-index: 220;
  width: 3.6rem;
  height: 3.6rem;
  border: 0;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  box-shadow: 0 10px 28px rgba(209, 32, 48, 0.45);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, transform 0.2s ease;
}
.fog-chat-launcher:hover,
.fog-chat-launcher:focus-visible {
  background: var(--red-hover);
  outline: 2px solid var(--paper);
  outline-offset: 3px;
}
.fog-chat-launcher[aria-expanded="true"] {
  transform: scale(0.96);
}
.fog-chat-launcher svg {
  width: 1.55rem;
  height: 1.55rem;
  display: block;
}

.fog-chat-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 5.6rem;
  z-index: 230;
  width: min(26.5rem, calc(100vw - 1.5rem));
  height: min(36rem, calc(100dvh - 8.5rem));
  display: flex;
  flex-direction: column;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.fog-chat-panel[hidden] { display: none; }

.fog-chat-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 0.85rem 0.8rem 1rem;
  background: var(--ink-2);
  border-bottom: 1px solid var(--line);
}
.fog-chat-header img {
  width: auto;
  height: 1.85rem;
  flex: none;
}
.fog-chat-header h2 {
  margin: 0;
  font-family: var(--header);
  font-style: italic;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.05;
}
.fog-chat-header p {
  margin: 0.15rem 0 0;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 600;
}
.fog-chat-header-copy { flex: 1; min-width: 0; }
.fog-chat-header-actions {
  display: flex;
  gap: 0.2rem;
}
.fog-chat-icon-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--paper-soft);
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.45rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.fog-chat-icon-btn:hover,
.fog-chat-icon-btn:focus-visible {
  background: rgba(209, 32, 48, 0.18);
  color: #fff;
  outline: 2px solid var(--red);
  outline-offset: 0;
}
.fog-chat-icon-btn svg { width: 1.15rem; height: 1.15rem; display: block; }

.fog-chat-log {
  position: relative;
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.9rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  -webkit-overflow-scrolling: touch;
}
.fog-chat-log:focus { outline: none; }
.fog-chat-log:focus-visible { outline: 2px solid var(--red); outline-offset: -2px; }

.fog-chat-bubble {
  max-width: 92%;
  padding: 0.7rem 0.85rem;
  border-radius: 0.85rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--paper);
  background: var(--ink-3);
  align-self: flex-start;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.fog-chat-bubble.is-user {
  align-self: flex-end;
  background: var(--red);
  color: #fff;
  font-weight: 600;
}
.fog-chat-bubble.is-consent {
  font-size: 0.84rem;
  line-height: 1.5;
  border: 1px solid var(--line);
  box-shadow: inset 3px 0 0 var(--red);
}

.fog-chat-typing {
  align-self: flex-start;
  display: flex;
  gap: 0.28rem;
  padding: 0.7rem 0.85rem;
  background: var(--ink-3);
  border-radius: 0.85rem;
}
.fog-chat-typing span {
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: var(--red);
  opacity: 0.4;
  animation: fog-chat-dot 1.1s ease-in-out infinite;
}
.fog-chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.fog-chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes fog-chat-dot {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

.fog-chat-footer {
  padding: 0.65rem 0.8rem 0.85rem;
  border-top: 1px solid var(--line);
  background: var(--ink-2);
}
.fog-chat-legal {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--paper-mute);
}
.fog-chat-legal[hidden] { display: none; }
.fog-chat-legal a {
  color: var(--paper-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.fog-chat-legal a:hover,
.fog-chat-legal a:focus-visible {
  color: #fff;
}
.fog-chat-turnstile-wrap {
  margin: 0 0 0.55rem;
  padding: 0.5rem 0.55rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(209, 32, 48, 0.28);
}
.fog-chat-turnstile-wrap[hidden] {
  display: none;
}
.fog-chat-turnstile {
  display: flex;
  justify-content: center;
  min-height: 65px;
  overflow: hidden;
}
.fog-chat-turnstile iframe {
  max-width: 100%;
}
.fog-chat-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.55rem;
}
.fog-chat-choices:empty { display: none; margin: 0; }
.fog-chat-choice {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: transparent;
  color: #fff;
  font-family: var(--header);
  font-weight: 700;
  font-style: italic;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.fog-chat-choice:hover,
.fog-chat-choice:focus-visible {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.08);
  outline: 2px solid var(--paper);
  outline-offset: 2px;
}
.fog-chat-choice.is-primary,
.fog-chat-choice.is-apply {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 8px 20px -10px rgba(209, 32, 48, 0.7);
}
.fog-chat-choice.is-primary:hover,
.fog-chat-choice.is-primary:focus-visible,
.fog-chat-choice.is-apply:hover,
.fog-chat-choice.is-apply:focus-visible {
  background: var(--red-hover);
  border-color: var(--red-hover);
}

.fog-chat-form {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.fog-chat-form[hidden] { display: none; }
.fog-chat-form label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.fog-chat-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--ink);
  color: var(--paper);
  border-radius: 0.7rem;
  padding: 0.6rem 0.75rem;
  font: inherit;
}
.fog-chat-form input:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 1px;
}
.fog-chat-form button[type="submit"] {
  appearance: none;
  border: 0;
  background: var(--red);
  color: #fff;
  font-family: var(--header);
  font-weight: 700;
  font-style: italic;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 0.7rem;
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  flex: none;
}
.fog-chat-form button[type="submit"]:hover,
.fog-chat-form button[type="submit"]:focus-visible {
  background: var(--red-hover);
  outline: 2px solid var(--paper);
  outline-offset: 2px;
}
.fog-chat-form button[type="submit"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.fog-chat-debug {
  position: fixed;
  left: 0.75rem;
  bottom: 5.75rem;
  z-index: 240;
  width: min(28rem, calc(100vw - 1.5rem));
  max-height: min(42vh, 22rem);
  overflow: auto;
  background: #0b0b0d;
  color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  box-shadow: var(--shadow);
  padding: 0.75rem 0.8rem;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.4;
}
.fog-chat-debug[hidden] { display: none; }
.fog-chat-debug h2 {
  margin: 0 0 0.45rem;
  font-family: var(--header);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
}
.fog-chat-debug label,
.fog-chat-debug .row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.7rem;
  align-items: center;
  margin: 0 0 0.4rem;
  font-family: var(--label);
  font-size: 0.75rem;
}
.fog-chat-debug select,
.fog-chat-debug input[type="checkbox"] {
  font: inherit;
  color: var(--ink);
}
.fog-chat-debug h3 {
  margin: 0.55rem 0 0.2rem;
  font-family: var(--label);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
}
.fog-chat-debug pre {
  margin: 0.2rem 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--paper-soft);
  max-height: 14rem;
  overflow: auto;
  background: #121214;
  padding: 0.45rem 0.5rem;
  border-radius: 0.35rem;
}
@media (max-width: 720px) {
  .fog-chat-debug {
    max-height: 22vh;
  }
  .fog-chat-debug pre { max-height: 8rem; }
}

@media (max-width: 720px) {
  .fog-chat-launcher {
    right: 0.85rem;
    bottom: 1.25rem;
    width: 3.35rem;
    height: 3.35rem;
  }
  .fog-chat-panel {
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
    bottom: 5.15rem;
    height: min(38rem, calc(100dvh - 7.5rem));
    border-radius: 0.9rem;
  }
  .fog-chat-debug {
    left: 0.5rem;
    right: 0.5rem;
    width: auto;
    bottom: auto;
    top: 2.6rem;
    max-height: 28vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fog-chat-launcher,
  .fog-chat-choice,
  .fog-chat-form button {
    transition: none;
  }
  .fog-chat-typing span { animation: none; opacity: 0.8; }
}
