/* ============================================================
   Radiate Buyer Calculator — Styles
   © Radiate Real Estate. All rights reserved.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@700&display=swap');

/* ─── Calculator Root ───────────────────────────────────────────────────────── */
#rr-calc {
  --brand: #0f2f54;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e5e7eb;
  --wash: #f5f7fb;
  --shadow: 0 6px 16px rgba(15, 23, 42, .06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color: var(--ink);
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

#rr-calc h2 {
  text-align: center;
  font-size: 32px;
  margin: 4px 0 10px;
}

@media (max-width: 600px) {
  #rr-calc h2 { font-size: 22px; }
}

/* ─── Sections ──────────────────────────────────────────────────────────────── */
#rr-calc .section-title {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 12px;
  background: var(--brand);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
}

#rr-calc .section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
  margin: 18px 0;
}

/* ─── Labels & Fields ───────────────────────────────────────────────────────── */
#rr-calc label {
  display: block;
  margin-top: 12px;
  font-weight: 600;
  font-size: 14px;
}

#rr-calc .helper {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0;
}

#rr-calc input,
#rr-calc select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  box-sizing: border-box;
  font-size: 16px;
  transition: box-shadow .15s, border-color .15s;
  background: #fff;
}

#rr-calc .editable-field {
  border-width: 3px;
  border-color: var(--brand);
  font-weight: 400;
}

#rr-calc .calc-field {
  background: var(--wash);
  border-color: var(--line);
  color: #000;
  font-weight: 600;
}

#rr-calc .calc-field:focus {
  outline: none;
  box-shadow: none;
  border-color: var(--line);
}

#rr-calc input:focus,
#rr-calc select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 6px rgba(47, 59, 130, .15);
  outline: none;
}

#rr-calc input[readonly] { cursor: default; }

/* ─── Label Row ─────────────────────────────────────────────────────────────── */
#rr-calc .label-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

#rr-calc .label-row .status {
  font-size: 12px;
  opacity: .85;
}

/* ─── Info / Tooltip Button ─────────────────────────────────────────────────── */
#rr-calc .info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 9999px;
  border: 2px solid #2f3b82;
  background: #fff;
  color: #2f3b82;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  position: relative;
  vertical-align: middle;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .04);
  z-index: 2;
  cursor: pointer;
}

#rr-calc .label-row .info-btn { margin-left: 6px; }
#rr-calc .info-btn:hover { box-shadow: 0 2px 6px rgba(0, 0, 0, .12); }
#rr-calc .info-btn:focus { outline: 2px solid #9bb5f3; outline-offset: 2px; }

#rr-calc .info-btn .tip {
  display: none;
  position: absolute;
  top: 135%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  max-width: 320px;
  padding: 12px 14px;
  background: #0f172a;
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .25);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 400;
  z-index: 9999;
  white-space: normal;
}

#rr-calc .info-btn .tip::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 7px;
  border-style: solid;
  border-color: transparent transparent #0f172a transparent;
}

#rr-calc .info-btn[data-open="true"] .tip { display: block; }
@media (hover: hover) { #rr-calc .info-btn:hover .tip { display: block; } }

/* ─── Grid ──────────────────────────────────────────────────────────────────── */
#rr-calc .grid { display: grid; gap: 12px; }

@media (min-width: 860px) {
  #rr-calc .cols-2 { grid-template-columns: 1fr 1fr; }
  #rr-calc .cols-3 { grid-template-columns: 1fr 1fr 1fr; }
}

/* ─── Sticky Summary ────────────────────────────────────────────────────────── */
#rr-calc .sticky-summary {
  position: sticky;
  bottom: 12px;
  background: var(--brand);
  color: #fff;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px;
  border-radius: 18px;
  box-shadow: var(--shadow);
  cursor: pointer;
  z-index: 3;
}

#rr-calc .sticky-summary .k { opacity: .9; font-size: 15px; }
#rr-calc .sticky-summary .v { font-weight: 800; font-size: 22px; }
#rr-calc .sticky-summary > div { display: flex; flex-direction: column; align-items: center; text-align: center; }

@media (max-width: 600px) {
  #rr-calc .sticky-summary { padding: 14px 16px; border-radius: 16px; gap: 12px; }
  #rr-calc .sticky-summary .k { font-size: 13px; }
  #rr-calc .sticky-summary .v { font-size: 18px; }
}

/* ─── Pulse Animation ───────────────────────────────────────────────────────── */
#rr-calc .pulse { animation: rr-pulse .18s ease-out; }

@keyframes rr-pulse {
  from { transform: scale(.995); opacity: .8; }
  to   { transform: scale(1);    opacity: 1; }
}

/* ============================================================
   Lead Capture CTA
   ============================================================ */
#rr-calc .rr-lead-cta {
  text-align: center;
  padding: 6px 0 16px;
}

#rr-calc .rr-email-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 9999px;
  padding: 15px 36px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 4px 14px rgba(15, 47, 84, .35);
}

#rr-calc .rr-email-trigger:hover {
  background: #1a4472;
  box-shadow: 0 6px 20px rgba(15, 47, 84, .45);
}

#rr-calc .rr-email-trigger:active { transform: scale(.98); }

#rr-calc .rr-lead-hint {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ============================================================
   Modal Overlay
   ============================================================ */
.rr-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}

.rr-modal-overlay.rr-open {
  opacity: 1;
  visibility: visible;
}

/* ─── Modal Box ─────────────────────────────────────────────────────────────── */
.rr-modal {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .35);
  position: relative;
  overflow: hidden;
  max-height: 92vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform .2s ease;
  -webkit-overflow-scrolling: touch;
}

.rr-modal-overlay.rr-open .rr-modal {
  transform: translateY(0);
}

/* ─── Close Button ──────────────────────────────────────────────────────────── */
.rr-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50% !important;
  border: 2px solid #fff !important;
  background: #0f2f54 !important;
  color: #fff !important;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: background .15s;
}

.rr-modal-close:hover { background: #1a4472 !important; }
.rr-modal-close:focus { outline: 2px solid rgba(255,255,255,.6); outline-offset: 2px; }

/* ─── Modal Header (branded) ────────────────────────────────────────────────── */
.rr-modal-header {
  background: #0f2f54;
  color: #fff;
  padding: 32px 32px 24px;
  text-align: center;
}

.rr-modal-icon {
  margin-bottom: 14px;
  line-height: 1;
}

.rr-modal-logo {
  width: 180px;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.rr-modal-title-styled {
  margin: 0 0 8px !important;
  font-family: 'Libre Baskerville', Georgia, serif !important;
  font-size: 24px !important;
  font-weight: 700 !important;
  color: #fff !important;
  line-height: 1.2 !important;
}

.rr-modal-header h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.rr-modal-header p {
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, .8);
  line-height: 1.55;
}

/* ─── Form ──────────────────────────────────────────────────────────────────── */
#rr-lead-form {
  padding: 24px 28px 28px;
}

.rr-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 440px) {
  .rr-form-row { grid-template-columns: 1fr; }
}

.rr-form-group {
  margin-bottom: 16px;
}

.rr-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 6px;
}

.rr-form-group input {
  width: 100%;
  padding: 12px 20px;
  border: 2px solid #d1d5db;
  border-radius: 9999px;
  font-size: 15px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
  background: #fff;
  color: #0f172a;
}

.rr-form-group input:focus {
  outline: none;
  border-color: #0f2f54;
  box-shadow: 0 0 0 4px rgba(15, 47, 84, .12);
}

.rr-req { color: #dc2626; }
.rr-opt { font-weight: 400; color: #94a3b8; font-size: 12px; }

/* ─── Done Button (success state) ──────────────────────────────────────────── */
.rr-success-done-btn {
  background: #163551;
  border-color: #163551;
  color: #fff;
}

.rr-success-done-btn:hover { background: #0f2f54; border-color: #0f2f54; }

/* ─── Form Error ────────────────────────────────────────────────────────────── */
.rr-form-err {
  font-size: 13px;
  color: #dc2626;
  margin: 0 0 12px;
  min-height: 18px;
  line-height: 1.4;
}

/* ─── Submit Button ─────────────────────────────────────────────────────────── */
.rr-submit-btn {
  width: 100%;
  padding: 14px 28px;
  background: #0f2f54 !important;
  color: #fff !important;
  border: 2px solid #0f2f54 !important;
  border-radius: 9999px !important;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, color .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.rr-submit-btn:hover { background: #1a4472 !important; border-color: #1a4472 !important; }
.rr-submit-btn:disabled { opacity: .6; cursor: not-allowed; }

/* legacy outline class kept for safety */
.rr-submit-outline {
  background: #163551;
  border-color: #163551;
  color: #fff;
}

.rr-submit-outline:hover { background: #0f2f54; border-color: #0f2f54; }

/* ─── Spinner ───────────────────────────────────────────────────────────────── */
.rr-spinner {
  width: 22px;
  height: 22px;
  display: none;
  flex-shrink: 0;
  animation: rr-spin .75s linear infinite;
}

@keyframes rr-spin { to { transform: rotate(360deg); } }

.rr-submit-btn.rr-loading .rr-btn-label { display: none; }
.rr-submit-btn.rr-loading .rr-spinner   { display: block; }

/* ─── Modal Success State ───────────────────────────────────────────────────── */
.rr-modal-success {
  padding: 48px 32px;
  text-align: center;
}

.rr-modal-success .rr-success-icon {
  font-size: 52px;
  margin-bottom: 18px;
  line-height: 1;
}

.rr-modal-success h2 {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 12px;
}

.rr-modal-success p {
  font-size: 15px;
  color: #64748b;
  line-height: 1.65;
  margin: 0 0 24px;
}
