/**
 * sentryform.css - SentryForm v0.8.1
 *
 * ALL styles for SentryForm forms, validation, success panel, and error banners.
 * Scoped under `.sentryform` with two layers:
 *   BASE LAYER  - styles bare HTML elements inside .sentryform .sf-form
 *   CLASS LAYER - sf- prefixed classes for branded/customized markup (overrides base)
 * Zero collision with host CSS. No !important.
 *
 * Brand customization via CSS custom properties on .sentryform:
 *   --sf-brand:       Primary brand color (default: #333)
 *   --sf-brand-hover: Button hover color (derived if not set)
 *   --sf-radius:      Border radius (default: 5px)
 *   --sf-font:        Font family (default: inherit from host)
 *   --sf-error:       Validation error color (default: #d9534f)
 */

/* ==================================================================
   RESET & WRAPPER
   ================================================================== */

.sentryform {
  --_brand: var(--sf-brand, #333);
  --_radius: var(--sf-radius, 5px);
  --_font: var(--sf-font, inherit);
  --_error: var(--sf-error, #d9534f);
  font-family: var(--_font);
  line-height: 1.5;
  color: #333;
  box-sizing: border-box;
  /* Wrapper reset: lightweight defense against inherited border styles.
     Installers should remove host border/bg utility classes from the
     wrapper div at migration time (see ARCHITECTURE migration checklist). */
}
.sentryform *,
.sentryform *::before,
.sentryform *::after {
  box-sizing: inherit;
}

/* ==================================================================
   FORM CONTAINER
   ================================================================== */

.sentryform .sf-form {
  background: linear-gradient(
    to right,
    hsla(0, 0%, 79%, 1),
    hsla(0, 0%, 96%, 1) 50%,
    hsla(0, 0%, 79%, 1)
  );
  border-radius: var(--_radius);
  box-shadow: 1px 1px 3px 0 rgba(119, 119, 119, 0.75);
  padding: 8px 10px 10px;
}

/* ==================================================================
   BASE LAYER - Bare HTML Elements
   Styles plain HTML forms inside .sentryform .sf-form with zero
   sf- classes required. Lower specificity than sf- class rules so
   the class layer overrides cleanly.
   ================================================================== */

.sentryform .sf-form :where(input:not([type="hidden"]):not([type="submit"]):not([type="checkbox"]):not([type="radio"])) {
  width: 100%;
  height: 36px;
  font-size: 14px;
  padding: 8px;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #fff;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.15s;
}
.sentryform .sf-form :where(input:not([type="hidden"]):not([type="submit"]):not([type="checkbox"]):not([type="radio"])):focus {
  border-color: var(--_brand);
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--_brand) 15%, transparent);
}

.sentryform .sf-form :where(select) {
  width: 100%;
  height: 36px;
  font-size: 14px;
  padding: 8px;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #fff;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.15s;
  appearance: menulist;
  -webkit-appearance: menulist;
  -moz-appearance: menulist;
  cursor: pointer;
}
.sentryform .sf-form :where(select):focus {
  border-color: var(--_brand);
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--_brand) 15%, transparent);
}

.sentryform .sf-form :where(textarea) {
  width: 100%;
  height: 70px;
  font-size: 14px;
  padding: 8px;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #fff;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.15s;
  resize: vertical;
}
.sentryform .sf-form :where(textarea):focus {
  border-color: var(--_brand);
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--_brand) 15%, transparent);
}

.sentryform .sf-form :where(label) {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #666;
  margin: 8px 0 4px;
  line-height: 1.2;
}

.sentryform .sf-form :where(button[type="submit"]) {
  display: block;
  width: 100%;
  padding: 12px;
  margin: 16px 0 10px;
  border: 1px solid var(--_brand);
  border-radius: var(--_radius);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), 0 3px 10px rgba(0, 0, 0, 0.19);
  outline: none;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  background-color: var(--_brand);
  transition: all 0.2s ease-in-out;
  cursor: pointer;
}
.sentryform .sf-form :where(button[type="submit"]):hover,
.sentryform .sf-form :where(button[type="submit"]):focus,
.sentryform .sf-form :where(button[type="submit"]):active {
  opacity: 0.9;
  filter: brightness(1.1);
}

/* ==================================================================
   FORM HEADER
   ================================================================== */

.sentryform .sf-header {
  background: var(--_brand);
  border-radius: var(--_radius);
  margin: 10px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 8px 0;
}
.sentryform .sf-title {
  color: #fff;
  font-size: 2.2rem;
  font-weight: bold;
  margin: 0;
  padding: 0;
}

/* ==================================================================
   PRIVACY / SECURITY BAR
   ================================================================== */

.sentryform .sf-privacy {
  color: #fff;
  background: #4b4b4b;
  font-size: 0.9em;
  font-weight: normal;
  border-radius: var(--_radius);
  padding: 10px 0;
  text-align: center;
  margin-bottom: 12px;
}

/* ==================================================================
   LABELS & INPUTS
   ================================================================== */

.sentryform .sf-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #666;
  margin: 8px 0 4px;
  line-height: 1.2;
}
.sentryform .sf-req {
  color: #cc0000;
  margin-left: 1px;
}
.sentryform .sf-input,
.sentryform .sf-select,
.sentryform .sf-textarea {
  width: 100%;
  height: 36px;
  font-size: 14px;
  padding: 8px;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #fff;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.15s;
}
.sentryform .sf-input:focus,
.sentryform .sf-select:focus,
.sentryform .sf-textarea:focus {
  border-color: var(--_brand);
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--_brand) 15%, transparent);
}
.sentryform .sf-textarea {
  height: 70px;
  resize: vertical;
}
.sentryform .sf-select {
  appearance: menulist;
  -webkit-appearance: menulist;
  -moz-appearance: menulist;
  cursor: pointer;
}

/* ==================================================================
   SECTION LABELS (for grouped form layouts)
   ================================================================== */

.sentryform .sf-section-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--_brand);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 8px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #ddd;
}

/* ==================================================================
   FORM ROWS (side-by-side fields)
   ================================================================== */

.sentryform .sf-row {
  display: flex;
  gap: 8px;
  margin-bottom: 0;
}
.sentryform .sf-field {
  flex: 1;
  margin-bottom: 8px;
  position: relative;
}
.sentryform .sf-field.sf-w-auto {
  flex: 0 0 auto;
}
.sentryform .sf-field.sf-state-field {
  flex: 0 0 60px;
}
.sentryform .sf-field.sf-zip-field {
  flex: 0 0 80px;
}

/* ==================================================================
   SUBMIT BUTTON
   ================================================================== */

.sentryform .sf-button {
  display: block;
  width: 100%;
  padding: 12px;
  margin: 16px 0 10px;
  border: 1px solid var(--_brand);
  border-radius: var(--_radius);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), 0 3px 10px rgba(0, 0, 0, 0.19);
  outline: none;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  background-color: var(--_brand);
  transition: all 0.2s ease-in-out;
  cursor: pointer;
}
.sentryform .sf-button:hover,
.sentryform .sf-button:focus,
.sentryform .sf-button:active {
  opacity: 0.9;
  filter: brightness(1.1);
}

/* ==================================================================
   REQUIRED LEGEND
   ================================================================== */

.sentryform .sf-req-legend {
  font-size: 11px;
  color: #888;
  margin: 12px 0 4px;
}
.sentryform .sf-req-legend .sf-req {
  color: #cc0000;
}

/* ==================================================================
   INLINE VALIDATION
   ================================================================== */

.sentryform .sf-field-error {
  display: block;
  color: var(--_error);
  font-size: 12px;
  line-height: 1.3;
  margin-top: 3px;
  padding: 0;
}
.sentryform .sf-field-invalid {
  border-color: var(--_error);
}
.sentryform .sf-field-invalid:focus {
  border-color: var(--_error);
  box-shadow: 0 0 0 2px rgba(217, 83, 79, 0.15);
}

/* ==================================================================
   FORM-LEVEL ERROR BANNER
   ================================================================== */

.sentryform .sf-error-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #fef2f2;
  border: 1px solid var(--_error);
  border-radius: var(--_radius);
  padding: 10px 14px;
  margin: 12px 0;
  font-size: 14px;
  line-height: 1.4;
  color: #7c2d2d;
}
.sentryform .sf-error-icon {
  color: var(--_error);
  font-size: 16px;
  flex-shrink: 0;
  line-height: 1.4;
}
.sentryform .sf-error-text {
  flex: 1;
}

/* ==================================================================
   SPAM DEFENSE UTILITIES
   ================================================================== */

.sentryform .sf-honeypot,
.honeypot,
input.honeypot,
div.honeypot {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  tab-index: -1;
}
.sentryform .sf-messages {
  display: none;
}

/* ==================================================================
   SUCCESS PANEL
   ================================================================== */

.sentryform .sf-success-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0;
  padding: 16px 24px 20px;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.sentryform .sf-success-container.sf-show {
  opacity: 1;
}
.sentryform .sf-success-container.sf-fade-out {
  opacity: 0;
  transition: opacity 0.9s ease;
}
/* Border resets to defeat host CSS inheritance */
.sentryform .sf-success-container,
.sentryform .sf-success-container div,
.sentryform .sf-success-container ul,
.sentryform .sf-success-container li,
.sentryform .sf-success-container p,
.sentryform .sf-success-container strong {
  border: none;
  border-bottom: none;
}

/* ---- Animated Checkmark ---- */
.sentryform .sf-success-checkmark {
  margin: 0;
  padding: 0;
}
.sentryform .sf-success-icon {
  width: 48px;
  height: 48px;
}
.sentryform .sf-success-icon-circle {
  stroke: var(--_brand);
  stroke-width: 2;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: sfCheckCircle 0.6s ease forwards;
}
.sentryform .sf-success-icon-check {
  stroke: var(--_brand);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: sfCheckStroke 0.4s 0.4s ease forwards;
}

@keyframes sfCheckCircle {
  to { stroke-dashoffset: 0; }
}
@keyframes sfCheckStroke {
  to { stroke-dashoffset: 0; }
}

/* ---- Success Content ---- */
.sentryform .sf-success-content {
  max-width: 480px;
  margin: 0;
  padding: 0;
}
.sentryform .sf-success-title {
  font-family: Verdana, sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--_brand);
  margin: 0 0 10px;
  background: none;
  background-image: none;
  border: none;
  padding: 0;
  text-shadow: none;
  line-height: 1.4;
}
.sentryform .sf-success-message {
  font-family: Verdana, sans-serif;
  font-size: 13px;
  color: #555;
  line-height: 1.6;
  margin: 0 0 18px;
}

/* ---- What Happens Next ---- */
.sentryform .sf-success-details {
  text-align: left;
  margin: 0 auto;
  max-width: 400px;
}
.sentryform .sf-success-details strong {
  font-family: Verdana, sans-serif;
  font-size: 13px;
  color: var(--_brand);
  display: block;
  margin-bottom: 10px;
}
.sentryform .sf-success-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step;
}
.sentryform .sf-success-steps li {
  font-family: Verdana, sans-serif;
  font-size: 13px;
  color: #444;
  line-height: 1.5;
  padding: 4px 0 4px 30px;
  position: relative;
  counter-increment: step;
}
.sentryform .sf-success-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--_brand);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  line-height: 20px;
}

/* ---- Legacy Error Messages ---- */
.sentryform .sf-messages.sf-error {
  background: #fef3cd;
  border: 1px solid #ffc107;
  color: #664d03;
  padding: 12px 16px;
  border-radius: 4px;
  font-family: Verdana, sans-serif;
  font-size: 14px;
  margin: 12px 0;
}

/* ==================================================================
   FORM ALIGNMENT UTILITIES
   ================================================================== */

.sentryform .sf-form-offset {
  margin-top: -51px;
}
.sentryform .sf-form-top-margin {
  margin-top: 27px;
}
.sentryform .sf-form-anchor {
  height: 0;
}

/* ==================================================================
   SEPARATOR
   ================================================================== */

.sentryform .sf-separator {
  border: 0;
  height: 1px;
  background-image: linear-gradient(
    to right,
    rgba(0, 0, 0, 0),
    rgba(128, 128, 128, 0.75),
    rgba(0, 0, 0, 0)
  );
}

/* ==================================================================
   RESPONSIVE: MOBILE
   ================================================================== */

@media (max-width: 520px) {
  .sentryform .sf-row {
    flex-direction: column;
    gap: 0;
  }
  .sentryform .sf-field {
    margin-bottom: 10px;
  }
  .sentryform .sf-field.sf-state-field,
  .sentryform .sf-field.sf-zip-field {
    flex: 1;
  }
  .sentryform .sf-input,
  .sentryform .sf-select {
    height: 42px;
    font-size: 16px;
  }
  .sentryform .sf-textarea {
    height: 100px;
    font-size: 16px;
  }
  .sentryform .sf-label {
    font-size: 14px;
    margin-bottom: 5px;
  }
  .sentryform .sf-button {
    font-size: 17px;
    padding: 14px;
  }
}

/* ==================================================================
   RESPONSIVE: TABLET
   ================================================================== */

@media (min-width: 521px) and (max-width: 767px) {
  .sentryform .sf-field.sf-state-field {
    flex: 0 0 70px;
  }
  .sentryform .sf-field.sf-zip-field {
    flex: 0 0 90px;
  }
}

@media (max-width: 767px) {
  .sentryform .sf-form-offset {
    margin-top: 20px;
    margin-bottom: 20px;
  }
}
