:root {
  --blue: #1d3f8a;
  --navy: #10234f;
  --sky: #32ace7;
  --yellow: #fcd405;
  --red: #ee2722;
  --light: #f2f5fa;
  --ink: #17213a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--navy);
}

button, input { font: inherit; }
svg { fill: currentColor; }
.sprite { position: absolute; }

/* header: logos + the three-colour stripe from the Colliers logo */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px max(20px, calc((100% - 1120px) / 2));
  background: #fff;
  border-bottom: 4px solid var(--sky);
  box-shadow: 0 4px 0 var(--yellow), 0 8px 0 var(--red);
  position: relative;
}
.logo-colliers { display: block; height: 56px; width: auto; }
.logo-virtenso { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 600; }
.virtenso-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.hero {
  flex: 1;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 72px 20px 56px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center;
  gap: 64px;
}
.intro { color: #fff; }
.intro h1 { margin: 0 0 20px; font-size: clamp(32px, 3.8vw, 52px); line-height: 1.12; text-wrap: balance; }
.intro p { margin: 0 0 32px; max-width: 30em; font-size: 18px; color: #c9d5ee; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-light { background: #fff; color: var(--blue); }
.btn-light:hover { background: #dce8fb; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--navy); }

/* chat */
.chat {
  height: 460px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
}
.chat-head { display: flex; flex-direction: column; padding: 16px 20px; background: var(--blue); color: #fff; }
.chat-head small { color: #c9d5ee; }
.chat-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.msg { flex: none; max-width: 88%; padding: 10px 14px; border-radius: 16px; overflow-wrap: anywhere; }
.msg p { margin: 0; }
.msg .btn { margin-top: 10px; }
.msg-bot { align-self: flex-start; background: var(--light); border-bottom-left-radius: 4px; }
.msg-user { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid #e1e7f0; }
.chat-form input { flex: 1; min-width: 0; padding: 11px 16px; border: 1px solid #c5cedd; border-radius: 999px; }
.chat-form button {
  flex: none;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
}
.chat-form button svg { width: 20px; height: 20px; }

.footer { padding: 20px; text-align: center; font-size: 13px; color: #9fb0d2; }

/* round call widget, bottom right */
.widget {
  position: fixed;
  z-index: 10;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
}
.widget-toggle {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #188038;
  color: #fff;
  box-shadow: 0 6px 20px #0005;
  cursor: pointer;
}
.widget-toggle svg { width: 30px; height: 30px; }
.widget-menu {
  position: absolute;
  right: 0;
  bottom: 78px;
  width: 290px;
  max-width: calc(100vw - 40px);
  padding: 16px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 30px #0004;
}
.widget-menu p { margin: 0 0 12px; font-weight: 600; }
.widget-menu .btn { width: 100%; }

/* on touch screens the keyboard is open while typing: get out of the way */
@media (pointer: coarse) {
  body.typing .widget { display: none; }
}

/* phones and tablets: one column */
@media (max-width: 1000px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 36px; padding: 48px 16px 24px; }
  .intro h1 { font-size: clamp(22px, 7.6vw, 46px); }
  .chat { height: 420px; }
  .logo-colliers { height: 46px; }
  /* room to scroll the content above the round widget */
  .footer { padding-bottom: 104px; }
}

/* very narrow phones */
@media (max-width: 359px) {
  .header { padding: 12px; gap: 8px; }
  .logo-colliers { height: 38px; }
  .logo-virtenso { gap: 6px; font-size: 16px; }
  .virtenso-mark { width: 34px; height: 34px; }
  .virtenso-mark img { width: 24px; height: 24px; }
  .intro .btn, .msg .btn { padding: 12px 14px; font-size: 15px; }
}

/* laptops: keep the chat clear of the widget */
@media (min-width: 1001px) and (max-width: 1300px) {
  .hero { padding-right: 100px; }
}

/* short screens: landscape phones, open keyboard */
@media (max-height: 520px) {
  .chat { height: max(170px, min(420px, 100vh - 16px)); }
  .chat-head { padding: 8px 16px; }
  .chat-head small { display: none; }
  .chat-log { padding: 10px 14px; }
  .chat-form { padding: 8px; }
  .widget-menu { right: 72px; bottom: 0; max-width: calc(100vw - 104px); }
}
