:root {
  --navy: #071f29;
  --ink: #102d37;
  --teal: #087a78;
  --aqua: #1bb3aa;
  --mint: #d9f1eb;
  --cream: #f5f5ef;
  --white: #fff;
  --line: #d9e1dd;
  --muted: #667b7e;
  --danger: #a84545;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: "DM Sans", sans-serif; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.agent-page { min-height: 100vh; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 17px Manrope, sans-serif; letter-spacing: .18em; }
.brand > span:last-child { display: flex; flex-direction: column; }
.brand small { margin-top: 1px; color: var(--teal); font-size: 7px; letter-spacing: .48em; }
.brand-mark { position: relative; display: inline-block; width: 28px; height: 28px; }
.brand-mark i { position: absolute; top: 1px; width: 13px; height: 24px; border-radius: 10px 2px 10px 2px; background: var(--aqua); transform: rotate(42deg); }
.brand-mark i:last-child { left: 12px; background: var(--teal); transform: rotate(-42deg); }
.eyebrow { display: flex; align-items: center; gap: 12px; margin: 0; color: var(--teal); font-size: 10px; font-weight: 700; letter-spacing: .2em; }
.eyebrow > span { width: 29px; border-top: 2px solid var(--aqua); }

.password-screen { display: grid; min-height: 100vh; grid-template-columns: minmax(430px, 48%) 1fr; background: white; }
.password-card { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 100px clamp(30px, 7vw, 110px) 60px; }
.password-card > .brand { position: absolute; top: 38px; }
.password-card h1, .voice-intro h1 { margin: 22px 0; font: 500 clamp(48px, 5vw, 76px)/1 Manrope, sans-serif; letter-spacing: -.055em; }
.password-card h1 em, .voice-intro h1 em { color: var(--teal); font-family: Georgia, serif; font-weight: 400; }
.intro-copy { max-width: 430px; margin: 0 0 34px; color: var(--muted); line-height: 1.65; }
.password-form { width: 100%; max-width: 430px; }
.password-form label { display: block; margin-bottom: 10px; font-size: 10px; font-weight: 700; letter-spacing: .14em; }
.password-field { display: flex; border: 1px solid #b8c8c6; }
.password-field:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8, 122, 120, .09); }
.password-field input { min-width: 0; flex: 1; border: 0; outline: 0; padding: 16px; }
.password-field button { border: 0; background: transparent; padding: 0 16px; color: var(--teal); font-size: 10px; font-weight: 700; cursor: pointer; }
.form-error { min-height: 20px; margin: 8px 0; color: var(--danger); font-size: 12px; }
.primary-button { display: flex; width: 100%; justify-content: space-between; border: 1px solid var(--teal); background: var(--teal); padding: 17px 19px; color: white; font-size: 13px; font-weight: 700; cursor: pointer; }
.primary-button:hover { background: #056562; }
.primary-button:disabled { cursor: wait; opacity: .65; }
.back-link { margin-top: 27px; color: var(--muted); font-size: 11px; }
.password-visual { position: relative; display: grid; overflow: hidden; place-items: center; background: var(--navy); }
.password-visual::after { position: absolute; inset: 0; background: linear-gradient(135deg, transparent 35%, rgba(48, 201, 181, .08)); content: ""; }
.password-visual > p { position: absolute; bottom: 34px; z-index: 2; color: #7f9fa1; font-size: 9px; letter-spacing: .2em; }
.visual-ring { position: absolute; border: 1px solid rgba(97, 218, 201, .2); border-radius: 50%; }
.ring-large { width: min(52vw, 650px); height: min(52vw, 650px); }
.ring-small { width: min(38vw, 470px); height: min(38vw, 470px); box-shadow: 0 0 100px rgba(27, 179, 170, .1); }
.patch { position: relative; z-index: 2; display: grid; width: 220px; height: 165px; place-items: center; border-radius: 48px; background: linear-gradient(145deg, #fff, #ced9d6); box-shadow: -25px 35px 75px rgba(0, 8, 13, .55), inset 2px 2px 6px white; transform: rotate(-13deg); }
.patch::after { position: absolute; inset: 11px; border: 1px solid #bdcbc8; border-radius: 39px; content: ""; }
.patch .brand-mark { position: absolute; top: 41px; transform: scale(.75); }
.patch small { margin-top: 25px; color: #39615e; font-size: 8px; letter-spacing: .32em; }

.voice-screen { min-height: 100vh; background: #f9faf7; }
.voice-header { display: flex; height: 82px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 0 clamp(24px, 5vw, 76px); background: white; }
.header-actions { display: flex; align-items: center; gap: 25px; }
.secure-label { color: #6f8786; font-size: 9px; font-weight: 700; letter-spacing: .15em; }
.secure-label i { display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: #42cdb9; box-shadow: 0 0 0 4px rgba(66, 205, 185, .14); }
.text-button { border: 0; background: transparent; color: var(--teal); font-size: 11px; cursor: pointer; }
.voice-layout { display: grid; min-height: calc(100vh - 82px); grid-template-columns: 50% 50%; }

.avatar-column { position: relative; display: flex; min-width: 0; flex-direction: column; overflow: hidden; border-right: 1px solid #22444b; background: radial-gradient(circle at 50% 55%, #174c52 0, var(--navy) 68%); padding: clamp(30px, 5vh, 58px) clamp(25px, 4vw, 62px) 25px; color: white; }
.avatar-column::after { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(145deg, transparent 55%, rgba(39, 207, 184, .08)); content: ""; }
.avatar-heading { position: relative; z-index: 3; }
.avatar-heading .eyebrow { color: #72d5c8; }
.avatar-heading h1 { margin: 12px 0 4px; font: 500 clamp(34px, 4vw, 58px)/1 Manrope, sans-serif; letter-spacing: -.05em; }
.avatar-heading h1 em { color: #72d5c8; font-family: Georgia, serif; font-weight: 400; }
.avatar-heading > p:last-child { max-width: 420px; margin: 10px 0 0; color: #9cb5b6; font-size: 12px; line-height: 1.5; }
.avatar-stage { position: relative; z-index: 2; display: grid; min-height: 0; flex: 1; place-items: end center; }
.avatar-image { position: relative; z-index: 2; display: block; width: min(100%, 620px); max-height: calc(100vh - 265px); object-fit: contain; object-position: center bottom; filter: drop-shadow(0 24px 35px rgba(0, 8, 12, .35)); user-select: none; }
.avatar-stage.speaking .avatar-image { filter: drop-shadow(0 24px 45px rgba(43, 210, 187, .24)); }
.avatar-halo { position: absolute; left: 50%; border: 1px solid rgba(102, 223, 206, .16); border-radius: 50%; transform: translateX(-50%); }
.halo-one { bottom: 2%; width: min(44vw, 620px); height: min(44vw, 620px); }
.halo-two { bottom: 11%; width: min(34vw, 470px); height: min(34vw, 470px); }
.avatar-stage.speaking .avatar-halo { animation: avatarPulse 1.4s infinite ease-out; }
.avatar-stage.speaking .halo-two { animation-delay: .4s; }
.avatar-live { position: absolute; right: 8px; bottom: 20px; z-index: 4; display: flex; align-items: center; gap: 8px; border: 1px solid rgba(133, 214, 204, .25); background: rgba(4, 29, 38, .72); backdrop-filter: blur(10px); padding: 10px 12px; color: #a7c4c4; font-size: 8px; letter-spacing: .14em; }
.avatar-live i { width: 6px; height: 6px; border-radius: 50%; background: #5de1ca; box-shadow: 0 0 0 4px rgba(93, 225, 202, .12); }
.medical-note { position: relative; z-index: 3; max-width: 510px; margin: 10px 0 0; border-left: 2px solid var(--aqua); padding-left: 14px; color: #809fa1; font-size: 9px; line-height: 1.5; }
@keyframes avatarPulse { 0% { opacity: .45; transform: translateX(-50%) scale(.78); } 100% { opacity: 0; transform: translateX(-50%) scale(1.08); } }

.conversation-column { display: flex; min-width: 0; flex-direction: column; padding: clamp(28px, 4vh, 48px) clamp(25px, 4vw, 62px) 24px; background: white; }
.conversation-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 25px; }
.conversation-topline h1 { margin: 9px 0 0; font: 500 clamp(28px, 3.2vw, 43px)/1.1 Manrope, sans-serif; letter-spacing: -.045em; }
.timer-row { flex: 0 0 auto; border-left: 1px solid var(--line); padding-left: 20px; color: #738987; text-align: right; font-size: 8px; letter-spacing: .15em; }
.timer-row span, .timer-row strong { display: block; }
.timer-row strong { margin-top: 5px; color: var(--ink); font: 500 17px Manrope, sans-serif; letter-spacing: .05em; }
.chat-log { min-height: 96px; max-height: 175px; margin: 24px 0 18px; overflow-y: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 4px; scrollbar-width: thin; }
.chat-message { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0; }
.chat-message > span { flex: 0 0 42px; padding-top: 3px; color: var(--teal); font-size: 8px; font-weight: 700; letter-spacing: .12em; }
.chat-message p { max-width: 520px; margin: 0; color: #536c70; font-size: 12px; line-height: 1.5; white-space: pre-wrap; }
.chat-message.user { justify-content: flex-end; }
.chat-message.user > span { order: 2; color: #879795; }
.chat-message.user p { color: var(--ink); text-align: right; }
.voice-control-row { display: flex; align-items: center; gap: clamp(20px, 4vw, 50px); }
.voice-orb-wrap { position: relative; display: grid; width: 150px; height: 150px; flex: 0 0 150px; place-items: center; }
.voice-ripple { position: absolute; border: 1px solid rgba(15, 142, 135, .18); border-radius: 50%; }
.ripple-one { inset: 0; }
.ripple-two { inset: 17px; }
.voice-orb { position: relative; z-index: 2; display: grid; width: 88px; height: 88px; place-items: center; border: 0; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #41d1bd, #0a7776 62%, #07505a); color: white; box-shadow: 0 15px 34px rgba(5, 74, 78, .27); cursor: pointer; transition: transform .25s, box-shadow .25s; }
.voice-orb:hover { transform: scale(1.04); }
.voice-orb svg { width: 29px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.5; }
.voice-orb.connecting { cursor: wait; animation: breathe 1.2s infinite alternate; }
.voice-orb.connected { background: radial-gradient(circle at 35% 30%, #63ddc9, #087a78 60%, #073f4b); }
.voice-orb.speaking { animation: speak 1s infinite alternate; }
.voice-orb.ended { background: #839794; box-shadow: none; }
.voice-orb-wrap.active .voice-ripple { animation: ripple 1.8s infinite ease-out; }
.voice-orb-wrap.active .ripple-two { animation-delay: .45s; }
@keyframes breathe { to { transform: scale(.96); opacity: .8; } }
@keyframes speak { to { transform: scale(1.07); box-shadow: 0 20px 45px rgba(23, 180, 164, .4); } }
@keyframes ripple { 0% { transform: scale(.72); opacity: .65; } 100% { transform: scale(1.1); opacity: 0; } }
.voice-state { min-width: 0; flex: 1; }
.voice-state strong, .voice-state > span { display: block; }
.voice-state strong { font: 500 20px Manrope, sans-serif; }
.voice-state > span { max-width: 380px; margin-top: 6px; color: #7d918f; font-size: 10px; line-height: 1.4; }
.session-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.session-controls button { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: white; padding: 8px 11px; color: var(--ink); font-size: 9px; cursor: pointer; }
.session-controls button:disabled { cursor: not-allowed; opacity: .4; }
.session-controls svg { width: 14px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.6; }
.session-controls #end-button:not(:disabled) { border-color: #d9b7b7; color: var(--danger); }
.connection-error { min-height: 15px; margin: 8px 0; color: var(--danger); font-size: 9px; }
.starter-panel { margin-top: 2px; }
.starter-panel > p { margin: 0 0 8px; color: var(--teal); font-size: 8px; font-weight: 700; letter-spacing: .16em; }
.starter-questions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.starter-questions button { min-height: 62px; border: 1px solid var(--line); background: #f8faf8; padding: 10px; color: var(--ink); text-align: left; font-size: 10px; line-height: 1.35; cursor: pointer; }
.starter-questions button:hover { border-color: var(--teal); background: white; color: var(--teal); }
.starter-questions button:disabled { cursor: not-allowed; opacity: .45; }
.text-question-form { display: flex; margin-top: 11px; border: 1px solid #b7c8c5; background: white; }
.text-question-form:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8, 122, 120, .08); }
.text-question-form input { min-width: 0; flex: 1; border: 0; outline: 0; padding: 12px 13px; color: var(--ink); font-size: 11px; }
.text-question-form button { border: 0; background: var(--teal); padding: 0 16px; color: white; font-size: 10px; font-weight: 700; cursor: pointer; }
.text-question-form button:disabled { cursor: wait; opacity: .5; }
.microphone-note { display: block; margin-top: 8px; color: #879895; font-size: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

@media (max-width: 900px) {
  .voice-layout { grid-template-columns: 1fr; }
  .avatar-column { min-height: 620px; border-right: 0; }
  .avatar-image { max-height: 430px; }
  .halo-one { width: 560px; height: 560px; }
  .halo-two { width: 420px; height: 420px; }
  .conversation-column { min-height: 720px; }
}

@media (max-width: 620px) {
  .password-screen { grid-template-columns: 1fr; }
  .password-visual { display: none; }
  .password-card { min-height: 100vh; padding: 110px 24px 50px; }
  .password-card > .brand { top: 30px; }
  .password-card h1 { font-size: 44px; }
  .voice-header { height: 70px; padding: 0 20px; }
  .secure-label { display: none; }
  .avatar-column { min-height: 520px; padding: 35px 22px 20px; }
  .avatar-heading h1 { font-size: 40px; }
  .avatar-image { width: 100%; max-height: 340px; }
  .avatar-live { bottom: 8px; }
  .conversation-column { min-height: auto; padding: 35px 20px; }
  .conversation-topline { align-items: center; }
  .conversation-topline h1 { font-size: 30px; }
  .voice-control-row { gap: 16px; }
  .voice-orb-wrap { width: 118px; height: 118px; flex-basis: 118px; }
  .voice-orb { width: 72px; height: 72px; }
  .starter-questions { grid-template-columns: 1fr; }
  .starter-questions button { min-height: 0; }
}

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