/* =============================================================
   PB-NOTIFY-WIDGET.CSS  v1.2.2 — 2026-03-10
   pbnw-btn font-size 1rem globally; .aji-order-form .pbnw-btn override 8px/1.05rem.
   Base styles for the .pb-notify-widget component.

   GENERATED STRUCTURE (per instance — built by pb-notify-widget.js):
     .pb-notify-widget            outer container (you style placement context)
       .pbnw-already              "already subscribed" notice — hidden by default
       .pbnw-label                optional context label (p tag)
       .pbnw-input-row            email input + submit button (flex row)
         .pbnw-email              email input  (flex: 1)
         .pbnw-btn                submit button (inline-flex, colors via inline style)
           .pbnw-btn-label        button text
           .pbnw-btn-spinner      CSS spinner (shown during submit)
       .pbnw-error                error message (hidden by default)
       .pbnw-fine                 optional fine print (p tag)
       .pbnw-success              success confirmation row (hidden by default)

   MODIFIER CLASSES (add to .pb-notify-widget):
     .pb-notify--dark      dark footer variant (white text, yellow focus ring)
     .pb-notify--compact   tighter spacing for wizard result cards
     .pb-notify--bordered  adds blue border + light-blue background tint

   CUSTOMIZATION:
     Per-placement tweaks go on a wrapping class, not on .pb-notify-widget directly.
     Button background + text colors are set via data-btn-color / data-btn-text-color
     inline styles, so no CSS override is needed for per-instance button color.
   ============================================================= */

/* ----------------------------------------------------------
   Base container
   ---------------------------------------------------------- */
.pb-notify-widget {
  display: block;
  width: 100%;
  font-family: inherit;
  box-sizing: border-box;
}

/* ----------------------------------------------------------
   Bordered variant
   Used for: order form inline OOS panels (model, thickness)
   ---------------------------------------------------------- */
.pb-notify-widget.pb-notify--bordered {
  padding: 0.9rem 1rem;
  background: #f0f7ff;
  border: 1.5px solid var(--aji-bright-blue);
  border-radius: 8px;
  margin-top: 0.85rem;
  animation: pbnwFadeIn 0.2s ease;
}

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

/* ----------------------------------------------------------
   Dark variant
   Used for: footer newsletter (deep-carbon background)
   ---------------------------------------------------------- */
.pb-notify-widget.pb-notify--dark .pbnw-label {
  color: rgba(255, 255, 255, 0.85);
}

.pb-notify-widget.pb-notify--dark .pbnw-email {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.pb-notify-widget.pb-notify--dark .pbnw-email::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.pb-notify-widget.pb-notify--dark .pbnw-email:focus {
  border-color: var(--aji-yellow);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.pb-notify-widget.pb-notify--dark .pbnw-fine {
  color: rgba(255, 255, 255, 0.45);
}

.pb-notify-widget.pb-notify--dark .pbnw-error {
  color: #ff8080;
}

.pb-notify-widget.pb-notify--dark .pbnw-already {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(40, 167, 69, 0.18);
  border-color: rgba(40, 167, 69, 0.4);
}

.pb-notify-widget.pb-notify--dark .pbnw-success {
  background: rgba(40, 167, 69, 0.18);
  border-color: rgba(40, 167, 69, 0.4);
  color: rgba(255, 255, 255, 0.9);
}

/* ----------------------------------------------------------
   Compact variant
   Used for: wizard result card OOS sections
   ---------------------------------------------------------- */
.pb-notify-widget.pb-notify--compact {
  margin-top: 0;
}

.pb-notify-widget.pb-notify--compact .pbnw-label {
  font-size: 0.83rem;
  margin-bottom: 6px;
}

.pb-notify-widget.pb-notify--compact .pbnw-fine {
  font-size: 0.74rem;
  margin-top: 4px;
}

/* ----------------------------------------------------------
   Already-subscribed notice
   ---------------------------------------------------------- */
.pbnw-already {
  /* display:none set inline by default; JS sets display:flex */
  align-items: center;
  gap: 6px;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--aji-green);
  margin-bottom: 8px;
  padding: 5px 9px;
  background: rgba(40, 167, 69, 0.07);
  border: 1px solid rgba(40, 167, 69, 0.25);
  border-radius: 6px;
  line-height: 1.3;
}

.pbnw-already-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ----------------------------------------------------------
   Optional context label
   ---------------------------------------------------------- */
.pbnw-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--aji-deep-carbon);
  margin: 0 0 8px 0;
  line-height: 1.4;
}

/* ----------------------------------------------------------
   Input row — email + button, side by side
   ---------------------------------------------------------- */
.pbnw-input-row {
  display: flex;
  flex-direction: row;
  gap: 8px;
  width: 100%;
}

/* Email input — grows to fill available space */
.pbnw-email {
  flex: 1;
  min-width: 0;           /* prevents flex overflow in narrow containers */
  padding: 0 12px;
  border: 1px solid var(--aji-galvanized-steel);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--aji-deep-carbon);
  background: var(--aji-pure-white);
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pbnw-email:focus {
  outline: none;
  border-color: var(--aji-bright-blue);
  box-shadow: 0 0 0 2px rgba(1, 111, 185, 0.15);
}

.pbnw-email::placeholder {
  color: var(--aji-polished-silver);
}

/* Submit button — base color and hover color driven by CSS custom properties
   set via inline style by pb-notify-widget.js. Using variables instead of
   a direct inline background means the hover rule can override without !important. */
.pbnw-btn {
  flex: 0 0 auto;
  padding: 0 18px;
  border: none;
  border-radius: 0.625rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-sizing: border-box;
  background: var(--pbnw-btn-bg);
  transition: background 0.2s, opacity 0.15s;
  letter-spacing: 0.02em;
}

/* Inside the order form, match .aji-order-form .btn-primary exactly */
.aji-order-form .pbnw-btn {
  border-radius: 8px;
  font-size: 1.05rem;
}

.pbnw-btn:hover:not(:disabled) {
  background: var(--pbnw-btn-hover-bg);
}

.pbnw-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* ── Spinner ──────────────────────────────────────────────── */
/* Hidden by default; shown during submit via JS inline style.
   border-top-color uses currentColor so it inherits the
   button text color automatically without needing to know it. */
.pbnw-btn-spinner {
  display: none;          /* JS sets display:inline-block during submit */
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: pbnwSpin 0.75s linear infinite;
  flex-shrink: 0;
}

@keyframes pbnwSpin {
  to { transform: rotate(360deg); }
}

/* Stack vertically on narrow screens */
@media (max-width: 640px) {
  .pbnw-input-row {
    flex-direction: column;
  }

  .pbnw-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ----------------------------------------------------------
   Inline error message
   ---------------------------------------------------------- */
.pbnw-error {
  display: none;          /* JS sets display:block on error */
  font-size: 0.8rem;
  color: var(--aji-alert-red);
  margin-top: 5px;
  line-height: 1.35;
  min-height: 0;          /* collapses when empty */
}

/* ----------------------------------------------------------
   Optional fine print
   ---------------------------------------------------------- */
.pbnw-fine {
  font-size: 0.78rem;
  color: var(--aji-brushed-steel);
  margin: 6px 0 0 0;
  line-height: 1.3;
}

/* ----------------------------------------------------------
   Success state
   ---------------------------------------------------------- */
.pbnw-success {
  display: none;          /* JS sets display:flex on success */
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(40, 167, 69, 0.07);
  border: 1px solid rgba(40, 167, 69, 0.3);
  border-radius: 6px;
  font-size: 0.88rem;
  color: var(--aji-deep-carbon);
  font-weight: 600;
  margin-top: 8px;
  flex-wrap: wrap;
  line-height: 1.3;
}
