/* Aria — conversational agent widget */
:root {
  --aria-navy: #0A2540;
  --aria-navy-2: #143661;
  --aria-gold: #D4A574;
  --aria-gold-dark: #B5874E;
  --aria-teal: #0F9B8E;
  --aria-teal-dark: #0B7A70;
  --aria-cream: #FAF7F2;
  --aria-cream-2: #F2EDE3;
  --aria-ink: #0E1A2B;
  --aria-muted: #5C6B7E;
  --aria-line: #E6DFD2;
  --aria-bot-bg: #F2EDE3;
  --aria-user-bg: #0F9B8E;
}

/* Floating launcher button */
.aria-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--aria-navy);
  color: var(--aria-cream);
  padding: 14px 20px 14px 14px;
  border-radius: 999px;
  border: 0;
  box-shadow: 0 12px 40px rgba(10, 37, 64, 0.28);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.aria-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 48px rgba(10, 37, 64, 0.32);
}
.aria-launcher .aria-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--aria-gold), var(--aria-gold-dark));
  display: grid;
  place-items: center;
  color: var(--aria-navy);
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.aria-launcher .aria-launcher-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
  text-align: left;
}
.aria-launcher .aria-launcher-text strong {
  color: var(--aria-cream);
  font-weight: 600;
  font-size: 0.95rem;
}
.aria-launcher .aria-launcher-text span {
  color: var(--aria-gold);
  font-size: 0.78rem;
  margin-top: 2px;
}
.aria-launcher .aria-pulse {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  background: var(--aria-gold);
  border: 2px solid var(--aria-navy);
  border-radius: 50%;
}
.aria-launcher .aria-pulse::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--aria-gold);
  opacity: 0.4;
  animation: aria-pulse 2s ease-in-out infinite;
}
@keyframes aria-pulse {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.6); opacity: 0; }
}

@media (max-width: 540px) {
  .aria-launcher .aria-launcher-text { display: none; }
  .aria-launcher { padding: 14px; }
}

/* Chat panel */
.aria-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: 640px;
  max-height: calc(100vh - 48px);
  background: var(--aria-cream);
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(10, 37, 64, 0.32);
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  border: 1px solid rgba(212, 165, 116, 0.3);
  transform-origin: bottom right;
}
.aria-panel.open {
  display: flex;
  animation: aria-slide-up 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
@keyframes aria-slide-up {
  from { transform: translateY(20px) scale(0.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
@media (max-width: 540px) {
  .aria-panel {
    bottom: 0; right: 0; left: 0; width: 100%; max-width: 100%;
    height: 100%; max-height: 100%; border-radius: 0;
  }
}

/* Panel header */
.aria-header {
  background: linear-gradient(135deg, var(--aria-navy), var(--aria-navy-2));
  color: var(--aria-cream);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.aria-header .aria-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, var(--aria-gold), var(--aria-gold-dark));
  display: grid; place-items: center;
  color: var(--aria-navy); font-family: Georgia, serif; font-weight: 700;
  font-size: 1rem; letter-spacing: -0.03em; flex-shrink: 0;
  position: relative;
}
.aria-header .aria-avatar::after {
  content: ""; position: absolute; bottom: 1px; right: 1px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #34D399; border: 2px solid var(--aria-navy);
}
.aria-header .aria-name { display: flex; flex-direction: column; flex-grow: 1; line-height: 1.2; }
.aria-header .aria-name strong { color: var(--aria-cream); font-weight: 600; font-size: 1rem; }
.aria-header .aria-name span { color: rgba(250,247,242,0.65); font-size: 0.78rem; margin-top: 2px; }
.aria-close {
  background: rgba(250,247,242,0.1); color: var(--aria-cream);
  border: 0; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  font-size: 1.1rem; transition: background 0.15s ease;
}
.aria-close:hover { background: rgba(250,247,242,0.2); }

/* Messages */
.aria-messages {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px 18px;
  scroll-behavior: smooth;
}
.aria-messages::-webkit-scrollbar { width: 6px; }
.aria-messages::-webkit-scrollbar-thumb { background: rgba(10,37,64,0.15); border-radius: 3px; }

.aria-msg {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  max-width: 85%;
  animation: aria-msg-in 0.3s ease;
}
@keyframes aria-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.aria-msg.bot { align-self: flex-start; align-items: flex-start; }
.aria-msg.user { align-self: flex-end; align-items: flex-end; margin-left: auto; }

.aria-bubble {
  padding: 11px 15px;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.aria-msg.bot .aria-bubble {
  background: var(--aria-bot-bg);
  color: var(--aria-ink);
  border-bottom-left-radius: 4px;
}
.aria-msg.user .aria-bubble {
  background: var(--aria-user-bg);
  color: white;
  border-bottom-right-radius: 4px;
}
.aria-bubble strong { font-weight: 600; }
.aria-bubble em { font-style: italic; color: var(--aria-gold-dark); }
.aria-msg.user .aria-bubble em { color: rgba(255,255,255,0.85); }
.aria-bubble a { color: var(--aria-teal); font-weight: 500; }
.aria-msg.user .aria-bubble a { color: white; text-decoration: underline; }

/* Quick replies */
.aria-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  align-self: flex-start;
}
.aria-quick {
  background: white;
  color: var(--aria-navy);
  border: 1px solid var(--aria-gold);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.15s ease;
}
.aria-quick:hover {
  background: var(--aria-navy);
  color: white;
  border-color: var(--aria-navy);
}
.aria-quick.primary {
  background: var(--aria-teal);
  color: white;
  border-color: var(--aria-teal);
}
.aria-quick.primary:hover {
  background: var(--aria-teal-dark);
  border-color: var(--aria-teal-dark);
}

/* Cards (assessment results, etc.) */
.aria-card {
  background: white;
  border: 1px solid var(--aria-line);
  border-radius: 14px;
  padding: 18px;
  margin-top: 8px;
  box-shadow: 0 4px 14px rgba(10,37,64,0.06);
  width: 100%;
  max-width: 320px;
  align-self: flex-start;
}
.aria-card .aria-card-tag {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--aria-teal);
  font-weight: 700;
  margin-bottom: 6px;
}
.aria-card h4 {
  font-family: Georgia, serif;
  color: var(--aria-navy);
  margin: 0 0 6px;
  font-size: 1.15rem;
  line-height: 1.25;
}
.aria-card .aria-card-body {
  font-size: 0.9rem;
  color: var(--aria-ink);
  margin-bottom: 12px;
  line-height: 1.5;
}
.aria-card .aria-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  padding: 10px 0;
  border-top: 1px dashed var(--aria-line);
  margin-bottom: 10px;
  color: var(--aria-muted);
}
.aria-card .aria-card-meta strong { color: var(--aria-navy); }
.aria-card-cta {
  display: inline-block;
  background: var(--aria-gold);
  color: var(--aria-navy);
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.86rem;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
}
.aria-card-cta:hover { background: var(--aria-gold-dark); color: white; }
.aria-card-cta.secondary {
  background: white;
  color: var(--aria-navy);
  border: 1px solid var(--aria-navy);
  margin-left: 6px;
}
.aria-card-cta.secondary:hover { background: var(--aria-navy); color: white; }

/* Score gauge */
.aria-score {
  display: flex; align-items: center; gap: 14px; margin-bottom: 12px;
}
.aria-score-ring {
  --score: 70;
  width: 64px; height: 64px; border-radius: 50%;
  background:
    conic-gradient(var(--aria-teal) calc(var(--score) * 1%), var(--aria-cream-2) 0);
  display: grid; place-items: center;
  flex-shrink: 0;
  position: relative;
}
.aria-score-ring::before {
  content: ""; position: absolute; inset: 6px;
  border-radius: 50%; background: white;
}
.aria-score-ring strong {
  position: relative;
  font-family: Georgia, serif;
  font-size: 1.3rem;
  color: var(--aria-navy);
  font-weight: 700;
}
.aria-score-text { flex-grow: 1; }
.aria-score-text .score-num { font-weight: 600; color: var(--aria-navy); font-size: 0.95rem; }
.aria-score-text .score-lbl { font-size: 0.85rem; color: var(--aria-muted); }

/* Form inputs in chat */
.aria-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  width: 100%;
  max-width: 320px;
}
.aria-text-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--aria-line);
  border-radius: 12px;
  background: white;
  font: inherit;
  font-size: 0.95rem;
  color: var(--aria-ink);
}
.aria-text-input:focus {
  outline: none;
  border-color: var(--aria-teal);
  box-shadow: 0 0 0 3px rgba(15,155,142,0.12);
}
.aria-input-row {
  display: flex; gap: 8px;
}
.aria-input-row .aria-text-input { flex-grow: 1; }
.aria-input-submit {
  background: var(--aria-teal);
  color: white;
  border: 0;
  padding: 11px 18px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
  flex-shrink: 0;
}
.aria-input-submit:hover { background: var(--aria-teal-dark); }
.aria-input-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* Typing indicator */
.aria-typing {
  display: flex; gap: 4px; padding: 12px 16px;
  background: var(--aria-bot-bg); border-radius: 16px;
  border-bottom-left-radius: 4px; align-self: flex-start;
  margin-bottom: 14px; align-items: center;
  width: max-content;
}
.aria-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--aria-muted); opacity: 0.4;
  animation: aria-typing-bounce 1.2s ease-in-out infinite;
}
.aria-typing span:nth-child(2) { animation-delay: 0.15s; }
.aria-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes aria-typing-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-5px); opacity: 1; }
}

/* Composer */
.aria-composer {
  border-top: 1px solid var(--aria-line);
  padding: 12px 14px;
  background: white;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
}
.aria-composer textarea {
  flex-grow: 1;
  resize: none;
  border: 1px solid var(--aria-line);
  border-radius: 14px;
  padding: 10px 14px;
  font: inherit;
  font-size: 0.95rem;
  color: var(--aria-ink);
  max-height: 120px;
  min-height: 42px;
  background: white;
  line-height: 1.4;
}
.aria-composer textarea:focus {
  outline: none;
  border-color: var(--aria-teal);
  box-shadow: 0 0 0 3px rgba(15,155,142,0.12);
}
.aria-send {
  background: var(--aria-teal);
  color: white;
  border: 0;
  width: 42px; height: 42px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.aria-send:hover { background: var(--aria-teal-dark); }
.aria-send:disabled { opacity: 0.5; cursor: not-allowed; }
.aria-send svg { width: 18px; height: 18px; }

/* Mini-footer / privacy line */
.aria-footnote {
  font-size: 0.72rem; color: var(--aria-muted);
  text-align: center; padding: 6px 14px 10px;
  background: white;
  border-top: 1px solid rgba(230, 223, 210, 0.5);
}
.aria-footnote a { color: var(--aria-teal); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .aria-msg, .aria-panel.open, .aria-launcher .aria-pulse::before {
    animation: none !important;
  }
}
