/* BlueSpruce Tiny Home Rater — Self-contained front-end styles */
/* Scoped to #bstr-rater-wrap to avoid theme conflicts */

#bstr-rater-wrap {
  --bstr-green:     var(--pine);
  --bstr-green-dk:  var(--spruce-navy);
  --bstr-copper:    var(--alpine-copper);
  --bstr-bg:        var(--ivory);
  --bstr-white:     var(--white);
  --bstr-border:    var(--line);
  --bstr-text:      var(--charcoal);
  --bstr-muted:     var(--pine);
  --bstr-radius:    8px;
  --bstr-shadow:    0 2px 12px rgba(0,0,0,0.08);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  color: var(--bstr-text);
  line-height: 1.5;
}

/* Hero */
#bstr-rater-wrap .bstr-hero {
  padding: 32px 0 24px;
}
#bstr-rater-wrap .bstr-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bstr-copper);
  margin-bottom: 8px;
}
#bstr-rater-wrap .bstr-hero-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--bstr-green-dk);
}
#bstr-rater-wrap .bstr-hero-sub {
  font-size: 1rem;
  color: var(--bstr-muted);
  margin: 0;
}

/* Layout */
#bstr-rater-wrap .rater-container {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
  padding-bottom: 48px;
}

@media (max-width: 900px) {
  #bstr-rater-wrap .rater-container {
    grid-template-columns: 1fr;
  }
  #bstr-rater-wrap .results-panel {
    order: -1;
  }
}

/* Form panel */
#bstr-rater-wrap .form-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Sections */
#bstr-rater-wrap .rater-section {
  background: var(--bstr-white);
  border: 1px solid var(--bstr-border);
  border-radius: var(--bstr-radius);
  overflow: hidden;
  box-shadow: var(--bstr-shadow);
}

#bstr-rater-wrap .rater-section-header {
  padding: 14px 20px;
  font-weight: 600;
  font-size: 14px;
  background: var(--bstr-green);
  color: #fff;
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: 0.02em;
}
#bstr-rater-wrap .rater-section-header::after {
  content: '▲';
  font-size: 11px;
  opacity: 0.7;
}
#bstr-rater-wrap .rater-section.collapsed .rater-section-header::after {
  content: '▼';
}

#bstr-rater-wrap .rater-section-content {
  padding: 20px;
  display: block;
}
#bstr-rater-wrap .rater-section.collapsed .rater-section-content {
  display: none;
}

/* Grid */
#bstr-rater-wrap .rater-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) {
  #bstr-rater-wrap .rater-grid {
    grid-template-columns: 1fr;
  }
}
#bstr-rater-wrap .rater-full-width {
  grid-column: 1 / -1;
}

/* Input groups */
#bstr-rater-wrap .rater-input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
#bstr-rater-wrap .rater-input-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--bstr-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
#bstr-rater-wrap .bstr-required {
  color: #c0392b;
}

#bstr-rater-wrap input[type="text"],
#bstr-rater-wrap input[type="number"],
#bstr-rater-wrap input[type="email"],
#bstr-rater-wrap input[type="tel"],
#bstr-rater-wrap select,
#bstr-rater-wrap textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--bstr-border);
  border-radius: 5px;
  font-size: 14px;
  font-family: inherit;
  color: var(--bstr-text);
  background: var(--bstr-bg);
  box-sizing: border-box;
  transition: border-color 0.15s;
}
#bstr-rater-wrap input:focus,
#bstr-rater-wrap select:focus,
#bstr-rater-wrap textarea:focus {
  outline: none;
  border-color: var(--bstr-green);
  background: var(--bstr-white);
}
#bstr-rater-wrap textarea {
  resize: vertical;
  min-height: 72px;
}

/* Static value (Policy Form = DP-2) */
#bstr-rater-wrap .bstr-static-value {
  padding: 9px 12px;
  border: 1px solid var(--bstr-border);
  border-radius: 5px;
  font-size: 14px;
  font-weight: 600;
  background: var(--pale-spruce);
  color: var(--bstr-green-dk);
}

/* Included badge */
#bstr-rater-wrap .bstr-included-badge {
  padding: 9px 0;
  font-size: 13px;
  color: var(--bstr-copper);
  font-weight: 600;
}

/* Results panel */
#bstr-rater-wrap .results-panel {
  background: var(--bstr-green-dk);
  color: #fff;
  border-radius: var(--bstr-radius);
  padding: 0 0 24px;
  box-shadow: 0 4px 24px rgba(27,67,50,0.25);
  position: sticky;
  top: 24px;
}
#bstr-rater-wrap .results-header {
  background: var(--bstr-green);
  padding: 16px 20px;
  border-radius: var(--bstr-radius) var(--bstr-radius) 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
#bstr-rater-wrap .results-header h3 {
  color: #fff;
  margin: 0;
  font-size: 15px;
}

/* Status badge */
#bstr-rater-wrap .status-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
#bstr-rater-wrap .status-calculating { background: rgba(255,255,255,0.15); color: #fff; }
#bstr-rater-wrap .status-ok          { background: var(--pine);          color: #fff; }
#bstr-rater-wrap .status-refer       { background: var(--alpine-copper); color: #fff; }
#bstr-rater-wrap .status-decline     { background: var(--spruce-navy);   color: #fff; }

/* Result rows */
#bstr-rater-wrap .result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  font-size: 13px;
}
#bstr-rater-wrap .result-label { opacity: 0.75; }
#bstr-rater-wrap .result-value { font-weight: 600; font-size: 14px; }

/* Grand total */
#bstr-rater-wrap .grand-total-box {
  background: rgba(255,255,255,0.07);
  margin: 8px 16px;
  border-radius: 6px;
  padding: 16px;
  text-align: center;
}
#bstr-rater-wrap .grand-total-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.65;
  margin-bottom: 6px;
}
#bstr-rater-wrap .grand-total-value {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

/* Factor breakdown */
#bstr-rater-wrap .factor-toggle-btn {
  display: block;
  width: calc(100% - 40px);
  margin: 8px 20px 0;
  padding: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 5px;
  color: rgba(255,255,255,0.8);
  font-size: 12px;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s;
}
#bstr-rater-wrap .factor-toggle-btn:hover { background: rgba(255,255,255,0.15); }

#bstr-rater-wrap .factor-breakdown {
  margin: 0 20px;
  background: rgba(0,0,0,0.2);
  border-radius: 5px;
  padding: 10px;
}
#bstr-rater-wrap .factor-item {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  padding: 3px 0;
  opacity: 0.85;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* Bind / Submit buttons */
#bstr-rater-wrap .bstr-bind-btn {
  display: block;
  width: calc(100% - 40px);
  margin: 0 20px;
  padding: 13px;
  background: var(--bstr-copper);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, transform 0.1s;
  font-family: inherit;
}
#bstr-rater-wrap .bstr-bind-btn:hover { background: #9d5e2e; transform: translateY(-1px); }

#bstr-rater-wrap .bstr-submit-btn {
  display: inline-block;
  margin-top: 16px;
  padding: 12px 28px;
  background: var(--bstr-green);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}
#bstr-rater-wrap .bstr-submit-btn:hover { background: var(--bstr-green-dk); }
#bstr-rater-wrap .bstr-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Form response messages */
#bstr-rater-wrap .bstr-msg {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
}
#bstr-rater-wrap .bstr-msg-success {
  background: rgba(255,255,255,0.12);
  border-left: 3px solid var(--pale-spruce);
  color: var(--pale-spruce);
}
#bstr-rater-wrap .bstr-msg-error {
  background: rgba(255,255,255,0.08);
  border-left: 3px solid var(--alpine-copper);
  color: var(--ivory);
}

/* JS-generated inline alerts */
#bstr-rater-wrap .bstr-alert {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
}
#bstr-rater-wrap .bstr-alert-info {
  background: var(--pale-spruce);
  border-left: 3px solid var(--pine);
  color: var(--spruce-navy);
}
#bstr-rater-wrap .bstr-alert-warn {
  background: var(--ivory);
  border-left: 3px solid var(--alpine-copper);
  color: var(--charcoal);
}
#bstr-rater-wrap .bstr-alert-error {
  background: var(--pale-spruce);
  border-left: 3px solid var(--spruce-navy);
  color: var(--spruce-navy);
}

/* Field validation errors */
#bstr-rater-wrap .bstr-has-error {
  border-color: #c0392b !important;
  background: #fdf5f5 !important;
}
#bstr-rater-wrap .bstr-field-error {
  display: block;
  font-size: 12px;
  color: #c0392b;
  font-weight: 500;
  margin-top: 3px;
}

/* Thank you screen */
#bstr-rater-wrap #bstr-thankyou {
  padding: 64px 24px;
  text-align: center;
}
#bstr-rater-wrap .bstr-thankyou-inner {
  max-width: 560px;
  margin: 0 auto;
  background: var(--bstr-white);
  border: 1px solid var(--bstr-border);
  border-radius: var(--bstr-radius);
  padding: 48px 40px;
  box-shadow: var(--bstr-shadow);
}
#bstr-rater-wrap .bstr-thankyou-icon {
  width: 56px;
  height: 56px;
  line-height: 56px;
  border-radius: 50%;
  background: var(--bstr-green);
  color: #fff;
  font-size: 28px;
  margin: 0 auto 24px;
}
#bstr-rater-wrap #bstr-thankyou-msg h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--bstr-green-dk);
  margin: 0 0 12px;
}
#bstr-rater-wrap #bstr-thankyou-msg p {
  font-size: 1rem;
  color: var(--bstr-muted);
  line-height: 1.7;
  margin: 0;
}
