/*
 * Home Rangers — Callback Popup styles
 * All selectors are prefixed with hrcb- so nothing collides with the active theme.
 * Colors live in CSS variables at the top — change these to match your exact brand palette.
 */

:root {
  --hrcb-green: #1B3A2F;
  --hrcb-green-dark: #12271F;
  --hrcb-gold: #C89B3C;
  --hrcb-orange: #D9541F;
  --hrcb-orange-dark: #C2481A;
  --hrcb-ink: #182620;
  --hrcb-ink-soft: #55665D;
  --hrcb-success: #2F8557;
  --hrcb-error: #B3261E;
  --hrcb-card: #FFFFFF;
  --hrcb-overlay: rgba(18, 39, 31, 0.55);
  --hrcb-font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --hrcb-font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --hrcb-radius: 14px;
}

/* JS shows/hides the trigger, overlay and modal by toggling the native
   `hidden` attribute. Since those elements also declare their own `display`
   below (flex/inline-flex), that declaration silently wins over the browser's
   built-in "[hidden] { display: none }" rule — same specificity tier, but an
   author rule always beats the user-agent default. Restating it here with
   !important is the standard fix so `hidden` is guaranteed to actually hide
   the element. Do not remove this even if it looks redundant. */
.hrcb-trigger[hidden],
.hrcb-overlay[hidden],
.hrcb-modal[hidden] {
  display: none !important;
}

/* ---------- Floating trigger ---------- */
.hrcb-trigger {
  position: fixed;
  right: 25px;
  bottom: 80px;
  z-index: 999998;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px 14px 16px;
  background: var(--hrcb-green);
  color: #fff;
  border: 2px solid var(--hrcb-gold);
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(18, 39, 31, 0.35);
  cursor: pointer;
  font-family: var(--hrcb-font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.02em;
  line-height: 1;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.hrcb-trigger:hover {
  background: var(--hrcb-green-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(18, 39, 31, 0.4);
}
.hrcb-trigger:focus-visible {
  outline: 3px solid var(--hrcb-gold);
  outline-offset: 3px;
}
.hrcb-trigger-icon {
  width: 20px;
  height: 20px;
  flex: none;
}
.hrcb-trigger-ping {
  position: absolute;
  inset: -3px;
  border-radius: 999px;
  border: 3px solid var(--hrcb-gold);
  opacity: 0;
  pointer-events: none;
  animation: hrcb-ping 2.2s ease-out infinite;
}
@keyframes hrcb-ping {
  0% {
    opacity: 0.8;
    transform: scale(1);
  }
  80% {
    opacity: 0;
    transform: scale(1.55);
  }
  100% {
    opacity: 0;
    transform: scale(1.55);
  }
}

@media (max-width: 480px) {
  .hrcb-trigger {
    right: 20px;
    bottom: 80px;
    padding: 14px;
    border-radius: 50%;
  }
  .hrcb-trigger-label {
    display: none;
  }
}

/* ---------- Overlay & modal ---------- */
.hrcb-overlay {
  position: fixed;
  inset: 0;
  background: var(--hrcb-overlay);
  z-index: 999999;
  opacity: 0;
  animation: hrcb-fade 0.18s ease forwards;
}
@keyframes hrcb-fade {
  to {
    opacity: 1;
  }
}

.hrcb-modal {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.hrcb-modal-inner {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--hrcb-card);
  border-radius: var(--hrcb-radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  animation: hrcb-pop 0.22s ease forwards;
}
@keyframes hrcb-pop {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.hrcb-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  box-sizing: border-box;
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.hrcb-close:hover {
  background: rgba(255, 255, 255, 0.28);
}
.hrcb-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.hrcb-header {
  background: var(--hrcb-green);
  border-bottom: 3px solid var(--hrcb-gold);
  padding: 24px 28px 18px;
  text-align: center;
}
.hrcb-badge {
  width: 34px;
  height: 34px;
  color: var(--hrcb-gold);
  margin-bottom: 8px;
}
.hrcb-title {
  margin: 0;
  color: #fff;
  font-family: var(--hrcb-font-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: 0.01em;
}

.hrcb-body {
  padding: 20px 28px 26px;
}
.hrcb-subtext {
  margin: 0 0 18px;
  color: var(--hrcb-ink-soft);
  font-family: var(--hrcb-font-body);
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
}

.hrcb-field {
  margin-bottom: 14px;
}
.hrcb-field label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--hrcb-font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--hrcb-ink);
}
.hrcb-optional {
  font-weight: 400;
  color: var(--hrcb-ink-soft);
}
.hrcb-field input[type='text'],
.hrcb-field input[type='tel'] {
  box-sizing: border-box;
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #d8ded9;
  border-radius: 8px;
  font-family: var(--hrcb-font-body);
  font-size: 16px;
  color: var(--hrcb-ink);
  background: #fff;
}
.hrcb-field input:focus {
  outline: none;
  border-color: var(--hrcb-green);
  box-shadow: 0 0 0 3px rgba(27, 58, 47, 0.15);
}
.hrcb-error {
  margin: 6px 0 0;
  color: var(--hrcb-error);
  font-size: 13px;
}

.hrcb-hp {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}

.hrcb-consent {
  margin: 4px 0 18px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--hrcb-ink-soft);
}
.hrcb-consent a {
  color: var(--hrcb-ink-soft);
}

.hrcb-submit {
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-radius: 8px;
  background: var(--hrcb-orange);
  color: #fff;
  font-family: var(--hrcb-font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.hrcb-submit:hover {
  background: var(--hrcb-orange-dark);
}
.hrcb-submit:active {
  transform: scale(0.98);
}
.hrcb-submit:focus-visible {
  outline: 3px solid var(--hrcb-green);
  outline-offset: 2px;
}
.hrcb-submit[disabled] {
  opacity: 0.7;
  cursor: default;
}

.hrcb-form-message {
  margin: 12px 0 0;
  font-size: 14px;
  text-align: center;
  color: var(--hrcb-error);
}

.hrcb-success {
  padding: 10px 0 4px;
  text-align: center;
}
.hrcb-success svg {
  width: 46px;
  height: 46px;
  color: var(--hrcb-success);
  margin-bottom: 10px;
}
.hrcb-success p {
  margin: 0;
  font-family: var(--hrcb-font-body);
  font-size: 15px;
  color: var(--hrcb-ink);
  line-height: 1.5;
}

.hrcb-altcall {
  margin: 18px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--hrcb-ink-soft);
}
.hrcb-altcall a {
  color: var(--hrcb-green);
  font-weight: 700;
  text-decoration: none;
}
.hrcb-altcall a:hover {
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  .hrcb-overlay,
  .hrcb-modal-inner,
  .hrcb-trigger-ping {
    animation: none !important;
  }
  .hrcb-modal-inner {
    opacity: 1;
    transform: none;
  }
  .hrcb-overlay {
    opacity: 1;
  }
}
