/* ============================================================
   Elivre Agendamento — Front do Responsável
   Tokens: paper #F6F3EA · ink #1C2541 · gold #E8A33D
           teal #2F7A6B (confirmado) · brick #C6543F (cancelado)
   Display: "Bitter" (slab, clima de caderno escolar)
   Corpo: "Inter"   ·   Dados/hora: "IBM Plex Mono"
   ============================================================ */

/* Fontes carregadas via <link> no base.html (não bloqueante) */

:root {
  --paper: #F6F3EA;
  --paper-raised: #FFFFFF;
  --ink: #1C2541;
  --ink-soft: #5B6480;
  --gold: #E8A33D;
  --gold-deep: #C9862A;
  --teal: #2F7A6B;
  --brick: #C6543F;
  --line: #DED7C4;
  --radius: 14px;
}

* { box-sizing: border-box; }

body.rp {
  margin: 0;
  background: var(--paper);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px);
  background-size: 100% 42px;
  background-attachment: local;
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  min-height: 100vh;
}

.rp-topbar {
  background: var(--ink);
  color: var(--paper);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Bitter', serif;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.rp-topbar a { color: var(--paper); text-decoration: none; }
.rp-topbar .rp-nav { display: flex; gap: 18px; font-family: 'Inter', sans-serif; font-weight: 500; font-size: 0.92rem; }
.rp-topbar .rp-nav a { opacity: 0.85; }
.rp-topbar .rp-nav a:hover { opacity: 1; text-decoration: underline; }
.rp-topbar .rp-sair { color: var(--gold); }

.rp-wrap { max-width: 720px; margin: 0 auto; padding: 32px 20px 60px; }

.rp-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0 0 6px;
}

h1.rp-title, h2.rp-title {
  font-family: 'Bitter', serif;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 4px;
  line-height: 1.15;
}
h1.rp-title { font-size: 2rem; }
h2.rp-title { font-size: 1.5rem; }

.rp-sub { color: var(--ink-soft); margin: 0 0 28px; font-size: 0.98rem; }

/* Cards */
.rp-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 1px 3px rgba(28,37,65,0.06);
}

/* Login / senha / cadastro */
.rp-auth-wrap { max-width: 400px; margin: 8vh auto; padding: 0 20px; }
.rp-auth-wrap .rp-card::before {
  content: "";
  display: block;
  height: 4px;
  margin: -28px -28px 24px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: repeating-linear-gradient(90deg, var(--gold) 0 10px, transparent 10px 18px);
}
.rp-field { margin-bottom: 18px; }
.rp-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.rp-field input, .rp-field select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1rem;
  background: var(--paper);
  color: var(--ink);
  appearance: none;
  -webkit-appearance: none;
}
.rp-field select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B6480' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 38px;
}
.rp-field input:focus, .rp-field select:focus {
  outline: none;
  border-color: var(--gold-deep);
  background-color: #fff;
}

.rp-btn {
  display: inline-block;
  width: 100%;
  text-align: center;
  padding: 13px 18px;
  border: none;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease;
}
.rp-btn:hover { background: #10182c; }
.rp-btn:active { transform: scale(0.98); }
.rp-btn-gold { background: var(--gold); color: var(--ink); }
.rp-btn-gold:hover { background: var(--gold-deep); }
.rp-btn-outline {
  background: transparent;
  border: 1.5px solid var(--brick);
  color: var(--brick);
  width: auto;
  padding: 8px 16px;
  font-size: 0.85rem;
}
.rp-btn-outline:hover { background: var(--brick); color: #fff; }

.rp-link-back {
  display: block;
  text-align: center;
  margin-top: 16px;
  color: var(--ink-soft);
  font-size: 0.88rem;
  text-decoration: none;
}
.rp-link-back:hover { text-decoration: underline; }

/* Alert / flash */
.rp-alert {
  padding: 12px 16px;
  border-radius: 10px;
  margin: 0 auto 20px;
  font-size: 0.92rem;
  font-weight: 500;
  max-width: 480px;
  text-align: center;
}
.rp-alert-erro { background: #FBE7E2; color: var(--brick); border: 1px solid #EFC3B7; }
.rp-alert-sucesso { background: #E6F0EC; color: var(--teal); border: 1px solid #BFDBD1; }

/* Index cards (lista de filhos) */
.rp-child-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.rp-child-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(28,37,65,0.06);
  display: flex;
  flex-direction: column;
}
.rp-child-tab {
  background: var(--ink);
  color: var(--gold);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
}
.rp-child-body { padding: 16px 18px 20px; flex: 1; display: flex; flex-direction: column; }
.rp-child-name { font-family: 'Bitter', serif; font-weight: 700; font-size: 1.15rem; margin: 0 0 4px; }
.rp-child-turma { color: var(--ink-soft); font-size: 0.88rem; margin: 0 0 16px; }
.rp-child-body .rp-btn { margin-top: auto; }

/* Tela de escolha inicial (logo + cartões) */
.rp-escolha-logo { text-align: center; margin-bottom: 8px; }
.rp-escolha-logo img { max-height: 64px; max-width: 220px; }
.rp-wordmark {
  font-family: 'Bitter', serif;
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.rp-escolha-card {
  display: block;
  background: var(--paper-raised);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 14px;
  text-decoration: none;
  transition: border-color 0.12s ease, transform 0.08s ease;
}
.rp-escolha-card:hover { border-color: var(--ink); transform: translateY(-1px); }
.rp-escolha-card-gold:hover { border-color: var(--gold-deep); }
.rp-escolha-titulo {
  display: block;
  font-family: 'Bitter', serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
  margin-bottom: 4px;
}
.rp-escolha-desc { display: block; color: var(--ink-soft); font-size: 0.88rem; }

/* Calendário de mês (estilo apps de agendamento) */
.rp-cal-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px 8px;
  margin-bottom: 6px;
}
.rp-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 0 4px;
}
.rp-cal-mes {
  font-family: 'Bitter', serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
}
.rp-cal-nav-btn {
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.rp-cal-nav-btn:hover { border-color: var(--gold-deep); }
.rp-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
.rp-cal-head { font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; color: var(--ink-soft); text-align: center; margin-bottom: 8px; }
.rp-cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: var(--ink-soft);
  position: relative;
}
.rp-cal-day.is-empty { visibility: hidden; }
.rp-cal-day.is-today .rp-cal-num { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; }
.rp-cal-day.is-past { opacity: 0.35; }
.rp-cal-day.is-available {
  cursor: pointer;
  color: var(--ink);
  background: #F0ECE0;
  font-weight: 600;
  border: 1.5px solid transparent;
}
.rp-cal-day.is-available:hover { border-color: var(--gold); }
.rp-cal-day.is-available .rp-cal-dot {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  color: var(--teal);
  margin-top: 1px;
}
.rp-cal-day.is-selected {
  background: var(--ink);
  color: var(--paper);
}
.rp-cal-day.is-selected .rp-cal-dot { color: var(--gold); }

@media (max-width: 420px) {
  .rp-cal-day { font-size: 0.8rem; }
}

/* Day-strip calendar (mantido para compatibilidade, não usado na tela de agendar atual) */
.rp-daystrip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 2px 14px;
  scrollbar-width: thin;
}
.rp-day {
  flex: 0 0 auto;
  width: 68px;
  text-align: center;
  padding: 12px 6px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--paper-raised);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.12s ease;
}
.rp-day:hover { border-color: var(--gold); }
.rp-day .rp-day-dow { font-size: 0.68rem; text-transform: uppercase; color: var(--ink-soft); letter-spacing: 0.06em; }
.rp-day .rp-day-num { font-family: 'Bitter', serif; font-weight: 700; font-size: 1.4rem; margin: 2px 0; }
.rp-day .rp-day-dot { font-size: 0.66rem; color: var(--teal); font-family: 'IBM Plex Mono', monospace; }
.rp-day.is-selected {
  border-color: var(--gold-deep);
  border-width: 2px;
  position: relative;
}
.rp-day.is-selected::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 2px solid var(--gold-deep);
  border-radius: 16px;
  transform: rotate(-2deg);
  pointer-events: none;
}

.rp-slots-heading { font-family: 'IBM Plex Mono', monospace; font-size: 0.78rem; color: var(--ink-soft); margin: 22px 0 10px; text-transform: uppercase; letter-spacing: 0.08em; }
.rp-slot-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.rp-slot-pill {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.rp-slot-pill:hover { background: var(--ink); color: var(--paper); }

.rp-empty { color: var(--ink-soft); font-style: italic; padding: 24px 0; text-align: center; }

/* Status badges */
.rp-badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; font-family: 'Inter', sans-serif; }
.rp-badge-pendente { background: #FBF0DC; color: var(--gold-deep); border: 1px solid #EAD3A0; }
.rp-badge-confirmado { background: #E6F0EC; color: var(--teal); border: 1px solid #BFDBD1; }
.rp-badge-cancelado { background: #EFEBE3; color: var(--ink-soft); border: 1px solid var(--line); }

/* Lista de agendamentos */
.rp-agenda-item {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.rp-agenda-date { font-family: 'IBM Plex Mono', monospace; font-weight: 600; color: var(--ink); min-width: 130px; }
.rp-agenda-who { font-family: 'Bitter', serif; font-weight: 700; }
.rp-agenda-meta { color: var(--ink-soft); font-size: 0.86rem; }

@media (max-width: 560px) {
  .rp-wrap { padding: 20px 14px 50px; }
  .rp-agenda-item { flex-wrap: wrap; }
}
