/* =========================================================
   HEXAGON — Rent Calculator widget + modal
   Powers: inline hero card + cross-site modal launcher
   Prefix: .rc-
   ========================================================= */

/* ---- Launcher button in header (top-right, every page) ---- */
.rc-launch {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 20px; border-radius: 999px;
  font-family: var(--font); font-weight: 600; font-size: 15px; line-height: 1;
  background: var(--blue); color: #fff; border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.rc-launch:hover { background: var(--blue-600); transform: translateY(-1px); }
.rc-launch svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.7; }

/* ---- The widget card ---- */
.rc-widget {
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 26px 26px 24px;
  width: 100%;
}
.rc-widget .rc-head { margin-bottom: 18px; }
.rc-widget .rc-head .eyebrow { margin-bottom: 8px; }
.rc-widget .rc-head h3 {
  font-size: 22px; color: var(--navy); letter-spacing: -0.02em; line-height: 1.15;
}
.rc-widget .rc-head p { font-size: 13.5px; color: var(--muted); margin: 6px 0 0; }

.rc-field { margin-bottom: 16px; }
.rc-field > .rc-label {
  display: block; font-size: 12px; font-weight: 700; color: var(--navy);
  letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 9px;
}

/* segmented chips */
.rc-seg { display: flex; flex-wrap: wrap; gap: 8px; }
.rc-seg button {
  flex: 1 1 auto; min-width: 56px;
  padding: 11px 10px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: #fff;
  font-family: var(--font); font-weight: 600; font-size: 14px; color: var(--navy);
  transition: all .14s ease;
}
.rc-seg button:hover { border-color: var(--blue); color: var(--blue); }
.rc-seg button.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.rc-seg.rc-areas button { flex-basis: calc(33.333% - 6px); }
.rc-seg.rc-beds button { flex-basis: calc(16.666% - 7px); padding: 11px 4px; }

/* estimate readout */
.rc-estimate {
  margin: 4px 0 18px; padding: 20px 22px; border-radius: 14px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-700) 100%);
  color: #fff; position: relative; overflow: hidden;
}
.rc-estimate::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 140px; height: 140px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: rgba(255,255,255,.05);
}
.rc-estimate .rc-est-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255,255,255,.65); margin-bottom: 6px;
}
.rc-estimate .rc-est-figure {
  font-size: 32px; font-weight: 800; letter-spacing: -0.02em; line-height: 1;
}
.rc-estimate .rc-est-figure .rc-per { font-size: 15px; font-weight: 600; color: rgba(255,255,255,.7); letter-spacing: 0; }
.rc-estimate .rc-est-note { font-size: 12px; color: rgba(255,255,255,.6); margin-top: 8px; }
.rc-estimate.rc-empty .rc-est-figure { font-size: 19px; font-weight: 700; color: rgba(255,255,255,.55); }
.rc-estimate.rc-empty .rc-est-note { display: none; }

/* detail inputs (revealed after estimate) */
.rc-details { display: none; }
.rc-details.show { display: block; animation: rcfade .25s ease; }
@keyframes rcfade { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform: none;} }
.rc-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rc-input {
  width: 100%; font-family: inherit; font-size: 14.5px; color: var(--ink);
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.rc-input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(29,78,216,.10); }
select.rc-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235b6478' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; }

.rc-submit {
  width: 100%; margin-top: 6px; padding: 15px 22px; border-radius: 999px;
  background: var(--blue); color: #fff; border: 0; cursor: pointer;
  font-family: var(--font); font-weight: 700; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  transition: background .15s ease, transform .15s ease;
}
.rc-submit:hover { background: var(--blue-600); transform: translateY(-1px); }
.rc-submit:disabled { background: #c2cbe0; cursor: not-allowed; transform: none; }
.rc-fineprint { font-size: 11.5px; color: var(--muted); text-align: center; margin: 12px 0 0; line-height: 1.5; }

/* success state */
.rc-success { display: none; text-align: center; padding: 16px 8px 8px; }
.rc-success.show { display: block; animation: rcfade .3s ease; }
.rc-success .rc-check {
  width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%;
  background: var(--blue-50); display: flex; align-items: center; justify-content: center;
}
.rc-success .rc-check svg { width: 28px; height: 28px; stroke: var(--blue); fill: none; stroke-width: 2.2; }
.rc-success h3 { font-size: 22px; color: var(--navy); margin-bottom: 8px; }
.rc-success p { font-size: 14.5px; color: var(--muted); margin: 0 auto; max-width: 340px; }

/* ---- Modal shell ---- */
.rc-modal {
  position: fixed; inset: 0; z-index: 120;
  display: none; align-items: flex-start; justify-content: center;
  padding: 40px 20px; overflow-y: auto;
  background: rgba(11,18,38,.55); backdrop-filter: blur(4px);
}
.rc-modal.open { display: flex; animation: rcfade .2s ease; }
.rc-modal .rc-dialog {
  width: 100%; max-width: 460px; margin: auto;
  position: relative;
}
.rc-modal .rc-widget { box-shadow: 0 40px 100px -30px rgba(0,0,0,.6); }
.rc-modal-close {
  position: absolute; top: -14px; right: -14px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer;
  background: #fff; color: var(--navy); box-shadow: var(--shadow);
  font-size: 20px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.rc-modal-close:hover { background: var(--navy); color: #fff; }
body.rc-lock { overflow: hidden; }

/* ---- Home hero embedding ---- */
.hero-calc { position: relative; z-index: 2; }
.hero-calc .rc-badge {
  position: absolute; top: -14px; left: 24px; z-index: 3;
  background: var(--blue); color: #fff; font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 999px; font-weight: 500;
}

@media (max-width: 600px) {
  .rc-grid2 { grid-template-columns: 1fr; }
  .rc-modal { padding: 20px 14px; }
  .rc-modal-close { top: 6px; right: 6px; }
  .rc-seg.rc-beds button { flex-basis: calc(33.333% - 6px); }
}
