:root {
  --primary: #5b53d6;
  --primary-dark: #423bb0;
  --primary-light: #ece9fb;
  --accent: #19c3a6;
  --bg: #f6f6fb;
  --card: #ffffff;
  --text: #1f2233;
  --muted: #7a7e93;
  --border: #e6e6f0;
  --danger: #e25563;
  --ok: #19c3a6;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(40, 35, 90, 0.08);
}

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

body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }

.wrap { max-width: 980px; margin: 0 auto; padding: 24px 18px; }
.narrow { max-width: 560px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.3rem; letter-spacing: -0.5px; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--primary); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 18px;
}

h1 { font-size: 1.6rem; letter-spacing: -0.5px; margin-bottom: 4px; }
h2 { font-size: 1.15rem; margin-bottom: 12px; }
h3 { font-size: 1rem; margin-bottom: 8px; }
.sub { color: var(--muted); margin-bottom: 18px; }

label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--muted); margin: 12px 0 4px; }

input, textarea, select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--primary-light); border-color: var(--primary); }
textarea { min-height: 80px; resize: vertical; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border: none; border-radius: 10px;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 0.95rem;
  cursor: pointer; transition: background .15s, transform .05s;
}
.btn:hover { background: var(--primary-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--primary); border: 1px solid var(--border); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 7px 12px; font-size: 0.85rem; }
.btn.block { width: 100%; }

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; }
.between { display: flex; justify-content: space-between; align-items: center; }

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }
.pill.ok { background: #e3f8f3; color: #0c8d77; }
.pill.warn { background: #fff3e0; color: #b8740d; }
.pill.gray { background: #eee; color: #666; }
.pill.danger { background: #fde8ea; color: #b03242; }

.muted { color: var(--muted); }
.center { text-align: center; }
.grid-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 8px; }
.slot { padding: 9px; border: 1px solid var(--border); border-radius: 9px; background: #fff; cursor: pointer; text-align: center; font-weight: 600; font-size: 0.9rem; }
.slot:hover { border-color: var(--primary); }
.slot.sel { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Calendario mensual estilo Calendly */
.cal-layout { display: flex; gap: 22px; flex-wrap: wrap; }
.cal { flex: 1 1 300px; min-width: 280px; }
.times { flex: 1 1 200px; min-width: 200px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-head strong { font-size: 1.05rem; text-transform: capitalize; }
.cal-nav { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border); background: #fff; cursor: pointer; font-size: 1.2rem; color: var(--primary); line-height: 1; }
.cal-nav:hover:not(:disabled) { background: var(--primary-light); }
.cal-nav:disabled { opacity: .3; cursor: not-allowed; }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px; }
.cal-dow span { text-align: center; font-size: .72rem; font-weight: 700; color: var(--muted); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 9px; font-size: .9rem; font-weight: 600; border: none; background: transparent; color: var(--text); }
.cal-day.blank { visibility: hidden; }
.cal-day.off { color: #c8c8d4; }
.cal-day.has { background: var(--primary-light); color: var(--primary-dark); cursor: pointer; position: relative; }
.cal-day.has:hover { background: #ded9f7; }
.cal-day.has::after { content: ''; position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--primary); }
.cal-day.sel { background: var(--primary); color: #fff; }
.cal-day.sel::after { background: #fff; }
.times-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; max-height: 320px; overflow-y: auto; }
.time-opt { padding: 11px; border: 1px solid var(--primary); border-radius: 9px; background: #fff; color: var(--primary-dark); font-weight: 700; cursor: pointer; text-align: center; }
.time-opt:hover { background: var(--primary); color: #fff; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1f2233; color: #fff; padding: 12px 20px; border-radius: 10px; box-shadow: var(--shadow); z-index: 99; opacity: 0; transition: opacity .2s; }
.toast.show { opacity: 1; }

.hidden { display: none !important; }

.score-big { font-size: 2.4rem; font-weight: 800; color: var(--primary); }
.metric { background: var(--primary-light); border-radius: 10px; padding: 12px; }
.metric .n { font-size: 1.4rem; font-weight: 800; color: var(--primary-dark); }
.taglist { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { background: #f0f0f7; padding: 4px 10px; border-radius: 8px; font-size: 0.82rem; }

/* Sala de vídeo */
.room-bg { background: #14151f; min-height: 100vh; color: #fff; }
.videos { position: relative; width: 100%; height: 70vh; background: #0c0d14; border-radius: 16px; overflow: hidden; }
#remoteVideo { width: 100%; height: 100%; object-fit: contain; background: #0c0d14; }
#localVideo { position: absolute; bottom: 16px; right: 16px; width: 200px; max-width: 32vw; border-radius: 12px; border: 2px solid rgba(255,255,255,.2); object-fit: contain; background:#222; }
.controls { display: flex; gap: 12px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.ctrl { width: 54px; height: 54px; border-radius: 50%; border: none; background: #2a2c3c; color: #fff; font-size: 1.3rem; cursor: pointer; }
.ctrl:hover { background: #3a3d52; }
.ctrl.off { background: var(--danger); }
.ctrl.rec { background: var(--danger); }
.ctrl.leave { background: var(--danger); }
.rec-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); margin-right: 6px; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }
