/* ============================================================
   SC Mais Inovação · Chat de alta performance
   Estrutura leve, onboarding persuasivo e percepção de velocidade
   ============================================================ */

:root {
  --sc-green-deep: #0a3d2c;
  --sc-green: #14583f;
  --sc-green-light: #1d6d4f;
  --sc-lime: #c9f263;
  --sc-lime-soft: #eef8bf;
  --sc-paper: #f7f5ee;
  --sc-paper-strong: #fffdf9;
  --sc-sand: #efe9dc;
  --sc-ink: #102118;
  --sc-ink-muted: #58695e;
  --sc-line: rgba(16, 33, 24, 0.12);
  --sc-line-strong: rgba(16, 33, 24, 0.18);
  --sc-danger: #cc5c46;
  --sc-glow: rgba(201, 242, 99, 0.38);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 34px;
  --shadow-sm: 0 8px 20px rgba(10, 31, 23, 0.05);
  --shadow-md: 0 20px 50px -22px rgba(10, 31, 23, 0.2);
  --shadow-lg: 0 28px 80px -28px rgba(10, 31, 23, 0.32);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  color: var(--sc-ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background:
    radial-gradient(circle at top left, rgba(201, 242, 99, 0.16), transparent 30%),
    radial-gradient(circle at top right, rgba(20, 88, 63, 0.08), transparent 24%),
    linear-gradient(180deg, #f1f7e2 0, #f7f5ee 160px, #f7f5ee 100%);
}

button,
textarea,
input {
  font: inherit;
}

button {
  border: 0;
  background: none;
}

a {
  color: inherit;
}

.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;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px 28px;
  color: #f9fbf6;
  background: rgba(10, 61, 44, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 6px 0 0 rgba(201, 242, 99, 0.88), var(--shadow-sm);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  color: var(--sc-green-deep);
  background:
    linear-gradient(180deg, #d7f88e 0%, #c9f263 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 14px 32px rgba(0, 0, 0, 0.16);
  font-family: var(--font-display);
  font-weight: 700;
}

.brand-mark-sc {
  font-size: 20px;
  line-height: 1;
}

.brand-mark-plus {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  color: var(--sc-green-deep);
  border: 2px solid var(--sc-green-deep);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.brand-text {
  min-width: 0;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.66);
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.brand-text p {
  margin-top: 4px;
  max-width: 580px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.status-pill,
.ghost-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.status-pill {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f0b454;
  box-shadow: 0 0 0 0 rgba(240, 180, 84, 0.5);
  animation: pulse 1.8s infinite;
}

.status-pill.online .status-dot {
  background: var(--sc-lime);
  box-shadow: 0 0 0 0 rgba(201, 242, 99, 0.46);
}

.status-pill.offline .status-dot {
  background: var(--sc-danger);
  animation: none;
}

.ghost-button {
  cursor: pointer;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.ghost-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(201, 242, 99, 0.32);
}

.chat-panel {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 28px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.9fr);
  gap: 18px;
  align-items: stretch;
}

.hero-copy,
.panel-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(10, 61, 44, 0.08);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 253, 249, 0.96));
  box-shadow: var(--shadow-md);
}

.hero-copy {
  padding: 30px;
}

.hero-copy::before,
.panel-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(201, 242, 99, 0.95), rgba(20, 88, 63, 0.2), transparent);
}

.hero-kicker,
.panel-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(201, 242, 99, 0.22);
  color: var(--sc-green-deep);
  font-size: 12px;
  font-weight: 700;
}

.hero-copy h2 {
  max-width: 12ch;
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 52px);
  line-height: 0.98;
  letter-spacing: -0.06em;
  color: var(--sc-green-deep);
}

.hero-copy p {
  margin-top: 16px;
  max-width: 58ch;
  font-size: 15px;
  color: var(--sc-ink-muted);
}

.hero-copy strong {
  color: var(--sc-ink);
}

.trust-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.trust-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(10, 61, 44, 0.08);
}

.trust-card strong {
  display: block;
  font-size: 18px;
  line-height: 1.1;
  color: var(--sc-green-deep);
}

.trust-card span {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--sc-ink-muted);
}

.hero-actions {
  display: flex;
}

.panel-card {
  width: 100%;
  padding: 24px;
}

.panel-header p {
  margin-top: 12px;
  color: var(--sc-ink-muted);
}

.suggestions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.suggestion {
  position: relative;
  text-align: left;
  cursor: pointer;
  padding: 16px 16px 16px 18px;
  border-radius: 18px;
  background: #fff;
  color: var(--sc-ink);
  border: 1px solid rgba(10, 61, 44, 0.1);
  box-shadow: 0 10px 24px rgba(10, 31, 23, 0.04);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.suggestion::after {
  content: "↗";
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 14px;
  color: rgba(10, 61, 44, 0.34);
}

.suggestion span {
  display: block;
  max-width: calc(100% - 24px);
  font-weight: 700;
}

.suggestion small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sc-ink-muted);
}

.suggestion:hover,
.quick-action:hover,
.composer button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.suggestion:hover {
  border-color: rgba(10, 61, 44, 0.22);
  background: linear-gradient(180deg, #fff, #f7fef0);
  box-shadow: 0 16px 34px rgba(10, 31, 23, 0.08);
}

.quick-actions {
  position: sticky;
  top: 92px;
  z-index: 8;
  padding: 2px 0;
}

.quick-actions-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 0 6px;
  scrollbar-width: none;
}

.quick-actions-scroll::-webkit-scrollbar {
  display: none;
}

.quick-action {
  cursor: pointer;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(10, 61, 44, 0.09);
  color: var(--sc-green-deep);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
  backdrop-filter: blur(10px);
}

.quick-action:hover {
  background: #fff;
  border-color: rgba(10, 61, 44, 0.18);
}

.chat-scroll {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 2px 6px;
  scroll-behavior: smooth;
}

.chat-scroll::-webkit-scrollbar {
  width: 8px;
}

.chat-scroll::-webkit-scrollbar-thumb {
  background: rgba(16, 33, 24, 0.18);
  border-radius: 999px;
}

.chat-empty {
  display: none;
}

.message {
  display: flex;
  gap: 12px;
  max-width: min(850px, 100%);
  animation: fadeUp 0.24s ease;
}

.message.user {
  margin-left: auto;
  flex-direction: row-reverse;
}

.message-avatar {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.message.assistant .message-avatar {
  color: var(--sc-lime);
  background: linear-gradient(180deg, #104a35, #0a3d2c);
  box-shadow: 0 10px 22px rgba(10, 61, 44, 0.16);
}

.message.user .message-avatar {
  color: #fff;
  background: linear-gradient(180deg, #28372f, #162019);
}

.message-bubble {
  max-width: calc(100% - 52px);
  padding: 16px 18px;
  border-radius: 20px;
  word-break: break-word;
}

.message.assistant .message-bubble {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(10, 61, 44, 0.09);
  border-bottom-left-radius: 6px;
  box-shadow: var(--shadow-sm);
}

.message.user .message-bubble {
  color: #fff;
  background: linear-gradient(180deg, #14583f, #0a3d2c);
  border-bottom-right-radius: 6px;
  box-shadow: 0 16px 34px rgba(10, 61, 44, 0.18);
}

.message-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--sc-ink-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.message.user .message-meta {
  color: rgba(255, 255, 255, 0.72);
}

.message-bubble p,
.message-bubble ul,
.message-bubble ol,
.message-bubble blockquote {
  margin: 0 0 10px;
}

.message-bubble p:last-child,
.message-bubble ul:last-child,
.message-bubble ol:last-child,
.message-bubble blockquote:last-child {
  margin-bottom: 0;
}

.message-bubble strong {
  color: var(--sc-green-deep);
}

.message.user .message-bubble strong {
  color: var(--sc-lime-soft);
}

.message-bubble ul,
.message-bubble ol {
  padding-left: 22px;
}

.message-bubble li + li {
  margin-top: 4px;
}

.message-bubble a {
  color: var(--sc-green);
  text-decoration: underline;
  text-decoration-color: rgba(10, 61, 44, 0.18);
  text-underline-offset: 3px;
}

.message.user .message-bubble a {
  color: var(--sc-lime-soft);
  text-decoration-color: rgba(201, 242, 99, 0.42);
}

.message-bubble code {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(16, 33, 24, 0.06);
  font-size: 13px;
  color: var(--sc-green-deep);
}

.message.user .message-bubble code {
  color: var(--sc-lime-soft);
  background: rgba(255, 255, 255, 0.12);
}

.message-bubble h3,
.message-bubble h4 {
  margin: 14px 0 8px;
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.1;
  color: var(--sc-green-deep);
  letter-spacing: -0.03em;
}

.message-bubble blockquote {
  padding-left: 12px;
  border-left: 3px solid var(--sc-lime);
  color: var(--sc-ink-muted);
}

.live-source {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  margin-top: 10px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(201, 242, 99, 0.18);
  color: var(--sc-green-deep);
  font-size: 11px;
  font-weight: 700;
}

.live-source::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(20, 88, 63, 0.1);
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: fit-content;
  margin-left: 50px;
  padding: 12px 16px;
  border-radius: 18px;
  border-bottom-left-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(10, 61, 44, 0.09);
  box-shadow: var(--shadow-sm);
}

.typing-dots {
  display: flex;
  gap: 4px;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sc-green);
  animation: typingBounce 1.2s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

.typing-copy {
  display: flex;
  flex-direction: column;
}

.typing-copy strong {
  font-size: 13px;
  line-height: 1.1;
  color: var(--sc-green-deep);
}

.typing-text {
  margin-top: 2px;
  font-size: 12px;
  color: var(--sc-ink-muted);
}

.composer-wrap {
  position: sticky;
  bottom: 0;
  z-index: 12;
  padding-top: 4px;
  background: linear-gradient(180deg, rgba(247, 245, 238, 0), rgba(247, 245, 238, 0.72) 20%, rgba(247, 245, 238, 0.98) 60%);
}

.composer-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 0 6px;
}

.composer-state,
.composer-meta {
  font-size: 12px;
  color: var(--sc-ink-muted);
}

.composer-state {
  font-weight: 600;
}

.composer-meta {
  flex-shrink: 0;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border-radius: 28px;
  border: 1px solid rgba(10, 61, 44, 0.12);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.composer:focus-within {
  border-color: rgba(10, 61, 44, 0.22);
  box-shadow: 0 0 0 6px rgba(201, 242, 99, 0.18), var(--shadow-lg);
}

.composer textarea {
  width: 100%;
  min-height: 28px;
  max-height: 180px;
  border: 0;
  resize: none;
  outline: 0;
  color: var(--sc-ink);
  background: transparent;
  padding: 6px 2px 6px 8px;
}

.composer textarea::placeholder {
  color: rgba(88, 105, 94, 0.88);
}

.composer button {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 108px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, #14583f, #0a3d2c);
  color: var(--sc-lime);
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: 0 16px 28px rgba(10, 61, 44, 0.2);
  transition: transform 0.16s ease, opacity 0.16s ease, filter 0.16s ease;
}

.composer button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  filter: grayscale(0.2);
}

.composer-hint {
  padding: 10px 6px 16px;
  text-align: center;
  font-size: 11px;
  color: var(--sc-ink-muted);
}

.composer-hint a {
  color: var(--sc-green);
  text-decoration: none;
  border-bottom: 1px dotted rgba(10, 61, 44, 0.22);
}

.composer-hint a:hover {
  border-bottom-color: rgba(10, 61, 44, 0.5);
}

.is-hidden {
  display: none !important;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 currentColor;
  }
  70% {
    box-shadow: 0 0 0 7px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

@keyframes typingBounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  40% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

@media (max-width: 920px) {
  .hero-band {
    grid-template-columns: 1fr;
  }

  .hero-copy h2 {
    max-width: 12ch;
  }

  .quick-actions {
    top: 86px;
  }
}

@media (max-width: 720px) {
  .app-header {
    padding: 14px 16px;
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .brand-text h1 {
    font-size: 18px;
  }

  .brand-text p {
    font-size: 12px;
  }

  .chat-panel {
    padding: 18px 14px 14px;
  }

  .hero-copy,
  .panel-card {
    padding: 22px;
  }

  .hero-copy h2 {
    max-width: 100%;
    font-size: 34px;
  }

  .trust-row {
    grid-template-columns: 1fr;
  }

  .message {
    gap: 10px;
  }

  .message-avatar {
    width: 34px;
    height: 34px;
    border-radius: 12px;
  }

  .message-bubble {
    max-width: calc(100% - 44px);
    padding: 14px 15px;
    font-size: 14px;
  }

  .typing-indicator {
    margin-left: 44px;
  }

  .composer {
    grid-template-columns: 1fr;
  }

  .composer button {
    width: 100%;
  }

  .composer-topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .quick-actions {
    top: 126px;
  }

  .ghost-button {
    padding: 0 12px;
  }

  .brand-text p {
    display: none;
  }

  .panel-card,
  .hero-copy {
    border-radius: 24px;
  }

  .typing-indicator {
    margin-left: 0;
  }
}

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