/* =========================================================
   Dial2Hire builder segment — Bootstrap 5 bridge
   Load order: bootstrap.min.css → style.css → d2h.css
   ========================================================= */

:root{
  --bs-body-font-family: var(--sans);
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--concrete);
  --bs-link-color: var(--blue);
  --bs-link-hover-color: var(--ink);
  --bs-border-color: var(--line);
  --bs-border-radius: 3px;
  --bs-primary: #14213D;
  --bs-primary-rgb: 20,33,61;
}
body{ font-size:1rem; }
h1{ font-size:clamp(1.6rem, 3vw, 2.2rem); }
h3{ font-size:1.35rem; }
h4{ font-size:1.1rem; }
legend{ float:none; width:auto; font-size:inherit; }
.fieldset legend{ float:none; width:auto; }
label{ margin-bottom:0; }

/* ---- Buttons: map prototype variants onto Bootstrap's CSS variables ---- */
.btn{
  --bs-btn-font-weight:600; --bs-btn-font-size:.9rem; --bs-btn-padding-x:22px; --bs-btn-padding-y:12px;
  --bs-btn-border-radius:2px; --bs-btn-focus-box-shadow:0 0 0 3px rgba(44,110,158,.25);
  display:inline-flex; align-items:center; justify-content:center; gap:8px; letter-spacing:.01em;
}
.btn-sm{ --bs-btn-padding-x:14px; --bs-btn-padding-y:8px; --bs-btn-font-size:.82rem; }
.btn-primary{
  --bs-btn-bg:var(--ink); --bs-btn-color:#fff; --bs-btn-border-color:var(--ink);
  --bs-btn-hover-bg:#1e2f56; --bs-btn-hover-color:#fff; --bs-btn-hover-border-color:#1e2f56;
  --bs-btn-active-bg:#1e2f56; --bs-btn-active-color:#fff; --bs-btn-active-border-color:#1e2f56;
  --bs-btn-disabled-bg:var(--ink); --bs-btn-disabled-color:#fff; --bs-btn-disabled-border-color:var(--ink);
}
.btn-amber{
  --bs-btn-bg:var(--amber); --bs-btn-color:var(--ink); --bs-btn-border-color:var(--amber);
  --bs-btn-hover-bg:#dc9528; --bs-btn-hover-color:var(--ink); --bs-btn-hover-border-color:#dc9528;
  --bs-btn-active-bg:#dc9528; --bs-btn-active-color:var(--ink); --bs-btn-active-border-color:#dc9528;
  --bs-btn-disabled-bg:var(--amber); --bs-btn-disabled-color:var(--ink); --bs-btn-disabled-border-color:var(--amber);
}
.btn-outline{
  --bs-btn-bg:transparent; --bs-btn-color:var(--ink); --bs-btn-border-color:var(--ink);
  --bs-btn-hover-bg:var(--ink); --bs-btn-hover-color:#fff; --bs-btn-hover-border-color:var(--ink);
  --bs-btn-active-bg:var(--ink); --bs-btn-active-color:#fff; --bs-btn-active-border-color:var(--ink);
}
.btn-ghost{
  --bs-btn-bg:transparent; --bs-btn-color:var(--blue); --bs-btn-border-color:transparent;
  --bs-btn-hover-bg:transparent; --bs-btn-hover-color:var(--blue); --bs-btn-hover-border-color:transparent;
  --bs-btn-active-bg:transparent; --bs-btn-active-color:var(--ink); --bs-btn-padding-x:6px;
}
.btn-danger-soft{
  --bs-btn-bg:transparent; --bs-btn-color:var(--red); --bs-btn-border-color:#e3b9b9;
  --bs-btn-hover-bg:var(--red); --bs-btn-hover-color:#fff; --bs-btn-hover-border-color:var(--red);
}
/* Undo prototype background shorthands so the variables above apply */
.btn-primary, .btn-amber, .btn-outline, .btn-ghost,
.btn-primary:hover, .btn-amber:hover, .btn-outline:hover, .btn-ghost:hover{ background:var(--bs-btn-bg); }
.btn-primary:hover, .btn-amber:hover, .btn-outline:hover, .btn-ghost:hover{ background:var(--bs-btn-hover-bg); }
.btn-block{ width:100%; }
.btn .spinner-border{ width:1rem; height:1rem; border-width:.15em; }

/* ---- Forms ---- */
.field .is-invalid, .field input.is-invalid, .field select.is-invalid, .field textarea.is-invalid{ border-color:var(--red) !important; }
.field .invalid-feedback{ display:block; font-size:.76rem; color:var(--red); margin-top:5px; }
.field input[type=url], .field input[type=file], .field input[type=password]{
  width:100%; padding:11px 13px; border:1px solid var(--line); border-radius:3px; font-family:inherit; font-size:.92rem; background:#fff; color:var(--ink);
}
.field input[type=file]{ padding:8px 10px; }
.req{ color:var(--red); margin-left:2px; }
.check input{ margin:0; }
.check.is-invalid{ border-color:var(--red); }

/* ---- Modal (Bootstrap) themed like prototype ---- */
.modal-content{ border-radius:2px; border:0; padding:30px; }
.modal-content .btn-close{ position:absolute; top:16px; right:16px; }
.modal-content h3{ margin-bottom:6px; padding-right:28px; }
.modal-content .sub{ font-size:.86rem; color:var(--slate); margin-bottom:20px; }
.modal-backdrop.show{ opacity:.55; background:var(--ink); }

/* ---- Toast (Bootstrap) ---- */
.d2h-toasts{ position:fixed; left:50%; bottom:22px; transform:translateX(-50%); z-index:1090; width:min(92vw, 420px); }
.d2h-toasts .toast{ background:var(--ink); color:#fff; border:0; border-radius:4px; font-size:.86rem; width:100%; }
.d2h-toasts .toast.t-error{ background:var(--red); }
.d2h-toasts .toast.t-success{ background:var(--green); }
.d2h-toasts .toast .btn-close{ filter:invert(1); }

/* ---- Header auth area ---- */
.nav-actions form{ margin:0; }

/* ---- OTP inline block (register / login) ---- */
.otp-inline{ display:flex; gap:10px; align-items:flex-end; flex-wrap:wrap; }
.otp-inline .field{ flex:1; min-width:200px; margin-bottom:0; }
.verified-chip{ display:inline-flex; align-items:center; gap:6px; background:#e4f1e8; color:var(--green); font-size:.8rem; font-weight:700; padding:6px 12px; border-radius:20px; }
.otp-timer{ font-size:.78rem; color:var(--slate); }
.auth-card{ background:#fff; border:1px solid var(--line); padding:32px; }

/* ---- Wizard: clickable, responsive ---- */
.wizard .wz{ cursor:pointer; user-select:none; }
.wizard .wz.has-error{ color:var(--red); }
@media (max-width:760px){
  .wizard{ overflow-x:auto; }
  .wizard .wz{ flex:0 0 auto; padding:12px 14px; white-space:nowrap; }
}

/* ---- Unit table editor ---- */
.unit-table input{ width:100%; border:1px solid transparent; padding:6px 8px; border-radius:3px; background:transparent; font-size:.88rem; }
.unit-table input:focus{ border-color:var(--blue); background:#fff; outline:0; }
.unit-table-wrap{ overflow-x:auto; }

/* ---- Media thumbnails ---- */
.thumb{ overflow:hidden; }
.thumb img{ width:100%; height:100%; object-fit:cover; }
.thumb .cover-tag{ position:absolute; left:4px; bottom:4px; background:var(--amber); color:var(--ink); font-size:.62rem; font-weight:700; padding:2px 6px; }
.thumb .mk-cover{ position:absolute; left:4px; bottom:4px; background:#fff; border:1px solid var(--line); font-size:.62rem; padding:2px 6px; }
.thumb .new-tag{ position:absolute; left:4px; top:4px; background:var(--blue); color:#fff; font-size:.6rem; font-weight:700; padding:2px 6px; }
.upload-box.drag{ border-color:var(--blue); background:#dde9f1; }
.fp-row{ display:grid; grid-template-columns:1fr 1.4fr auto; gap:10px; align-items:center; margin-bottom:10px; }
.fp-list .fp-item{ display:flex; align-items:center; justify-content:space-between; gap:10px; border:1px solid var(--line); background:#fff; padding:10px 12px; margin-bottom:8px; font-size:.86rem; }
@media (max-width:680px){ .fp-row{ grid-template-columns:1fr; } .thumb-row{ grid-template-columns:repeat(3,1fr); } }

/* ---- Project cards / gallery with real images ---- */
.pcard .ph{ background-size:cover; background-position:center; }
.pcard .ph .badge{ border-radius:0; }
.pcard h4 a:hover{ color:var(--blue); }
.gallery div{ background-size:cover; background-position:center; cursor:pointer; }
.gallery .more{ background-color:rgba(20,33,61,.55) !important; color:#fff; background-blend-mode:multiply; }
.gallery.count-1{ grid-template-columns:1fr; grid-template-rows:1fr; }
.gallery.count-1 .g1{ grid-row:auto; }
.empty-state{ background:#fff; border:1px dashed var(--line); padding:48px 20px; text-align:center; color:var(--slate); }
.skeleton{ background:linear-gradient(90deg,#ece9e1 25%,#f5f3ee 50%,#ece9e1 75%); background-size:200% 100%; animation:sk 1.2s infinite; }
@keyframes sk{ to{ background-position:-200% 0; } }
.pcard.skeleton-card .pb div{ height:12px; margin-bottom:10px; }

/* ---- Details tabs (Bootstrap tabs styled as prototype tags) ---- */
.tag-row .tag{ cursor:pointer; }
.nav-tags{ border:0; gap:8px; margin-bottom:22px; flex-wrap:wrap; }
.nav-tags .nav-link{ font-size:.78rem; padding:6px 13px; border:1px solid var(--line); border-radius:20px; background:#fff; color:var(--ink); }
.nav-tags .nav-link.active{ background:var(--ink); color:#fff; border-color:var(--ink); }
.map-frame{ width:100%; height:320px; border:1px solid var(--line); margin-bottom:16px; }
.fp-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.fp-card{ border:1px solid var(--line); background:#fff; display:block; }
.fp-card .im{ aspect-ratio:4/3; background:var(--concrete) center/contain no-repeat; display:flex; align-items:center; justify-content:center; font-weight:700; color:var(--slate); }
.fp-card .t{ padding:10px 12px; font-size:.84rem; font-weight:600; border-top:1px solid var(--line); }
@media (max-width:680px){ .fp-grid{ grid-template-columns:1fr 1fr; } }
.lightbox-img{ max-height:80vh; width:100%; object-fit:contain; }

/* ---- Dashboard ---- */
.dtable-wrap{ overflow-x:auto; }
.proj-cell{ display:flex; gap:12px; align-items:center; }
.proj-cell .mini{ width:52px; height:40px; background:var(--concrete) center/cover; border:1px solid var(--line); flex-shrink:0; }
.pill.cancelled{ background:#f5e1e1; color:var(--red); }
.pill.completed{ background:#e4f1e8; color:var(--green); }
.pill.confirmed{ background:var(--blue-dim); color:var(--blue); }
.pill.pending{ background:var(--amber-dim); color:#8a5c11; }
.pill.rejected{ background:#f5e1e1; color:var(--red); }
.pill.archived{ background:#eee; color:var(--slate); }
.visit-card{ background:#fff; border:1px solid var(--line); padding:16px 18px; margin-bottom:12px; display:grid; grid-template-columns:1fr auto; gap:12px; }
.visit-card .meta{ font-size:.8rem; color:var(--slate); }
.visit-card .when{ font-family:var(--serif); font-size:1.05rem; }
.visit-card .msg{ font-size:.84rem; background:var(--concrete); padding:8px 10px; margin-top:8px; }
@media (max-width:680px){ .visit-card{ grid-template-columns:1fr; } }
.side-links a.logout{ color:#e8b4b4; }
.dropdown-menu{ border-radius:2px; font-size:.86rem; }

/* ---- Pricing page: plan CTA ---- */
.plan .btn{ margin-top:auto; }

/* Header: Bootstrap's .nav (and the prototype's .nav padding) remove .wrap's side gutter */
.site-header .wrap.nav{ padding:16px 28px; flex-wrap:nowrap; }
@media (max-width: 680px){
  .site-header .wrap.nav{ padding:12px 18px; }
  .site-footer .foot-bottom{ padding-left:18px; padding-right:18px; }
}
@media (max-width: 980px){
  .gallery{ grid-template-rows:auto; }
  .gallery.count-1 .g1{ height:240px; }
}

/* Register: plan radios — 3 across on desktop, stacked on phones */
.plan-choices{ grid-template-columns:repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px){ .plan-choices{ grid-template-columns:1fr; } }

/* Add/Edit project: per-file upload progress */
.upload-progress .progress{ height:8px; background:var(--line, #e5e1d8); border-radius:4px; }
.upload-progress .progress-bar{ background:var(--amber, #E8A33D); transition:width .25s ease; }

/* ---------- Project description: rich-text editor (Summernote) ---------- */
.note-editor.note-frame{ border:1px solid var(--line, #ddd6c8); border-radius:var(--radius, 4px); background:#fff; box-shadow:none; }
.note-editor.note-frame:focus-within{ border-color:var(--blue, #1f5fa8); }
textarea.is-invalid + .note-editor.note-frame{ border-color:var(--red, #c0392b) !important; }
.note-editor .note-toolbar{ background:#faf8f4; border-bottom:1px solid var(--line, #ddd6c8); padding:6px 8px 2px; border-radius:var(--radius, 4px) var(--radius, 4px) 0 0; }
.note-editor .note-toolbar .note-btn-group{ margin:0 6px 4px 0; }
/* the site-wide .btn is a large CTA button — keep toolbar buttons compact */
.note-editor .note-btn{ padding:5px 9px; font-size:.82rem; font-weight:500; gap:4px; line-height:1.3; border-radius:4px;
  background:#fff; border:1px solid var(--line, #ddd6c8); color:var(--ink, #14213d); transform:none !important; }
.note-editor .note-btn:hover, .note-editor .note-btn:focus{ background:#f1eee7; }
.note-editor .note-btn.active{ background:#e7e2d8; }
.note-editor .note-btn-group .note-btn + .note-btn{ margin-left:-1px; }
.note-editor .note-dropdown-menu{ font-size:.88rem; min-width:170px; }
.note-editor .note-dropdown-menu .dropdown-item{ padding:4px 12px; }
.note-editor .note-dropdown-menu .dropdown-item h3,
.note-editor .note-dropdown-menu .dropdown-item h4,
.note-editor .note-dropdown-menu .dropdown-item p,
.note-editor .note-dropdown-menu .dropdown-item blockquote{ margin:0; }
.note-editor .note-editing-area .note-editable{ padding:14px 16px; font-family:Inter, sans-serif; font-size:.95rem; line-height:1.6; color:var(--ink, #14213d); }
.note-editor .note-placeholder{ padding:14px 16px; color:#9a9a9a; }
.note-editor .note-statusbar{ background:#faf8f4; border-top:1px solid var(--line, #ddd6c8); }
.d2h-editor-field .hint{ margin-top:6px; }

/* ---------- Formatted description on the public project page ---------- */
.d2h-richtext{ line-height:1.7; }
.d2h-richtext > :first-child{ margin-top:0; }
.d2h-richtext p, .d2h-richtext div{ margin:0 0 .8em; }
.d2h-richtext h2{ font-size:1.35rem; margin:1.1em 0 .45em; }
.d2h-richtext h3{ font-size:1.15rem; margin:1em 0 .4em; }
.d2h-richtext h4{ font-size:1rem; margin:.9em 0 .35em; }
.d2h-richtext ul, .d2h-richtext ol{ padding-left:1.4em; margin:0 0 .9em; }
.d2h-richtext li{ margin-bottom:.25em; }
.d2h-richtext blockquote{ border-left:3px solid var(--amber, #E8A33D); padding:.2em 0 .2em 1em; margin:0 0 .9em; color:var(--slate, #5b6477); }

/* ---------- Floor plans: open in a lightbox like project photos ---------- */
button.fp-card{ width:100%; padding:0; text-align:left; font:inherit; color:inherit; cursor:zoom-in; border-radius:0; }
button.fp-card:hover, a.fp-card:hover{ border-color:var(--ink, #14213d); }
button.fp-card:focus-visible{ outline:2px solid var(--amber, #E8A33D); outline-offset:2px; }
.fp-pdf-tag{ font-size:.72rem; font-weight:600; color:var(--blue, #1f5fa8); margin-left:4px; }
#planLightbox .plan-stage{ max-height:78vh; overflow:hidden; background:#fff; cursor:zoom-in; border-radius:2px; }
#planLightbox .plan-stage .plan-img{ display:block; max-height:78vh; width:100%; object-fit:contain; }
#planLightbox .plan-stage.zoomed{ overflow:auto; cursor:zoom-out; }
#planLightbox .plan-stage.zoomed .plan-img{ max-height:none; width:auto; max-width:none; }
#planLightbox .plan-caption{ display:flex; justify-content:space-between; align-items:baseline; gap:12px; flex-wrap:wrap;
  color:#fff; padding:10px 4px 2px; font-size:.9rem; }
#planLightbox .plan-caption span{ color:#9fb0cc; font-size:.8rem; }
#planLightbox .carousel-control-prev, #planLightbox .carousel-control-next{ width:8%; }
#planLightbox .carousel-control-prev-icon, #planLightbox .carousel-control-next-icon{ background-color:rgba(14,22,41,.75); border-radius:50%; background-size:55%; width:2.6rem; height:2.6rem; }

/* ---------- Home hero: white background + last posted project card ---------- */
.hero{ background:#fff; border-bottom:1px solid var(--line, #e3dfd5); }
.hero .mock-card{ box-shadow:0 12px 32px rgba(20, 33, 61, .08); }
a.hero-project{ display:block; color:inherit; text-decoration:none; transition:transform .15s ease, box-shadow .15s ease; }
a.hero-project:hover{ transform:translateY(-2px); box-shadow:0 18px 40px rgba(20, 33, 61, .14); }
a.hero-project:focus-visible{ outline:2px solid var(--amber, #E8A33D); outline-offset:4px; }
.hero-project .mock-photo.has-photo{ background:var(--concrete, #F2F0EA) center/cover no-repeat; height:240px; }
.hero-new-tag{ position:absolute; top:12px; right:12px; background:rgba(20, 33, 61, .85); color:#fff;
  font-size:.7rem; font-weight:700; letter-spacing:.02em; padding:4px 9px; border-radius:2px; }
.hero-project .mock-body h4{ display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.hero-project .mock-meta{ gap:12px; }
.hero-project .mock-meta span:first-child{ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.hero-project .mock-meta span:last-child{ flex-shrink:0; }
.hero-by{ margin-top:12px; padding-top:12px; border-top:1px solid var(--line, #e3dfd5); font-size:.8rem; color:var(--slate, #5b6477); }
.hero-by span{ color:var(--blue, #1f5fa8); font-weight:600; }
