/* ===================================================
   BRIEF INTELIGENTE — One Man Studio Mexico
   Design System & Chat UI
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --oms-orange:        #E85D20;
  --oms-orange-light:  #FF7A3D;
  --oms-orange-dark:   #C44A17;
  --oms-orange-glow:   rgba(232, 93, 32, 0.18);
  --oms-orange-subtle: rgba(232, 93, 32, 0.08);
  --bg-app:      #080B10;
  --bg-surface:  rgba(255, 255, 255, 0.04);
  --bg-hover:    rgba(255, 255, 255, 0.07);
  --bg-input:    rgba(255, 255, 255, 0.06);
  --bg-card:     rgba(255, 255, 255, 0.05);
  --border-subtle:  rgba(255, 255, 255, 0.08);
  --border-medium:  rgba(255, 255, 255, 0.14);
  --border-orange:  rgba(232, 93, 32, 0.35);
  --text-primary:   #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-muted:     rgba(255, 255, 255, 0.35);
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;
  --radius-2xl: 32px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  --header-height: 72px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-app);
  color: var(--text-primary);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 860px;
  margin: 0 auto;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: -30%;
  right: -20%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(232,93,32,0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  bottom: -20%;
  left: -15%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(232,93,32,0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ══ HEADER ══ */
#chat-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  height: var(--header-height);
  background: rgba(8, 11, 16, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  z-index: 100;
  flex-shrink: 0;
}

.header-logo { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.logo-power-icon { width: 30px; height: 30px; flex-shrink: 0; }
.logo-wordmark { display: flex; flex-direction: column; line-height: 1; }
.logo-main-row { display: flex; align-items: baseline; font-size: 19px; font-weight: 900; letter-spacing: -0.8px; }
.logo-one  { color: var(--text-primary); }
.logo-man  { color: var(--oms-orange); }
.logo-studio { font-size: 9px; font-weight: 600; letter-spacing: 4.5px; color: var(--text-secondary); text-transform: uppercase; margin-top: 3px; padding-left: 1px; }

.header-progress { flex: 1; min-width: 0; }
.progress-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.progress-module-name { font-size: 11px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.progress-percent { font-size: 11px; font-weight: 700; color: var(--oms-orange); flex-shrink: 0; margin-left: 8px; }
.progress-track { height: 4px; background: var(--border-subtle); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--oms-orange-dark), var(--oms-orange-light)); border-radius: 99px; transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); width: 0%; }

.btn-icon { width: 38px; height: 38px; border-radius: var(--radius-md); border: 1px solid var(--border-subtle); background: var(--bg-surface); color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: var(--transition); flex-shrink: 0; }
.btn-icon:hover { background: var(--bg-hover); border-color: var(--border-medium); color: var(--text-primary); transform: rotate(-15deg); }

/* ══ CHAT WINDOW ══ */
#chat-window { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 28px 24px 20px; position: relative; z-index: 1; scroll-behavior: smooth; }
#chat-window::-webkit-scrollbar { width: 4px; }
#chat-window::-webkit-scrollbar-track { background: transparent; }
#chat-window::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 99px; }
#chat-window::-webkit-scrollbar-thumb:hover { background: var(--oms-orange); }

.message-row { display: flex; gap: 12px; margin-bottom: 10px; animation: msg-in 0.4s cubic-bezier(0.34, 1.4, 0.64, 1) both; }
.message-row.bot { align-items: flex-end; }
.message-row.user { flex-direction: row-reverse; }

@keyframes msg-in {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.bot-avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--oms-orange-dark) 0%, var(--oms-orange) 100%); display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 0 0 2px rgba(232,93,32,0.25); }
.bot-avatar svg { width: 16px; height: 16px; }

.bubble { max-width: 72%; padding: 14px 18px; border-radius: var(--radius-xl); font-size: 15px; line-height: 1.6; position: relative; }
.bubble.bot { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-bottom-left-radius: 6px; color: var(--text-primary); backdrop-filter: blur(8px); }
.bubble.user { background: linear-gradient(135deg, var(--oms-orange-dark) 0%, var(--oms-orange) 60%, var(--oms-orange-light) 100%); border-bottom-right-radius: 6px; color: white; font-weight: 500; box-shadow: 0 4px 20px rgba(232,93,32,0.3); }

.typing-row { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 10px; animation: msg-in 0.3s ease both; }
.typing-bubble { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-xl); border-bottom-left-radius: 6px; padding: 14px 20px; display: flex; gap: 5px; align-items: center; }
.typing-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); animation: dot-bounce 1.3s infinite; }
.typing-dot:nth-child(2) { animation-delay: 0.18s; }
.typing-dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes dot-bounce {
  0%, 60%, 100% { transform: translateY(0); background: var(--text-muted); }
  30% { transform: translateY(-7px); background: var(--oms-orange); }
}

.module-badge { display: flex; align-items: center; gap: 10px; padding: 10px 18px; background: var(--oms-orange-subtle); border: 1px solid var(--border-orange); border-radius: var(--radius-lg); font-size: 12px; font-weight: 700; color: var(--oms-orange-light); letter-spacing: 0.3px; margin: 18px 0 10px; width: fit-content; animation: badge-in 0.5s cubic-bezier(0.34, 1.4, 0.64, 1) both; }
@keyframes badge-in {
  from { opacity: 0; transform: scale(0.85) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.module-badge .badge-icon { font-size: 15px; }

/* ══ INPUT AREA ══ */
#input-area { flex-shrink: 0; background: rgba(8, 11, 16, 0.95); border-top: 1px solid var(--border-subtle); backdrop-filter: blur(20px); padding: 16px 24px 20px; position: relative; z-index: 100; }
#input-container { width: 100%; }

.input-wrapper { display: flex; gap: 10px; align-items: flex-end; }
.input-field { flex: 1; background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 13px 18px; color: var(--text-primary); font-family: inherit; font-size: 15px; outline: none; transition: var(--transition); resize: none; line-height: 1.5; }
.input-field::placeholder { color: var(--text-muted); }
.input-field:focus { border-color: var(--oms-orange); background: rgba(232,93,32,0.05); box-shadow: 0 0 0 3px var(--oms-orange-glow); }
.textarea-field { min-height: 80px; max-height: 180px; overflow-y: auto; }

.btn-send { width: 46px; height: 46px; border-radius: 50%; border: none; background: linear-gradient(135deg, var(--oms-orange-dark), var(--oms-orange)); color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition-bounce); flex-shrink: 0; box-shadow: 0 4px 14px rgba(232,93,32,0.35); }
.btn-send:hover  { transform: scale(1.08); box-shadow: 0 6px 18px rgba(232,93,32,0.5); }
.btn-send:active { transform: scale(0.96); }
.btn-send svg { width: 18px; height: 18px; }

.skip-row { display: flex; justify-content: flex-end; margin-top: 8px; }
.btn-skip { background: none; border: none; color: var(--text-muted); font-size: 12px; cursor: pointer; padding: 4px 8px; border-radius: var(--radius-sm); transition: var(--transition); }
.btn-skip:hover { color: var(--text-secondary); background: var(--bg-hover); }

.options-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.option-card { padding: 10px 16px; border-radius: var(--radius-lg); border: 1px solid var(--border-subtle); background: var(--bg-card); color: var(--text-secondary); font-size: 13.5px; font-weight: 500; cursor: pointer; transition: var(--transition-bounce); user-select: none; line-height: 1.4; }
.option-card:hover { border-color: var(--oms-orange); color: var(--text-primary); background: var(--oms-orange-subtle); transform: translateY(-2px); }
.option-card.selected { border-color: var(--oms-orange); background: var(--oms-orange-subtle); color: var(--oms-orange-light); box-shadow: 0 0 0 1px var(--oms-orange); }
.option-card.selected::before { content: '✓ '; font-weight: 700; }

.bool-grid { display: flex; gap: 10px; }
.bool-card { flex: 1; padding: 14px 20px; border-radius: var(--radius-lg); border: 1px solid var(--border-subtle); background: var(--bg-card); color: var(--text-secondary); font-size: 15px; font-weight: 600; cursor: pointer; transition: var(--transition-bounce); text-align: center; }
.bool-card:hover { transform: translateY(-2px); }
.bool-card.yes:hover, .bool-card.yes.selected { border-color: #22C55E; background: rgba(34,197,94,0.1); color: #4ADE80; box-shadow: 0 0 0 1px #22C55E; }
.bool-card.no:hover,  .bool-card.no.selected  { border-color: #EF4444; background: rgba(239,68,68,0.1); color: #F87171; box-shadow: 0 0 0 1px #EF4444; }

.scale-grid { display: flex; gap: 8px; align-items: stretch; }
.scale-card { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 12px 8px; border-radius: var(--radius-md); border: 1px solid var(--border-subtle); background: var(--bg-card); cursor: pointer; transition: var(--transition-bounce); }
.scale-card:hover, .scale-card.selected { border-color: var(--oms-orange); background: var(--oms-orange-subtle); transform: translateY(-3px); }
.scale-num { font-size: 20px; font-weight: 800; color: var(--text-primary); }
.scale-label { font-size: 10px; color: var(--text-muted); text-align: center; line-height: 1.2; }
.scale-card.selected .scale-num { color: var(--oms-orange); }
.scale-card.selected .scale-label { color: var(--oms-orange-light); }

.social-urls-grid { display: flex; flex-direction: column; gap: 10px; }
.social-url-row { display: flex; align-items: center; gap: 10px; }
.social-badge { font-size: 12px; font-weight: 600; color: var(--text-secondary); min-width: 80px; text-align: right; }

.btn-confirm { width: 100%; margin-top: 12px; padding: 13px 24px; border-radius: var(--radius-lg); border: none; background: linear-gradient(135deg, var(--oms-orange-dark), var(--oms-orange)); color: white; font-size: 15px; font-weight: 700; cursor: pointer; transition: var(--transition-bounce); box-shadow: 0 4px 16px rgba(232,93,32,0.3); }
.btn-confirm:hover  { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(232,93,32,0.45); }
.btn-confirm:active { transform: translateY(0); }
.btn-confirm:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.select-other-input { width: 100%; margin-top: 10px; }

.input-subtext { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; line-height: 1.5; }

/* ══ WELCOME ══ */
.welcome-cta { display: flex; justify-content: center; padding: 10px 0 4px; }
.btn-start { padding: 15px 36px; border-radius: var(--radius-xl); border: none; background: linear-gradient(135deg, var(--oms-orange-dark) 0%, var(--oms-orange) 50%, var(--oms-orange-light) 100%); color: white; font-size: 16px; font-weight: 700; cursor: pointer; transition: var(--transition-bounce); box-shadow: 0 6px 28px rgba(232,93,32,0.4); letter-spacing: 0.3px; }
.btn-start:hover  { transform: translateY(-3px) scale(1.03); box-shadow: 0 10px 36px rgba(232,93,32,0.55); }
.btn-start:active { transform: translateY(-1px) scale(1.01); }

/* ══ SUMMARY ══ */
#summary-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; animation: overlay-in 0.35s ease both; }
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }

#summary-panel { background: #0F1218; border: 1px solid var(--border-medium); border-radius: var(--radius-2xl) var(--radius-2xl) 0 0; width: 100%; max-width: 860px; max-height: 88vh; overflow-y: auto; padding: 0 0 40px; animation: panel-up 0.4s cubic-bezier(0.34, 1.2, 0.64, 1) both; }
@keyframes panel-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
#summary-panel::-webkit-scrollbar { width: 4px; }
#summary-panel::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 99px; }

.summary-header { position: sticky; top: 0; background: #0F1218; padding: 24px 28px 16px; border-bottom: 1px solid var(--border-subtle); z-index: 10; }
.summary-title-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.summary-title { font-size: 20px; font-weight: 800; color: var(--text-primary); }
.summary-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

.summary-actions { display: flex; gap: 10px; padding: 16px 28px 0; }
.btn-export { flex: 1; padding: 12px 18px; border-radius: var(--radius-lg); border: 1px solid var(--border-medium); background: var(--bg-card); color: var(--text-primary); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: var(--transition); display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-export.primary { background: linear-gradient(135deg, var(--oms-orange-dark), var(--oms-orange)); border-color: transparent; box-shadow: 0 4px 16px rgba(232,93,32,0.3); }
.btn-export:hover { transform: translateY(-2px); }
.btn-export.primary:hover { box-shadow: 0 6px 22px rgba(232,93,32,0.45); }

.summary-body { padding: 20px 28px 0; }
.summary-section { margin-bottom: 24px; }
.summary-section-title { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--oms-orange); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; gap: 8px; }
.summary-field { display: grid; grid-template-columns: 180px 1fr; gap: 8px 16px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 13.5px; }
.summary-field:last-child { border-bottom: none; }
.summary-field-key { color: var(--text-secondary); font-weight: 500; }
.summary-field-val { color: var(--text-primary); word-break: break-word; white-space: pre-wrap; }
.summary-field-val.empty { color: var(--text-muted); font-style: italic; }
.summary-tag { display: inline-block; background: var(--oms-orange-subtle); border: 1px solid var(--border-orange); color: var(--oms-orange-light); padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; margin: 2px 3px 2px 0; }

/* ══ TOAST ══ */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: #1A1F2A; border: 1px solid var(--border-medium); color: var(--text-primary); padding: 12px 24px; border-radius: var(--radius-lg); font-size: 14px; font-weight: 600; z-index: 1000; opacity: 0; transition: all 0.3s ease; pointer-events: none; white-space: nowrap; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.input-fade-in { animation: input-appear 0.35s cubic-bezier(0.34, 1.3, 0.64, 1) both; }
@keyframes input-appear { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ══ RESPONSIVE ══ */
@media (max-width: 600px) {
  #chat-header   { padding: 0 16px; }
  #chat-window   { padding: 20px 16px 16px; }
  #input-area    { padding: 12px 16px 16px; }
  .logo-main-row { font-size: 15px; }
  .logo-studio   { font-size: 7.5px; letter-spacing: 3px; }
  .logo-power-icon { width: 24px; height: 24px; }
  .progress-module-name { max-width: 110px; font-size: 10px; }
  .bubble { max-width: 88%; font-size: 14px; padding: 12px 15px; }
  .option-card { font-size: 13px; padding: 9px 13px; }
  .summary-field { grid-template-columns: 1fr; gap: 4px; }
  .summary-field-key { font-size: 11px; }
  .summary-actions { flex-direction: column; }
  .summary-body { padding: 16px 18px 0; }
  .summary-header { padding: 18px 18px 14px; }
}
