/* ═══════════════════════════════════════════════════════════
   OCO AI — Demos · estilos compartidos de las páginas de chat.
   Alineado con la web principal (v4.6): aurora esmeralda, Sora +
   DM Sans, logo oficial. Reutiliza los nombres de clase de las
   demos para no tocar la lógica de chat.
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg:        #071310;
  --bg-2:      #0B1C17;
  --panel:     rgba(17, 38, 31, 0.55);
  --panel-2:   rgba(23, 50, 41, 0.72);
  --line:      rgba(45, 202, 140, 0.14);
  --line-hi:   rgba(45, 202, 140, 0.42);
  --accent:    #2DCA8C;   /* --green */
  --accent-2:  #7FE7BE;   /* --mint  */
  --green:     #2DCA8C;
  --mint:      #7FE7BE;
  --forest:    #1A7A52;
  --text:      #EAF6F0;   /* --white/off */
  --white:     #EAF6F0;
  --off:       #EAF6F0;
  --steel:     #9DB8AC;   /* --text-dim */
  --fog:       #C4DBD0;
  --display:   "Sora", sans-serif;
  --body:      "DM Sans", sans-serif;
  --ease-out:  cubic-bezier(.16, 1, .3, 1);
  --r:         18px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
html, body { height: 100%; background: var(--bg); color: var(--text); font-family: var(--body); overflow: hidden; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
img { display: block; max-width: 100%; }

/* ─── Fondo aurora (fijo) ─── */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(52vw 52vw at 88% -6%, rgba(45,202,140,.20), transparent 60%),
    radial-gradient(44vw 44vw at 4% 104%, rgba(28,120,88,.16), transparent 60%);
}
body::after {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(45,202,140,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45,202,140,.05) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 100% 100% at 50% 40%, #000 0%, transparent 78%);
  mask-image: radial-gradient(ellipse 100% 100% at 50% 40%, #000 0%, transparent 78%);
}

.page-wrap { position: relative; z-index: 1; display: flex; gap: 20px; align-items: stretch; max-width: 1180px; margin: 0 auto; height: 100vh; padding: 0 24px; }

/* ─── Logo oficial (wordmark) ─── */
.brand-logo { height: 26px; width: auto; display: block; }
.logo-name { display: none; } /* el wordmark ya trae el nombre */

/* ─── SIDEBAR ─── */
.sidebar { width: 272px; flex-shrink: 0; display: flex; flex-direction: column; padding: 20px 0; animation: fadeDown .5s .1s var(--ease-out) both; }
.sb-card { background: var(--panel); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); border: 1px solid var(--line); border-radius: 22px; padding: 24px 20px; display: flex; flex-direction: column; gap: 18px; flex: 1; overflow-y: auto; scrollbar-width: none; }
.sb-card::-webkit-scrollbar { display: none; }
.sb-agent { display: flex; align-items: center; gap: 13px; }
.sb-icon {
  width: 48px; height: 48px; flex-shrink: 0; border-radius: 14px;
  background: rgba(45,202,140,.10); border: 1px solid var(--line-hi);
  display: flex; align-items: center; justify-content: center; color: var(--accent-2);
}
.sb-icon svg { width: 24px; height: 24px; }
.sb-name { font-family: var(--display); font-weight: 700; font-size: .96rem; color: var(--text); letter-spacing: -.02em; line-height: 1.2; }
.sb-sector { font-size: .67rem; font-weight: 500; color: var(--accent); opacity: .85; margin-top: 3px; letter-spacing: .04em; text-transform: uppercase; }
.sb-hr { height: 1px; background: linear-gradient(90deg, var(--line-hi), transparent); }
.sb-desc { font-size: .82rem; line-height: 1.7; color: var(--steel); }
.sb-section-title { font-family: var(--display); font-size: .62rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); opacity: .8; margin-bottom: 11px; }
.sb-caps { display: flex; flex-direction: column; gap: 8px; }
.sb-cap { display: flex; align-items: flex-start; gap: 11px; padding: 11px 13px; background: rgba(45,202,140,.04); border: 1px solid var(--line); border-radius: 13px; transition: border-color .2s, background .2s, transform .25s var(--ease-out); }
.sb-cap:hover { background: rgba(45,202,140,.08); border-color: var(--line-hi); transform: translateX(2px); }
.sb-cap-emoji, .sb-cap-ic {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(45,202,140,.08); border: 1px solid var(--line); color: var(--accent-2);
}
.sb-cap-emoji svg, .sb-cap-ic svg { width: 16px; height: 16px; }
.sb-cap-title { font-family: var(--display); font-weight: 600; font-size: .77rem; color: var(--text); margin-bottom: 3px; letter-spacing: -.01em; }
.sb-cap-desc { font-size: .70rem; line-height: 1.5; color: var(--steel); }
.sb-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.sb-tag { font-family: var(--display); font-size: .66rem; font-weight: 500; background: rgba(45,202,140,.07); border: 1px solid var(--line-hi); border-radius: 100px; padding: 4px 11px; color: var(--accent-2); }
.sb-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.sb-foot-mark { width: 26px; height: 26px; flex-shrink: 0; }
.sb-foot-mark img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 8px rgba(45,202,140,.4)); }
.sb-foot-text { font-size: .66rem; color: var(--steel); line-height: 1.35; }
.sb-foot-text strong { color: var(--fog); font-weight: 600; font-family: var(--display); }

/* ─── CHAT ─── */
.app { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; }
header { display: flex; align-items: center; gap: 12px; padding: 18px 0 14px; border-bottom: 1px solid var(--line); flex-shrink: 0; animation: fadeDown .45s var(--ease-out) both; }
.btn-back { width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0; background: var(--panel); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--steel); text-decoration: none; transition: border-color .2s, color .2s, background .2s, transform .2s var(--ease-out); }
.btn-back:hover { border-color: var(--line-hi); color: var(--accent); background: rgba(45,202,140,.07); transform: translateX(-2px); }
.logo-link { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.hd-sep { flex: 1; }
.hd-info { text-align: right; }
.hd-title { font-family: var(--display); font-weight: 600; font-size: .88rem; color: var(--text); letter-spacing: -.01em; }
.hd-sub { font-size: .69rem; color: var(--steel); margin-top: 1px; }
.live-dot { display: inline-block; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 6px var(--accent); margin-right: 5px; animation: livePulse 2.2s ease-in-out infinite; }
@keyframes livePulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.65); } }

.chat { flex: 1; overflow-y: auto; padding: 22px 0 10px; display: flex; flex-direction: column; gap: 4px; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: rgba(45,202,140,.16) transparent; }
.chat::-webkit-scrollbar { width: 5px; }
.chat::-webkit-scrollbar-thumb { background: rgba(45,202,140,.16); border-radius: 4px; }

.welcome { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 34px 26px 28px; background: var(--panel); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); border: 1px solid var(--line-hi); border-radius: 22px; margin-bottom: 18px; animation: fadeUp .55s var(--ease-out) both; position: relative; overflow: hidden; }
.welcome::after { content: ''; position: absolute; inset: 0; background: radial-gradient(460px 220px at 50% -20%, rgba(45,202,140,.12), transparent 70%); pointer-events: none; }
.w-icon { position: relative; width: 62px; height: 62px; border-radius: 18px; background: rgba(45,202,140,.10); border: 1px solid var(--line-hi); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; color: var(--accent-2); }
.w-icon svg { width: 30px; height: 30px; }
.w-icon img { width: 34px; height: 34px; filter: drop-shadow(0 0 12px rgba(45,202,140,.5)); }
.w-title { position: relative; font-family: var(--display); font-size: 1.15rem; font-weight: 700; color: var(--text); margin-bottom: 9px; letter-spacing: -.02em; }
.w-sub { position: relative; font-size: .85rem; line-height: 1.65; color: var(--steel); max-width: 360px; }
.w-hint { position: relative; display: flex; align-items: center; gap: 10px; margin: 20px 0 12px; width: 100%; }
.w-hint-line { flex: 1; height: 1px; background: var(--line); }
.w-hint-text { font-size: .64rem; color: var(--steel); letter-spacing: .1em; white-space: nowrap; text-transform: uppercase; }
.suggest-btn { position: relative; width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; background: rgba(45,202,140,.10); border: 1px solid var(--line-hi); border-radius: 15px; padding: 14px 20px; font-family: var(--display); font-size: .85rem; font-weight: 600; color: var(--text); cursor: pointer; transition: background .2s, border-color .2s, transform .2s var(--ease-out), box-shadow .2s; animation: suggestPulse 3s 2s ease-in-out infinite; }
.suggest-btn svg { width: 16px; height: 16px; color: var(--accent-2); }
@keyframes suggestPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(45,202,140,0); border-color: var(--line-hi); } 50% { box-shadow: 0 0 0 5px rgba(45,202,140,.09); border-color: rgba(45,202,140,.6); } }
.suggest-btn:hover, .suggest-btn:focus-visible { background: rgba(45,202,140,.18); border-color: rgba(45,202,140,.6); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(45,202,140,.2); animation: none; }

.msg { display: flex; flex-direction: column; max-width: 78%; animation: msgSlide .28s var(--ease-out) both; }
@keyframes msgSlide { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg.agent { align-self: flex-start; align-items: flex-start; }
.bubble { padding: 12px 16px; border-radius: var(--r); font-size: .88rem; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.msg.user .bubble { background: rgba(45,202,140,.14); border: 1px solid var(--line-hi); border-bottom-right-radius: 5px; color: var(--text); }
.msg.agent .bubble { background: var(--panel-2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--line); border-bottom-left-radius: 5px; color: var(--text); position: relative; padding-left: 18px; }
.msg.agent .bubble::before { content: ''; position: absolute; left: 0; top: 18%; bottom: 18%; width: 2px; border-radius: 2px; background: linear-gradient(to bottom, transparent, var(--accent), transparent); }
.bubble-file { display: flex; align-items: center; gap: 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
.file-icon { font-size: 22px; flex-shrink: 0; }
.file-name { font-size: .82rem; font-weight: 500; color: var(--text); }
.file-size { font-size: .68rem; color: var(--steel); margin-top: 2px; }
.bubble-audio { display: flex; align-items: center; gap: 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 50px; padding: 10px 15px; min-width: 200px; }
.audio-play-btn { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); border: none; color: var(--bg); font-size: 11px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform .15s, box-shadow .15s; }
.audio-play-btn:hover, .audio-play-btn:focus-visible { transform: scale(1.08); box-shadow: 0 0 14px rgba(45,202,140,.42); }
.audio-waveform { display: flex; align-items: center; gap: 2px; flex: 1; height: 24px; }
.waveform-bar { width: 2px; border-radius: 2px; background: var(--accent); opacity: .5; min-height: 3px; }
.audio-dur { font-size: .70rem; color: var(--steel); flex-shrink: 0; }
.msg-time { font-size: .62rem; color: rgba(157,184,172,.5); margin-top: 4px; padding: 0 3px; }

#typing { display: none; align-self: flex-start; background: var(--panel-2); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: var(--r); border-bottom-left-radius: 5px; padding: 13px 16px; animation: msgSlide .28s var(--ease-out) both; }
#typing.on { display: flex; align-items: center; gap: 5px; }
.td { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: .4; animation: tdBounce 1.2s infinite ease-in-out; }
.td:nth-child(2) { animation-delay: .2s; }
.td:nth-child(3) { animation-delay: .4s; }
@keyframes tdBounce { 0%,60%,100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-6px); opacity: 1; } }

.input-area { flex-shrink: 0; padding: 10px 0 20px; border-top: 1px solid var(--line); }
#preview-strip { display: none; flex-wrap: wrap; gap: 7px; padding: 8px 0; margin-bottom: 7px; }
#preview-strip.on { display: flex; }
.f-chip { display: flex; align-items: center; gap: 5px; background: rgba(45,202,140,.08); border: 1px solid var(--line-hi); border-radius: 100px; padding: 4px 10px 4px 8px; font-size: .70rem; color: var(--accent-2); max-width: 190px; }
.f-chip span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-rm { cursor: pointer; color: var(--steel); margin-left: 2px; flex-shrink: 0; transition: color .15s; }
.f-rm:hover { color: #ff6b6b; }
#rec-row { display: none; align-items: center; gap: 12px; background: var(--panel-2); backdrop-filter: blur(16px); border: 1px solid var(--line-hi); border-radius: 16px; padding: 10px 14px; }
#rec-row.on { display: flex; }
.rec-led { width: 8px; height: 8px; border-radius: 50%; background: #ff5c5c; flex-shrink: 0; animation: blink 1s infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .2; } }
#rec-timer { font-family: var(--display); font-size: .8rem; font-weight: 600; color: var(--text); min-width: 34px; }
#viz { display: flex; align-items: center; gap: 2px; flex: 1; height: 26px; overflow: hidden; }
.vb { width: 3px; border-radius: 2px; background: var(--accent); min-height: 3px; transition: height .08s; }
.btn-rec-cancel, .btn-rec-send { border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.btn-rec-cancel { background: none; color: var(--steel); padding: 4px; border-radius: 6px; transition: color .15s; }
.btn-rec-cancel:hover { color: #ff6b6b; }
.btn-rec-send { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--bg); flex-shrink: 0; transition: background .2s, transform .15s; }
.btn-rec-send:hover { background: var(--accent-2); transform: scale(1.05); }
#input-row { display: flex; align-items: flex-end; gap: 10px; }
.input-glass { flex: 1; display: flex; align-items: flex-end; gap: 8px; background: var(--panel-2); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--line-hi); border-radius: 18px; padding: 10px 12px; transition: border-color .22s, box-shadow .22s; }
.input-glass:focus-within { border-color: rgba(45,202,140,.5); box-shadow: 0 0 0 3px rgba(45,202,140,.08); }
.icon-btn { width: 30px; height: 30px; flex-shrink: 0; border-radius: 8px; background: none; border: none; cursor: pointer; color: var(--steel); display: flex; align-items: center; justify-content: center; transition: color .18s, background .18s; }
.icon-btn:hover { color: var(--accent); background: rgba(45,202,140,.08); }
#msgInput { flex: 1; background: none; border: none; outline: none; color: var(--text); font-family: var(--body); font-size: .92rem; line-height: 1.5; resize: none; min-height: 24px; max-height: 100px; }
#msgInput::placeholder { color: rgba(157,184,172,.5); }
.btn-send { width: 44px; height: 44px; flex-shrink: 0; border-radius: 14px; background: linear-gradient(140deg, var(--accent-2), var(--accent)); border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #06231A; box-shadow: 0 4px 18px rgba(45,202,140,.3); transition: transform .18s var(--ease-out), box-shadow .2s; }
.btn-send:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(45,202,140,.42); }
.btn-send:active { transform: scale(.96); }
input[type=file] { display: none; }

@keyframes fadeDown { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@keyframes fadeUp   { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ─── Mobile ─── */
.mob-bar { display: none; align-items: center; gap: 10px; padding: 8px 0 10px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.mob-icon { width: 30px; height: 30px; background: rgba(45,202,140,.08); border: 1px solid var(--line); border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--accent-2); }
.mob-icon svg { width: 16px; height: 16px; }
.mob-name { font-family: var(--display); font-weight: 600; font-size: .78rem; color: var(--text); letter-spacing: -.01em; }
.mob-sub { font-size: .62rem; color: var(--steel); margin-top: 1px; }
.mob-info { display: none; flex-direction: column; gap: 14px; background: var(--panel); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); border: 1px solid var(--line); border-radius: 20px; padding: 18px 16px; flex-shrink: 0; }
.mob-scroll-cta { display: none; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .1ms !important; } }

@media (max-width: 768px) {
  html, body { height: auto !important; overflow-y: auto !important; overflow-x: hidden !important; }
  .page-wrap { flex-direction: column; height: auto; padding: 0 16px; gap: 0; }
  .sidebar { display: flex !important; width: 100%; min-height: 100dvh; padding: 20px 0 24px; flex-shrink: 0; }
  .sb-card { overflow: visible; max-height: none; }
  .mob-scroll-cta { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 24px; margin-top: 8px; background: linear-gradient(140deg, var(--accent-2), var(--accent)); border-radius: 14px; font-family: var(--display); font-weight: 600; font-size: .9rem; color: #06231A; text-decoration: none; transition: transform .18s var(--ease-out); }
  .mob-scroll-cta:hover, .mob-scroll-cta:active { transform: translateY(-1px); }
  .app { height: 100dvh; flex-shrink: 0; overflow: hidden; }
  .mob-bar, .mob-info { display: none !important; }
  header { padding: 12px 0 10px; }
  .hd-title { font-size: .82rem; }
  .hd-sub { font-size: .6rem; }
  .input-area { padding: 8px 0; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .icon-btn { width: 36px; height: 36px; }
  .btn-send { width: 40px; height: 40px; border-radius: 12px; }
  #msgInput { font-size: 1rem; }
  .msg { max-width: 90%; }
  .bubble { font-size: .86rem; padding: 11px 14px; }
  .chat { padding: 16px 0 8px; }
}
@media (max-width: 480px) {
  .page-wrap { padding: 0 12px; }
  .welcome { padding: 24px 16px 18px; }
  .w-icon { width: 52px; height: 52px; }
  .suggest-btn { font-size: .78rem; padding: 11px 16px; }
}
