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

:root {
  --red: #e63946;
  --red-dark: #c1121f;
  --bg: #0a0a0a;
  --surface: #141414;
  --surface2: #1e1e1e;
  --border: #2a2a2a;
  --text: #ffffff;
  --muted: #666666;
  --success: #6fcf6f;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── NAV ── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-logo { font-size: 18px; font-weight: 700; color: var(--red); }
.nav-actions { display: flex; gap: 12px; align-items: center; }

/* ── BUTTONS ── */
.btn {
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}
.btn:hover { opacity: 0.85; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--red); color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-full { width: 100%; }

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

/* ── FORMS ── */
.form-group { margin-bottom: 18px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input, textarea, select {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
input:focus, textarea:focus, select:focus { border-color: var(--red); }
textarea { resize: vertical; min-height: 80px; }
select option { background: var(--surface2); }

/* ── ALERTS ── */
.alert { padding: 12px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; }
.alert-error { background: #2a0a0a; border: 1px solid var(--red); color: #ff6b6b; }
.alert-success { background: #0d2a0d; border: 1px solid #2d5a2d; color: var(--success); }

/* ── BADGE ── */
.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-trial { background: #2a1a00; color: #f4a261; border: 1px solid #5a3a00; }
.badge-weekly { background: #0a1a2a; color: #74b9ff; border: 1px solid #1a4a6a; }
.badge-annual { background: #0d2a0d; color: var(--success); border: 1px solid #2d5a2d; }

/* ── STAGE PILL ── */
.stage-pill {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  background: #1a0a0a;
  border: 1px solid var(--red);
  color: var(--red);
}

/* ── CHAT ── */
.chat-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 57px);
}
.chat-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
}
.chat-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--red);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.msg { max-width: 82%; }
.msg-user { align-self: flex-end; }
.msg-ai { align-self: flex-start; }
.msg-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.msg-user .msg-bubble { background: var(--red); color: #fff; border-bottom-right-radius: 4px; }
.msg-ai .msg-bubble { background: var(--surface2); color: var(--text); border-bottom-left-radius: 4px; }
.msg-time { font-size: 11px; color: var(--muted); margin-top: 4px; padding: 0 4px; }
.msg-user .msg-time { text-align: right; }
.chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.chat-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 15px;
  resize: none;
  outline: none;
  max-height: 120px;
  font-family: inherit;
  line-height: 1.4;
}
.chat-input:focus { border-color: var(--red); }
.chat-send {
  width: 44px; height: 44px;
  background: var(--red);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.chat-send:disabled { opacity: 0.4; }

/* ── TYPING ── */
.typing-dot {
  display: inline-flex; gap: 4px; align-items: center; padding: 12px 16px;
  background: var(--surface2); border-radius: 16px; border-bottom-left-radius: 4px;
}
.typing-dot span {
  width: 6px; height: 6px; background: var(--muted);
  border-radius: 50%; animation: bounce 1.2s infinite;
}
.typing-dot span:nth-child(2) { animation-delay: 0.2s; }
.typing-dot span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* ── GIRL CARDS ── */
.girls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 20px;
}
.girl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.1s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.girl-card:hover { border-color: var(--red); transform: translateY(-2px); }
.girl-card-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.girl-card-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, var(--red), #ff6b6b);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; flex-shrink: 0;
}
.girl-card-name { font-size: 17px; font-weight: 600; margin-bottom: 2px; }
.girl-card-meta { font-size: 13px; color: var(--muted); }
.girl-card-footer { display: flex; justify-content: space-between; align-items: center; }

.add-card {
  background: transparent;
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 40px 20px;
  cursor: pointer;
  transition: border-color 0.2s;
  text-align: center;
  color: var(--muted);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.add-card:hover { border-color: var(--red); color: var(--red); }
.add-icon { font-size: 28px; }

/* ── PAGE HEADER ── */
.page-header {
  padding: 24px 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.page-title { font-size: 22px; font-weight: 700; }
.page-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* ── MARKDOWN en respuestas ── */
.msg-bubble strong { font-weight: 700; }
.msg-bubble h2, .msg-bubble h3 { margin: 10px 0 4px; font-size: 15px; }
.msg-bubble ul, .msg-bubble ol { padding-left: 18px; margin: 6px 0; }
.msg-bubble li { margin-bottom: 3px; }
.msg-bubble hr { border: none; border-top: 1px solid #333; margin: 10px 0; }
.msg-bubble blockquote {
  border-left: 3px solid var(--red);
  padding-left: 10px;
  color: #ccc;
  margin: 8px 0;
}
