:root {
  --navy: #0C1A2F;
  --navy-70: rgba(12, 26, 47, 0.70);
  --navy-40: rgba(12, 26, 47, 0.40);
  --navy-15: rgba(12, 26, 47, 0.10);
  --off: #F7F6F4;
  --white: #ffffff;
  --serif: 'EB Garamond', Georgia, serif;
  --sans: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--off);
  color: var(--navy);
  font-family: var(--sans);
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--navy);
  color: var(--white);
}
.brand { font-family: var(--serif); font-size: 24px; letter-spacing: 0.5px;
         color: inherit; text-decoration: none;
         display: inline-flex; align-items: center; gap: 9px; }
.brand-mark { height: 26px; width: auto; display: block; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.tag { font-size: 11px; color: rgba(255, 255, 255, 0.6); }
.login-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--white);
  text-decoration: none;
  padding: 7px 16px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.login-link:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.6); }

.hidden { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
}

/* Consent gate */
.consent {
  max-width: 560px;
  margin: 40px auto;
  padding: 0 24px 40px;
}
.consent h1 { font-family: var(--serif); font-weight: 500; font-size: 32px; }
.wording {
  background: var(--white);
  border: 1px solid var(--navy-15);
  border-radius: 10px;
  padding: 18px 22px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--navy-70);
}
.consent-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 20px 0;
  font-size: 15px;
  cursor: pointer;
}
.consent-row input { margin-top: 3px; width: 18px; height: 18px; }

/* Chat */
.chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 0 16px;
  min-height: 0;
}
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.msg.assistant {
  background: var(--white);
  border: 1px solid var(--navy-15);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.msg.user {
  background: var(--navy);
  color: var(--white);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.msg.typing { color: var(--navy-40); font-style: italic; }
.msg.error { background: #fdf0ee; border: 1px solid #e8c4bd; align-self: center; }

.composer {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 10px 0;
  border-top: 1px solid var(--navy-15);
}
.composer textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--navy-15);
  border-radius: 10px;
  padding: 12px 14px;
  font: 15px var(--sans);
  color: var(--navy);
  background: var(--white);
  max-height: 140px;
}
.composer textarea:focus { outline: 2px solid var(--navy-40); }

button.primary, button.secondary, button.attach {
  font: 600 14px var(--sans);
  border-radius: 10px;
  padding: 12px 18px;
  cursor: pointer;
  border: none;
}
button.primary { background: var(--navy); color: var(--white); }
button.primary:disabled { background: var(--navy-40); cursor: not-allowed; }
button.secondary {
  background: var(--white);
  color: var(--navy);
  border: 1.5px solid var(--navy);
}
button.attach {
  background: var(--white);
  border: 1px solid var(--navy-15);
  color: var(--navy-70);
  font-size: 18px;
  padding: 10px 14px;
}

.submit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
}

/* Confirmation card — the editable review step before submitting. */
.summary-card {
  background: var(--white);
  border: 1px solid var(--navy-15);
  border-radius: 12px;
  padding: 20px 22px 22px;
  margin: 6px 4px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 2px 10px rgba(12, 26, 47, 0.05);
}
.summary-card h2 {
  font-family: var(--serif); font-weight: 500; font-size: 22px; margin: 0;
}
.summary-help { margin: -6px 0 2px; font-size: 13px; color: var(--navy-70); line-height: 1.5; }
.summary-field {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--navy-40);
}
.summary-field input,
.summary-field textarea {
  font: 15px var(--sans);
  text-transform: none; letter-spacing: normal; font-weight: 400;
  color: var(--navy);
  background: var(--off);
  border: 1px solid var(--navy-15);
  border-radius: 9px;
  padding: 11px 13px;
  resize: vertical;
}
.summary-field input:focus,
.summary-field textarea:focus { outline: 2px solid var(--navy-40); background: var(--white); }
.summary-card button.primary { align-self: flex-start; margin-top: 4px; }
.banner {
  background: #eef5ee;
  border: 1px solid #cfe3cf;
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 15px;
  margin-bottom: 10px;
}
.banner p { margin: 0 0 12px; }
.fine { font-size: 12px; color: var(--navy-40); }
.fine a { color: var(--navy-70); }
.fine.error { color: #b3261e; }

/* Email-verification panel: a neutral "one last step" tone, not a success/error
   colour, since the submission is still pending. */
#verify-panel { background: #f4f6fb; border-color: #cdd6e6; }
.verify-row { display: flex; gap: 10px; align-items: center; margin: 4px 0 8px; }
.verify-row input {
  flex: 0 0 auto; width: 150px; font-size: 22px; letter-spacing: 6px;
  text-align: center; padding: 8px 10px; border: 1px solid var(--navy-40);
  border-radius: 8px; font-family: inherit;
}
button.linklike {
  background: none; border: none; padding: 0; font: inherit; cursor: pointer;
  color: var(--navy-70); text-decoration: underline;
}
