:root{
  /* Change this line to point to ANY background image you want */
  --bg-image: url('../assets/bg-home.jpg'); /* or set to none */
  --bg:#FFFFFF; --card:#ffffff; --muted:#6b7280; --text:#111827;

  --primary:#10b981; --primary-2:#0ea37a; --ring:rgba(16,185,129,.35);
  --bubble:#f3f4f6; --agent:#e6fff4;

  /* Blue theme for home like your screenshot */
  --home-blue:#3b82f6;       /* button / focus */
  --home-blue-2:#2563eb;     /* hover */
  --home-shadow: 0 30px 80px rgba(51,115,255,.25);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;color:var(--text);
  font:19px/1.55 system-ui,-apple-system,Segoe UI,Roboto,Inter,Arial;
  background:var(--bg);
}
/* Global background image */
body::before{
  content:"";position:fixed;inset:0;z-index:-1;
  background-image:var(--bg-image);
  background-size:cover;background-position:center;background-attachment:fixed;
  opacity:.18;filter:saturate(1) contrast(1.05)
}

/* Top-left logo */
.siteLogo{
  position:fixed;left:14px;top:14px;z-index:50;
  display:inline-flex;background:#ffffffd9;border-radius:16px;
  padding:10px 14px;box-shadow:0 6px 24px rgba(0,0,0,.08)
}
.siteLogo img{height:50px;display:block}

.view{display:none;min-height:100dvh;align-items:center;justify-content:center;padding:24px}
.view.active{display:flex}

/* ========= HOME / GATE (new look) ========= */
.card.gate{
  width:min(840px,94vw); background:#fff; border-radius:28px;
  padding:38px 36px 28px; box-shadow: var(--home-shadow); border:1px solid #eef2ff;
}
.gateTitle{
  text-align:center; font-weight:900; letter-spacing:.02em;
  font-size:28px; margin:6px 0 28px; color:#0f172a;
}
.gateForm label{display:block;margin:12px 0 6px;font-weight:900;color:#111827}
.gateForm input{
  width:100%;padding:16px 18px;border:1px solid #dbeafe;border-radius:12px;
  outline:none;background:#fff;font-size:18px;box-shadow:inset 0 1px 0 rgba(0,0,0,.02)
}
.gateForm input:focus{border-color:var(--home-blue);box-shadow:0 0 0 4px rgba(59,130,246,.15)}
.btn{display:inline-block;border:0;padding:14px 18px;border-radius:12px;cursor:pointer;font-weight:900}
.btn.full{width:100%;margin-top:16px}
.btn.blue{background:var(--home-blue);color:#fff}
.btn.blue:hover{background:var(--home-blue-2)}

/* Keep these for the rest of the app */
.card{
  background:#fff;border-radius:24px;box-shadow:0 10px 30px rgba(0,0,0,.06);
  padding:30px;max-width:600px;width:100%
}
.brand{display:block;margin:0 auto 10px;height:50px}
.brand.big{height:86px;margin-bottom:18px}
.brand.small{height:40px}

.center{text-align:center;padding:24px}
.muted{color:var(--muted)}
.dots::after{content:"";animation:dots 1.2s steps(3,end) infinite}
@keyframes dots{0%{content:""}33%{content:"."}66%{content:".."}100%{content:"..."}}
.loader{width:72px;height:72px;border:6px solid #e5e7eb;border-top-color:var(--primary);border-radius:50%;margin:18px auto;animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

/* Chat header */
.chatHeader{
  position:sticky;top:0;z-index:5;background:linear-gradient(90deg,#f0fff7,#fff);
  border-bottom:1px solid #eef2f7;padding:14px 18px;display:flex;align-items:center;justify-content:space-between
}
.agent{display:flex;gap:16px;align-items:center}
.agent img{width:56px;height:56px;border-radius:999px}
.agent .name{font-weight:900;font-size:20px}
.agent .role{font-size:15px;color:var(--muted)}
.statusOnline{color:var(--primary);font-weight:900}

/* Messages */
.thread{max-width:980px;width:100%;margin:0 auto;padding:20px;display:flex;flex-direction:column;gap:14px}
.msg{display:flex;gap:14px;align-items:flex-start}
.msg .avatar{width:48px;height:48px;border-radius:999px}
.bubble{padding:16px 18px;border-radius:20px;max-width:78%;background:var(--bubble);font-size:19px}
.msg.agent .bubble{background:var(--agent)}
.msg.user{justify-content:flex-end}
.msg.user .bubble{background:var(--primary);color:#fff}

/* Typing bubble */
.typingBubble{background:#fff;border:1px solid #e5e7eb}
.typingText{color:#374151;font-weight:900;font-size:20px}
.typingDots::after{content:"";animation:dots 1.2s steps(3,end) infinite}

/* Choices */
.chips{display:flex;gap:12px;flex-wrap:wrap;max-width:980px;margin:10px auto 28px;padding:0 16px}
.chip{padding:12px 16px;background:#fff;border:1px solid #e5e7eb;border-radius:999px;cursor:pointer;font-weight:800}
.chip:hover{border-color:var(--primary)}

/* Form */
.formCard{background:#fff;border:1px solid #e5e7eb;border-radius:18px;padding:12px;margin:6px 0;max-width:380px}
.formTitle{font-size:20px;margin-bottom:8px}
.formRow{display:flex;flex-direction:column;margin:6px 0}
.formRow input{padding:11px 13px;border:1px solid #e5e7eb;border-radius:12px;font-size:17px}
.formActions{display:flex;justify-content:center;margin-top:10px}
.small{font-size:14px;color:var(--muted)}

/* Blue link bubble after submit */
a.btnLink{
  display:inline-block;padding:10px 14px;border-radius:12px;border:1px solid #dbeafe;
  background:#f8fafc;text-decoration:none;font-weight:400;color:#2563eb
}
a.btnLink:hover{border-color:#93c5fd;color:#1d4ed8;text-decoration:underline}

/* Overlay */
.overlay{position:fixed;inset:0;z-index:60;background:rgba(17,24,39,.7);display:none;align-items:center;justify-content:center}
.overlay.show{display:flex}
.overlayBox{background:#0f172a;color:#fff;text-align:center;border-radius:22px;padding:34px 36px;width:min(680px,92vw);box-shadow:0 20px 60px rgba(0,0,0,.45)}
.overlayText{opacity:.98;font-size:22px}

/* Site sheet (iframe) */
.siteModal{position:fixed;inset:0;background:rgba(15,23,42,.7);backdrop-filter:blur(2px);display:none;align-items:center;justify-content:center;z-index:70}
.siteModal.show{display:flex}
.siteWrap{position:relative;width:min(1200px,96vw);height:min(800px,94vh);background:#0b1220;border-radius:18px;box-shadow:0 24px 80px rgba(0,0,0,.5);overflow:hidden;border:1px solid rgba(255,255,255,.06)}
#siteFrame{width:100%;height:100%;background:#fff;border:0}

/* Back to chat (sheet) */
.siteDoneBtn{
  position:absolute; right:12px; bottom:12px; z-index:2;
  padding:10px 14px; border:0; border-radius:10px;
  background:#10b981; color:#fff; font-weight:800; cursor:pointer;
  box-shadow:0 6px 18px rgba(0,0,0,.2);
  display:none; /* initially hidden, JS shows after 10s */
}

@media (max-width:480px){
  body{font-size:17px}
  .siteLogo img{height:42px}
  .bubble{font-size:17px}
  .formCard{max-width:100%}
}

/* Chat link-as-button (keeps URL hidden, looks clickable) */
a.btnLink { cursor: pointer; text-decoration: none; }

a.btn.btn-blue {
  display: inline-block;
  padding: 12px 18px;
  border-radius: 12px;
  background: #1a73e8;   /* blue */
  color: #fff;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
  border: 0;
}

a.btn.btn-blue:hover { background: #1765cc; }
a.btn.btn-blue:active { background: #155bb8; transform: translateY(1px); }
a.btn.btn-blue:focus  { outline: 2px solid rgba(26,115,232,.35); outline-offset: 2px; }

/* Email input with fixed domain (like your screenshot) */
.emailGroup{
  display:flex; align-items:center;
  border:1px solid #e5eaf1; border-radius:12px; background:#fff;
  overflow:hidden;
}
.emailGroup input{
  flex:1; border:0; outline:0; padding:14px 12px; font-size:16px;
}
.emailGroup .emailDomain{
  padding:14px 12px; background:#f7f9fc; color:#4b5563;
  border-left:1px solid #e5eaf1; white-space:nowrap;
  user-select:none;
}

/* === Gate (login) sizing & split-email styling overrides === */

/* Make the login card portable/compact */
.card.gate{
  max-width: 440px;           /* narrower, more professional */
  width: 100%;
  margin: 0 auto;
  padding: 28px 24px;
}

/* Split email row: input + locked domain */
.emailGroup{
  display: flex;
  align-items: stretch;
  gap: 0;                     /* seamless join */
  margin-bottom: 16px;
}

.emailGroup #gateUser{
  flex: 1;
  border: 1px solid #dbe4ff;
  border-right: 0;            /* join with domain pill */
  border-radius: 10px 0 0 10px;
  padding: 14px 14px;
  font-size: 16px;
  outline: none;
  background: #fff;
}

.emailGroup #gateUser:focus{
  border-color: #9cc0ff;
}

/* Locked domain pill */
.emailDomain{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  min-width: 150px;           /* keeps it tidy */
  white-space: nowrap;
  border: 1px solid #dbe4ff;
  border-left: 0;
  border-radius: 0 10px 10px 0;
  background: #f6f9ff;
  /* requested: make it black and visible */
  color: #111;
  font-weight: 600;
  font-size: 16px;
}

/* Keep other text inputs visually consistent */
#gateName{
  padding: 14px 14px;
  font-size: 16px;
  border-radius: 10px;
  border: 1px solid #dbe4ff;
  background: #fff;
}

.btn.blue.full{
  height: 48px;
  font-size: 16px;
  font-weight: 600;
}

/* Mobile tweaks */
@media (max-width: 480px){
  .card.gate{ max-width: 92vw; padding: 22px 18px; }
  .emailDomain{ min-width: 120px; font-size: 15px; }
  .emailGroup #gateUser{ font-size: 15px; }
}

/* ---------- Choices directly under the question ---------- */
.choicesRow{
  /* line up under the agent bubble (avatar is ~48px wide + gap) */
  margin: 8px 0 0 72px;
}
.choicesWrap{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Blue buttons */
.btn.choice{
  background: #2d7df6;           /* vivid blue */
  color: #fff;
  border: 0;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(45,125,246,.25);
  transition: transform .05s ease, background .15s ease;
}
.btn.choice:hover{ background:#1f6be6; }
.btn.choice:active{ transform: translateY(1px); }
.btn.choice:focus{ outline: 2px solid rgba(45,125,246,.35); outline-offset: 2px; }

/* Mobile tweak: keep buttons from overflowing edge */
@media (max-width: 560px){
  .choicesRow{ margin-left: 60px; }
}

/* Make field labels bold and clear */
.formRow label{
  font-weight:700;
  color:#0f172a; /* dark slate */
}

/* Muted helper text under the form */
.formCard .small{
  font-size:12px;
  color:#94a3b8; /* slate-400 */
}

/* Readonly (locked) inputs look slightly muted but still clear */
.formRow input.readonly,
.emailGroup input.readonly{
  background:#f5f7fb;
  border-color:#e5e7eb;
  color:#111827;
  font-weight:700;          /* email text looks strong */
  cursor:not-allowed;
}

/* Ensure locked domain on home is dark so it's visible */
.emailDomain{ color:#111827; }

/* Labels lighter (not bold) */
.formRow label{
  font-weight: 500;          /* normal-medium */
  color: #64748b;            /* slate-500 */
}

/* Helper text already present; ensure lighter */
.formCard .small{
  font-size: 12px;
  color: #94a3b8;            /* slate-400 */
}

/* Locked email stays visually strong */
.formRow input.readonly,
.emailGroup input.readonly{
  background:#f5f7fb;
  border-color:#e5e7eb;
  color:#111827;
  font-weight:700;           /* bold content for the email itself */
  cursor:not-allowed;
}

/* Locked domain on home is dark */
.emailDomain{ color:#111827; }