@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  /* MyWork brand palette (from mywork.com.au) */
  --navy: #1F2041;
  --navy-light: #2c2d5c;
  --teal: #33C6A4;
  --teal-dark: #26a186;
  --bg: #f4f7fa;
  --text: #1a2531;
  --muted: #6b7686;
  --border: #e1e6ec;
  --white: #ffffff;
  --radius: 14px;
  --shadow: 0 4px 20px rgba(31, 32, 65, 0.10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.wide {
  max-width: 960px;
}

header.top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 0 24px;
}

header.top .logo {
  display: flex;
  align-items: center;
}

header.top .logo img {
  height: 28px;
  display: block;
}

header.top .tagline {
  color: var(--muted);
  font-size: 13px;
  margin-left: auto;
}

/* --- Cards / panels --- */

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 28px;
  margin-bottom: 20px;
}

h1 {
  font-size: 24px;
  margin: 0 0 6px;
  color: var(--navy);
}

h2 {
  font-size: 18px;
  color: var(--navy);
  margin: 0 0 14px;
}

p.sub {
  color: var(--muted);
  margin: 0 0 20px;
  font-size: 14.5px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  margin: 16px 0 6px;
}

label:first-of-type { margin-top: 0; }

input[type="text"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: 15px;
  font-family: inherit;
  background: var(--white);
  color: var(--text);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(23, 182, 167, 0.15);
}

button {
  cursor: pointer;
  font-family: inherit;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--teal);
  color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 700;
  margin-top: 18px;
  transition: background 0.15s ease;
}

.btn:hover { background: var(--teal-dark); }
.btn:disabled { background: #b7c1cc; cursor: not-allowed; }

.btn.secondary {
  background: var(--navy);
}
.btn.secondary:hover { background: var(--navy-light); }

/* --- Result / link display --- */

.result-box {
  background: #eefaf9;
  border: 1.5px solid var(--teal);
  border-radius: 10px;
  padding: 16px 18px;
  margin-top: 18px;
}

.result-box .link-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.result-box input {
  flex: 1;
  background: #fff;
  font-size: 13.5px;
}

.copy-btn {
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.copy-btn:hover { background: var(--navy-light); }

/* --- Admin list table --- */

.admin-key-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 4px;
}
.admin-key-row > div { flex: 1; }
.admin-key-row .btn { margin-top: 0; }

table.sessions {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 10px;
}
table.sessions th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 2px solid var(--border);
  padding: 10px 8px;
}
table.sessions td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.sessions tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11.5px;
  font-weight: 700;
}
.badge.not_started { background: #eef1f5; color: var(--muted); }
.badge.in_progress { background: #fff3d6; color: #8a6100; }
.badge.completed { background: #e0f8ee; color: #0a7a4a; }

.link-cell {
  font-size: 12.5px;
  color: var(--teal-dark);
  cursor: pointer;
  text-decoration: underline;
}

/* --- Chat interface --- */

body.chat-page {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy) 140px, var(--bg) 140px);
}

.chat-shell {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.chat-header {
  color: #fff;
  padding: 6px 4px 22px;
}
.chat-header .logo {
  margin-bottom: 10px;
}
.chat-header .logo img {
  height: 24px;
  display: block;
  filter: brightness(0) invert(1);
}
.chat-header .company {
  font-size: 14px;
  opacity: 0.85;
}
.chat-header .pm-note {
  font-size: 12.5px;
  opacity: 0.65;
  margin-top: 2px;
}

.progress-track {
  height: 6px;
  background: rgba(255,255,255,0.18);
  border-radius: 100px;
  margin-top: 14px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 100px;
  transition: width 0.3s ease;
  width: 0%;
}

.chat-window {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
}

.messages {
  flex: 1;
  padding: 20px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 320px;
  max-height: 60vh;
}

.msg {
  max-width: 82%;
  padding: 12px 15px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.msg.bot {
  background: #eef1f5;
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.msg.client {
  background: var(--teal);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 14px 16px;
  background: #eef1f5;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
}
.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9aa5b1;
  animation: bounce 1.2s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.input-row {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: #fafbfc;
}

.input-row textarea {
  flex: 1;
  resize: none;
  min-height: 46px;
  max-height: 140px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 15px;
}

.send-btn {
  background: var(--teal);
  color: #fff;
  border: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.send-btn:hover { background: var(--teal-dark); }
.send-btn:disabled { background: #b7c1cc; cursor: not-allowed; }

.done-banner {
  text-align: center;
  padding: 30px 20px;
  color: var(--muted);
  font-size: 14px;
}

.error-box {
  background: #fdecea;
  border: 1.5px solid #e57373;
  color: #a33;
  padding: 16px;
  border-radius: 10px;
  margin: 20px 0;
}

footer.foot {
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  padding: 30px 0 10px;
}

/* --- Answers modal --- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 20, 35, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  z-index: 100;
}

.modal {
  background: var(--white);
  border-radius: var(--radius);
  max-width: 640px;
  width: 100%;
  padding: 26px 28px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.modal-header h2 { margin: 0; }

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--muted);
  line-height: 1;
  padding: 0 0 0 12px;
}
.modal-close:hover { color: var(--text); }

.qa-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.qa-item:last-child { border-bottom: none; }

.qa-item .q {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}

.qa-item .a {
  font-size: 14.5px;
  color: var(--text);
  white-space: pre-wrap;
}

.qa-item .a.empty {
  color: var(--muted);
  font-style: italic;
}

/* --- Small helper text under inputs --- */
.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

@media (max-width: 520px) {
  .wrap, .chat-shell { padding-left: 12px; padding-right: 12px; }
  .card { padding: 20px; }
}
