:root {
  --ink: #101115;
  --muted: #6c717a;
  --blue: #1769ff;
  --coral: #ff6d67;
  --line: #e1e5eb;
  --ice: #eef5ff;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background: #f5f7fa;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.agent-page { min-height: 100vh; }

.agent-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 5;
  height: 66px;
  padding: 0 max(24px, calc((100vw - 1220px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid rgba(16, 17, 21, 0.08);
  backdrop-filter: blur(18px);
}

.agent-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.agent-brand span, .message-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, var(--blue), #75a6ff);
  border-radius: 9px;
}

.agent-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.agent-status i {
  width: 7px;
  height: 7px;
  background: #39bc78;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(57, 188, 120, 0.12);
}

.agent-main {
  min-height: 100vh;
  padding: 98px 24px 32px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 12% 20%, rgba(113, 163, 255, 0.24), transparent 25%),
    radial-gradient(circle at 88% 88%, rgba(255, 109, 103, 0.14), transparent 25%),
    #f7f9fc;
}

.unlock-card {
  width: min(100%, 570px);
  padding: 55px;
  text-align: center;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 30px;
  box-shadow: 0 30px 90px rgba(44, 64, 94, 0.14);
  backdrop-filter: blur(16px);
}

.lock-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 26px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: var(--ice);
  border-radius: 16px;
  font-size: 25px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--coral);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.unlock-card h1, .chat-sidebar h1 {
  margin: 0;
  font-size: clamp(40px, 5vw, 58px);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.unlock-copy {
  max-width: 430px;
  margin: 22px auto 32px;
  color: var(--muted);
  line-height: 1.6;
}

.password-form { text-align: left; }
.password-form label { display: block; margin: 0 0 8px; font-size: 12px; font-weight: 700; }

.password-control {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 7px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 15px;
}

.password-control:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(23, 105, 255, 0.1); }
.password-control input { min-width: 0; padding: 11px; border: 0; outline: 0; }

.password-control button, .send-button {
  color: white;
  background: var(--blue);
  border: 0;
  border-radius: 10px;
  font-weight: 700;
}

.password-control button { padding: 0 19px; }
.password-control button span { margin-left: 8px; }
.form-message { min-height: 18px; margin: 10px 3px 0; color: var(--muted); font-size: 12px; }
.form-message.error { color: #c63c3c; }
.back-link { display: inline-block; margin-top: 25px; color: var(--muted); font-size: 12px; text-decoration: none; }

.chat-app {
  width: min(100%, 1180px);
  height: min(780px, calc(100vh - 130px));
  min-height: 610px;
  display: grid;
  grid-template-columns: 330px 1fr;
  overflow: hidden;
  background: white;
  border: 1px solid rgba(16, 17, 21, 0.07);
  border-radius: 28px;
  box-shadow: 0 30px 90px rgba(44, 64, 94, 0.14);
}

.chat-sidebar {
  padding: 42px 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: white;
  background: #111216;
}

.chat-sidebar h1 { font-size: 43px; }
.chat-sidebar > div > p:last-child { margin: 22px 0 0; color: #aeb2b9; font-size: 14px; line-height: 1.6; }

.sidebar-note {
  padding: 18px;
  display: flex;
  gap: 12px;
  background: #1c1e23;
  border: 1px solid #2a2d33;
  border-radius: 16px;
}

.sidebar-note > span { color: #7cabff; }
.sidebar-note p { margin: 0; color: #adb1b8; font-size: 11px; line-height: 1.55; }
.sidebar-note b { display: block; margin-bottom: 3px; color: white; }

.chat-panel { min-width: 0; display: grid; grid-template-rows: 1fr auto; }

.messages {
  padding: 44px clamp(24px, 6vw, 70px);
  overflow-y: auto;
}

.message {
  max-width: 680px;
  margin: 0 0 24px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.message-avatar { flex: 0 0 auto; width: 31px; height: 31px; font-size: 12px; }
.message-name { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 700; }
.message p { margin: 0; font-size: 15px; line-height: 1.65; white-space: pre-wrap; }

.user-message {
  width: fit-content;
  margin-left: auto;
  padding: 13px 17px;
  color: white;
  background: var(--blue);
  border-radius: 18px 18px 4px 18px;
}

.error-message { padding: 12px 15px; color: #a93333; background: #fff0f0; border-radius: 12px; }
.pending p::after { content: ""; animation: thinking 1.2s infinite; }

@keyframes thinking {
  0% { content: "."; }
  33% { content: ".."; }
  66%, 100% { content: "..."; }
}

.suggestions {
  margin: 34px 0 0 43px;
  display: grid;
  gap: 9px;
}

.suggestions button {
  width: fit-content;
  padding: 11px 15px;
  color: #434850;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-align: left;
  font-size: 12px;
}

.suggestions button:hover { color: var(--blue); border-color: #9bbcff; background: var(--ice); }

.composer-wrap {
  padding: 14px clamp(20px, 5vw, 58px) 20px;
  background: linear-gradient(transparent, white 22%);
}

.voice-notice { margin: 0 0 8px; color: var(--muted); font-size: 11px; }

.composer {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: end;
  gap: 8px;
  padding: 8px;
  border: 1px solid #d9dee6;
  border-radius: 18px;
  box-shadow: 0 8px 30px rgba(35, 48, 69, 0.08);
}

.composer:focus-within { border-color: #9bbcff; box-shadow: 0 0 0 4px rgba(23, 105, 255, 0.08); }

.composer textarea {
  max-height: 130px;
  padding: 11px;
  resize: none;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  line-height: 1.4;
}

.voice-button, .send-button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
}

.voice-button { color: var(--blue); background: var(--ice); font-size: 20px; }
.voice-button.listening { color: white; background: var(--coral); animation: pulse 1s infinite; }
.voice-button:disabled { opacity: 0.35; cursor: not-allowed; }
.send-button { font-size: 20px; }

@keyframes pulse { 50% { transform: scale(0.93); opacity: 0.8; } }

.composer-meta {
  padding: 8px 5px 0;
  display: flex;
  justify-content: space-between;
  color: #969ba3;
  font-size: 10px;
}

.composer-meta button { padding: 0; color: #737983; background: none; border: 0; font-size: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 780px) {
  .agent-main { padding: 82px 10px 10px; }
  .agent-status { display: none; }
  .unlock-card { padding: 36px 22px; }
  .chat-app { height: calc(100vh - 92px); min-height: 0; grid-template-columns: 1fr; border-radius: 20px; }
  .chat-sidebar { display: none; }
  .messages { padding: 28px 18px; }
  .suggestions { margin-left: 0; }
  .suggestions button { width: 100%; }
  .composer-wrap { padding: 10px 12px 14px; }
  .composer-meta span { display: none; }
  .composer-meta { justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; }
}
