/* Training Bot hero form (release 4, templates/homepage_new/section1.php) and the /try frame it opens (training-bot.js).
   Geometry at 1440 — Figma 9203:25828 (hero_3): a white box 640×62, border 1px #D7DBDE, the orange button 290×48 inside
   on the right, 7 px from the box edge. The form sits in div.hero-buttons (homepage_new.css: flex, centred, wrap);
   the button reuses .hero-buttons .hero-button.button-orange, written for an <a>: the <button> defaults are reset here.
   Selectors start only with :root, .hero-try…, .oscar-try-frame, body.oscar-try-open, body.oscar-try-pending
   (tools/tests/test_hero_theme.py test_css_scoped). */

/* both documents light: a dark-mode browser would otherwise paint the frame's canvas opaque (CSS Color Adjust 1 §2.2) */
:root {
  color-scheme: light;
}

.hero-try-form {
  width: 640px;
  max-width: 100%;
}

.hero-try-box {
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  height: 62px;
  padding: 6px;
  background: #fff;
  border: 1px solid #d7dbde;
  border-radius: 12px;
}

.hero-try-box:focus-within {
  border-color: #e66d17;
  box-shadow: 0 0 0 3px rgba(247, 138, 59, 0.2);
}

.hero-try-box:has(.hero-try-input[aria-invalid='true']) {
  border-color: #d92d20;
}

.hero-try-input {
  flex: 1 1 auto;
  min-width: 0;
  box-sizing: border-box;
  height: 48px;
  margin: 0;
  padding: 0 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-family: 'Google Sans Flex', sans-serif;
  font-size: 16px;
  line-height: 24px;
  color: #000;
  outline: none;
}

.hero-try-input::placeholder {
  color: #a0a0a0;
  opacity: 1;
}

.hero-try-form .hero-try-submit {
  flex: 0 0 auto;
  box-sizing: border-box;
  height: 48px;
  margin: 0;
  padding: 4px 4px 4px 24px;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
}

.hero-try-note,
.hero-try-error {
  margin: 12px 0 0;
  font-family: 'Google Sans Flex', sans-serif;
  font-size: 14px;
  line-height: 20px;
  text-align: center;
}

.hero-try-note {
  color: #5e6274;
}

.hero-try-error {
  color: #d92d20;
}

.hero-try-error[hidden] {
  display: none;
}

@media screen and (max-width: 767.8px) {
  .hero-try-box {
    flex-direction: column;
    align-items: stretch;
    height: auto;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
  }

  .hero-try-box:focus-within {
    box-shadow: none;
  }

  .hero-try-input {
    width: 100%;
    padding: 0 12px;
    background: #fff;
    border: 1px solid #d7dbde;
  }

  .hero-try-input:focus {
    border-color: #e66d17;
  }

  .hero-try-input[aria-invalid='true'] {
    border-color: #d92d20;
  }

  .hero-try-form .hero-try-submit {
    width: 100%;
  }
}

/* the /try frame: the whole window, see-through (/try draws its own backdrop), above the Oscar bubble (999999) and «$1» */
.oscar-try-frame {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  color-scheme: light;
  z-index: 2147483000;
}

/* the «$1» rule backs up all-page.js for tabs opened before the release with the old script */
body.oscar-try-open .oscar-widget-container,
body.oscar-try-open .modal-window__popup {
  display: none !important;
}

/* until /try says ready: the page dims in Figma's overlay colour (9203:25969, 9203:26088), the one /try's own overlay
   uses (frontend Try.module.scss .layer) — no flash of another shade when /try takes over — and the button looks busy
   (the content owner approves that look) */
body.oscar-try-pending::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(68, 71, 85, 0.4);
  z-index: 2147482999;
}

body.oscar-try-pending .hero-try-submit {
  cursor: progress;
  animation: hero-try-busy 1.2s ease-in-out infinite;
}

@keyframes hero-try-busy {
  50% {
    opacity: 0.6;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.oscar-try-pending .hero-try-submit {
    animation: none;
    opacity: 0.7;
  }
}
