/* ===================================================
   app.css — CloseBot app-level styles (demo + dashboard)
   Theme variables live in theme.css.
   =================================================== */

/* ===== NAV ===== */
.app-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 60px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--accent);
}

/* ===== MAIN WRAPPER ===== */
.app-main {
  min-height: calc(100vh - 60px);
}

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: #000;
  background: var(--accent);
  padding: 12px 24px;
  border-radius: var(--radius);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  letter-spacing: -0.01em;
}

.btn-primary:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

.btn-primary.btn-full {
  width: 100%;
  text-align: center;
}

.btn-primary.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-ghost {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fg);
  background: transparent;
  padding: 12px 24px;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== HERO CTA ===== */
.hero-cta {
  display: flex;
  gap: 12px;
  margin-top: 36px;
  flex-wrap: wrap;
}

/* ===== DEMO SHELL ===== */
.demo-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - 60px);
}

/* ===== PHONE MOCKUP ===== */
.phone-mockup {
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
}

.phone-screen {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 32px;
  padding: 60px 40px;
  width: 280px;
  text-align: center;
  box-shadow: 0 0 60px var(--accent-glow);
}

.call-ring-indicator {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ring-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: ringPulse 1.8s ease-out infinite;
  opacity: 0;
}

.ring-pulse.delay-1 { animation-delay: 0.6s; }
.ring-pulse.delay-2 { animation-delay: 1.2s; }

@keyframes ringPulse {
  0% { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(1.8); opacity: 0; }
}

.call-icon {
  font-size: 32px;
  position: relative;
  z-index: 2;
  animation: iconPulse 1.8s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.call-label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}

.caller-info {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.call-time {
  font-size: 0.8rem;
  color: var(--fg-muted);
}

/* ===== CHAT MOCKUP ===== */
.chat-mockup {
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 40px;
  gap: 0;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.chat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.chat-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
}

.chat-status {
  font-size: 0.8rem;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.4s ease-in-out infinite;
}

.status-dot.green {
  background: var(--accent);
  animation: none;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.chat-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  max-height: 340px;
}

.msg {
  display: flex;
}

.msg.caller {
  justify-content: flex-end;
}

.msg-bubble {
  padding: 10px 16px;
  border-radius: 18px;
  font-size: 0.9rem;
  max-width: 76%;
  line-height: 1.5;
}

.msg.bot .msg-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.msg.caller .msg-bubble {
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  color: var(--fg);
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.msg.typing .msg-bubble {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 14px 18px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fg-muted);
  animation: bounce 1.2s ease-in-out infinite;
}

.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ===== CALENDAR MOCKUP ===== */
.calendar-mockup {
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: 40px;
  overflow-y: auto;
}

.cal-header {
  margin-bottom: 24px;
}

.cal-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.cal-sub {
  font-size: 0.85rem;
  color: var(--fg-muted);
}

.cal-slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cal-slot {
  padding: 10px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 0.85rem;
  transition: all 0.2s;
}

.cal-slot.available {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.cal-slot.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.slot-time {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--fg);
}

.slot-status {
  font-size: 0.75rem;
  color: var(--fg-muted);
  margin-top: 2px;
}

/* ===== DEMO FORM PANEL ===== */
.demo-form-panel {
  padding: 60px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.demo-step-badge {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--accent-dim);
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 20px;
}

.demo-form-panel h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 12px;
}

.demo-sub {
  color: var(--fg-muted);
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 32px;
}

.demo-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg);
}

.form-group input,
.form-group select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.95rem;
  color: var(--fg);
  font-family: var(--font-body);
  transition: border-color 0.2s;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--accent);
}

.form-group input::placeholder {
  color: var(--fg-muted);
}

.optional {
  font-weight: 400;
  color: var(--fg-muted);
}

.demo-note {
  margin-top: 16px;
  font-size: 0.82rem;
  color: var(--fg-muted);
}

.demo-note a {
  color: var(--accent);
  text-decoration: none;
}

.alert-error {
  background: rgba(255, 80, 80, 0.1);
  border: 1px solid rgba(255, 80, 80, 0.3);
  color: #ff8080;
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.lead-chip {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.85rem;
}

.chip-label {
  color: var(--fg-muted);
}

.chip-value {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--fg);
}

/* ===== SLOT PICKER ===== */
.slot-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 4px;
}

.slot-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--fg);
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}

.slot-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.slot-btn.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--fg);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

/* ===== CONFIRM PAGE ===== */
.confirm-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
}

.confirm-shell {
  max-width: 600px;
  width: 100%;
  text-align: center;
}

.confirm-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 2px solid var(--accent);
  color: var(--accent);
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.confirm-shell h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin-bottom: 12px;
}

.confirm-sub {
  color: var(--fg-muted);
  font-size: 1rem;
  line-height: 1.65;
  margin-bottom: 36px;
}

.confirm-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: left;
  margin-bottom: 32px;
}

.confirm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.confirm-row:last-child {
  border-bottom: none;
}

.confirm-label {
  font-size: 0.85rem;
  color: var(--fg-muted);
  font-family: var(--font-display);
}

.confirm-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
}

.status-booked {
  color: var(--accent);
}

.followup-section {
  text-align: left;
  margin-bottom: 32px;
}

.followup-section h3 {
  font-size: 1rem;
  margin-bottom: 16px;
}

.followup-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.followup-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.followup-channel {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 8px;
  border-radius: 100px;
  flex-shrink: 0;
  margin-top: 2px;
}

.followup-msg {
  flex: 1;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--fg-muted);
}

.followup-status {
  font-size: 0.75rem;
  font-family: var(--font-display);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  flex-shrink: 0;
}

.followup-item.compact {
  padding: 8px 12px;
}

.confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.confirm-pitch {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  text-align: left;
}

.confirm-pitch p {
  color: var(--fg-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 6px;
}

.confirm-pitch p:last-child {
  margin-bottom: 0;
}

/* ===== STATUS PILLS ===== */
.status-pill {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 10px;
  border-radius: 100px;
  text-transform: uppercase;
}

.status-new       { background: rgba(255,255,255,0.07); color: var(--fg-muted); }
.status-qualified { background: rgba(0,230,118,0.1);    color: var(--accent); }
.status-booked    { background: rgba(0,230,118,0.2);    color: var(--accent); border: 1px solid var(--accent); }
.status-converted { background: rgba(0,230,118,0.35);   color: #000; }
.status-pending   { background: rgba(255,255,255,0.07); color: var(--fg-muted); }
.status-sent      { background: rgba(0,230,118,0.1);    color: var(--accent); }
.status-confirmed { background: rgba(0,230,118,0.2);    color: var(--accent); }

/* ===== DASHBOARD ===== */
.dash-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 60px);
}

.dash-sidebar {
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.dash-logo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.02em;
}

.dash-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dash-nav a {
  display: block;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.15s;
}

.dash-nav a:hover,
.dash-nav a.active {
  background: var(--bg-card);
  color: var(--fg);
}

.dash-nav a.active {
  color: var(--accent);
}

.dash-practice {
  margin-top: auto;
}

.practice-name {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 4px;
}

.practice-status {
  font-size: 0.78rem;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.dash-content {
  padding: 40px 48px;
  overflow-y: auto;
}

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.dash-header h1 {
  font-size: 1.5rem;
}

/* ===== STATS ROW ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 36px;
}

.stat-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: border-color 0.2s;
}

.stat-tile:hover {
  border-color: var(--accent);
}

.stat-tile.accent {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.tile-number {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}

.tile-label {
  font-size: 0.8rem;
  color: var(--fg-muted);
  font-family: var(--font-display);
  font-weight: 500;
}

/* ===== DASH COLUMNS ===== */
.dash-columns {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
}

.dash-right-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dash-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.dash-section.full {
  width: 100%;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.section-header h2 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg);
}

.section-link {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 500;
}

/* ===== DATA TABLE ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  padding: 10px 20px;
  text-align: left;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.data-table td {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--fg);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: var(--bg-elevated);
}

.muted {
  color: var(--fg-muted);
  font-size: 0.85rem;
}

/* ===== APPOINTMENTS LIST ===== */
.appt-list {
  padding: 8px 0;
}

.appt-item {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.appt-item:last-child {
  border-bottom: none;
}

.appt-item:hover {
  background: var(--bg-elevated);
}

.appt-time {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 2px;
}

.appt-name {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1px;
}

.appt-service {
  font-size: 0.8rem;
}

/* ===== COMPACT FOLLOW-UP LIST ===== */
.followup-list.compact {
  gap: 0;
}

.followup-item.compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.followup-item.compact:last-child {
  border-bottom: none;
}

.fu-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fu-name {
  font-size: 0.875rem;
  font-weight: 500;
}

.fu-channel {
  font-size: 0.75rem;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.9rem;
}

.empty-state.small {
  padding: 20px;
}

.empty-state a {
  color: var(--accent);
  text-decoration: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .demo-shell {
    grid-template-columns: 1fr;
  }

  .phone-mockup,
  .chat-mockup,
  .calendar-mockup {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 40px 24px;
  }

  .demo-form-panel {
    padding: 40px 24px;
  }

  .dash-layout {
    grid-template-columns: 1fr;
  }

  .dash-sidebar {
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .dash-practice { margin-top: 0; }

  .dash-content {
    padding: 24px;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .app-nav {
    padding: 0 20px;
  }

  .slot-picker {
    grid-template-columns: 1fr;
  }
}
