/* =========================================================================
   Estúdio 28B — Sistema de Design
   Extraído do design original (Estudio28B App Layouts). Base reutilizável
   para o protótipo e, mais tarde, para a app PHP real.
   ========================================================================= */

/* ---------- Tokens ---------- */
:root {
  /* Cores base */
  --bg:        #F7F2EA;   /* fundo creme */
  --ink:       #2A231C;   /* texto principal */
  --muted:     #8A7F72;   /* texto secundário */
  --faint:     #B7ADA0;   /* texto ténue / placeholders */
  --line:      #E7DFD2;   /* linhas e contornos */
  --card:      #FFFFFF;   /* cartões */

  /* Cores de ação / estado */
  --terra:      #B98470;  /* ação principal (terracota) */
  --terra-dark: #6E463C;  /* terracota escuro (hover / legendas) */
  --terra-link: #8B5C50;  /* links */
  --green:      #8FA382;  /* sucesso / disponível */
  --green-ink:  #5F7A54;  /* texto verde escuro */
  --gold:       #C9A15B;  /* dourado / aviso suave */
  --gold-ink:   #A9832F;  /* texto dourado escuro */
  --coral:      #C77B6C;  /* erro / falta / cancelar */
  --coral-ink:  #B4685A;  /* texto coral escuro */

  /* Tons de fundo suaves */
  --tint-terra: #FBF1EC;
  --tint-green: #EAF0E6;
  --tint-coral: #F6E9E5;
  --tint-gold:  #FBF1E4;
  --track:      #EEE7D9;  /* fundo de barras de progresso */
  --card-soft:  #FBF8F3;  /* cartão de fundo (histórico) */

  /* Cores por tipo de aula */
  --aula-pilates: #B98470;
  --aula-barre:   #8FA382;
  --aula-ballet:  #C9A15B;

  /* Formas */
  --r-card: 18px;
  --r-btn:  14px;
  --r-pill: 100px;
  --r-input:14px;

  /* Sombras */
  --shadow-card: 0 4px 16px rgba(42,35,28,0.06);
  --shadow-card-lg: 0 4px 20px rgba(42,35,28,0.06);
  --shadow-btn:  0 10px 24px rgba(185,132,112,0.35);
  --shadow-icon: 0 8px 24px rgba(42,35,28,0.16);

  /* Tipos de letra */
  --serif: 'Newsreader', Georgia, serif;
  --sans:  'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Barra de navegação */
  --nav-h: 68px;
}

/* ---------- Reset leve ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--terra-link); text-decoration: none; }
a:hover { color: var(--terra-dark); }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* Esconde a scrollbar (como no design) mantendo o scroll */
::-webkit-scrollbar { width: 0; height: 0; }
* { scrollbar-width: none; }

/* =========================================================================
   Contentor de ecrã (mobile first)
   No telemóvel enche o ecrã; no desktop centra numa coluna estreita.
   ========================================================================= */
.screen {
  position: relative;
  width: 100%;
  max-width: 420px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  /* safe-area para o topo (notch) */
  padding-top: env(safe-area-inset-top, 0px);
}
/* No desktop, dá contraste à volta da coluna do telemóvel */
@media (min-width: 480px) {
  body.centrado { background: #ECE3D6; padding: 32px 0; }
  body.centrado .screen {
    min-height: calc(100vh - 64px);
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(42,35,28,0.18);
  }
}

.screen__scroll {
  flex: 1;
  overflow-y: auto;
  padding: 22px 24px 24px;
}
/* Deixa espaço para a barra inferior quando existe */
.screen--has-nav .screen__scroll { padding-bottom: calc(var(--nav-h) + 24px); }

/* ---------- Cabeçalhos ---------- */
.h-serif   { font-family: var(--serif); font-weight: 500; color: var(--ink); }
.title     { font-family: var(--serif); font-weight: 500; font-size: 26px; color: var(--ink); }
.title-lg  { font-family: var(--serif); font-weight: 500; font-size: 30px; color: var(--ink); }
.eyebrow   { font-size: 13px; color: var(--muted); }
.subtitle  { font-size: 15px; color: var(--muted); }
.section-label {
  font-size: 12px; color: var(--faint);
  text-transform: uppercase; letter-spacing: 0.06em;
}

.app-topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 4px;
}

/* ---------- Botões ---------- */
.btn {
  display: flex; align-items: center; justify-content: center;
  height: 54px; border-radius: var(--r-btn);
  font-size: 16px; font-weight: 600; border: none; cursor: pointer;
  width: 100%; text-align: center;
}
.btn--primary { background: var(--terra); color: #fff; box-shadow: var(--shadow-btn); }
.btn--dark    { background: var(--ink);   color: #fff; }
.btn--ghost   { background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn-hint { text-align: center; font-size: 12px; color: var(--faint); margin-top: 10px; }

/* Botão redondo "+" (criar) */
.fab-square {
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 300; cursor: pointer;
}

/* ---------- Cartões ---------- */
.card {
  background: var(--card); border-radius: var(--r-card);
  padding: 16px 18px; box-shadow: var(--shadow-card);
}
.card--lg { border-radius: 20px; padding: 20px; box-shadow: var(--shadow-card-lg); }
.card--soft { background: var(--card-soft); box-shadow: none; border: 1px solid #EFE6D8; }

/* ---------- Inputs ---------- */
.field { display: block; }
.field__label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.input {
  width: 100%; height: 52px; border-radius: var(--r-input);
  background: #fff; border: 1px solid var(--line);
  padding: 0 18px; font-size: 15px; color: var(--ink);
  display: flex; align-items: center;
}
.input::placeholder { color: var(--faint); }
.input--placeholder { color: var(--faint); }   /* para divs a fingir input */
.input--select { justify-content: space-between; }
.input--sm { height: 50px; }
.search {
  height: 44px; border-radius: var(--r-pill);
  background: #fff; border: 1px solid var(--line);
  padding: 0 18px; font-size: 14px; color: var(--faint);
  display: flex; align-items: center;
}

/* ---------- Pills / etiquetas de estado ---------- */
.pill {
  display: inline-flex; align-items: center;
  padding: 9px 18px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 600;
}
.pill--active { background: var(--ink); color: #fff; }
.pill--inactive { background: #fff; color: var(--muted); border: 1px solid var(--line); }

.tag {
  display: inline-flex; align-items: center;
  padding: 5px 11px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 600;
}
.tag--ok    { background: var(--tint-green); color: var(--green-ink); }
.tag--wait  { background: var(--tint-gold);  color: var(--gold-ink); }
.tag--alert { background: var(--tint-coral); color: var(--coral-ink); }

/* ---------- Tira de dias da semana ---------- */
.day-strip { display: flex; gap: 8px; }
.day {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 0; border-radius: 16px; background: #fff;
}
.day__label { font-size: 11px; color: var(--muted); }
.day__num   { font-size: 16px; font-weight: 600; color: var(--ink); }
.day--active { background: var(--ink); box-shadow: 0 4px 12px rgba(42,35,28,0.25); }
.day--active .day__label { color: #C9BBA6; }
.day--active .day__num   { color: #fff; }
.day--off .day__label, .day--off .day__num { color: var(--faint); }

/* ---------- Linha de aula ---------- */
.class-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border-radius: var(--r-card);
  padding: 16px 18px; box-shadow: var(--shadow-card);
  cursor: pointer; text-align: left; width: 100%; border: none;
}
.class-row__bar { width: 6px; align-self: stretch; border-radius: 4px; }
.class-row__body { flex: 1; }
.class-row__title { font-size: 15px; font-weight: 600; color: var(--ink); }
.class-row__sub   { font-size: 13px; color: var(--muted); margin-top: 2px; }
.class-row__meta  { text-align: right; }

/* cores por tipo (aplicar à .class-row__bar) */
.is-pilates { background: var(--aula-pilates); }
.is-barre   { background: var(--aula-barre); }
.is-ballet  { background: var(--aula-ballet); }

/* ---------- Barra de progresso ---------- */
.progress { height: 8px; border-radius: 8px; background: var(--track); overflow: hidden; }
.progress__fill { height: 100%; border-radius: 8px; background: var(--green); }

/* Anel de progresso (usa conic-gradient inline no style) */
.ring { width: 74px; height: 74px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ring__inner { width: 56px; height: 56px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 600; color: var(--ink); }

/* ---------- Avatares (placeholder listrado, como no design) ---------- */
.avatar {
  border-radius: 50%; flex-shrink: 0;
  background: repeating-linear-gradient(135deg,#EFE6D8,#EFE6D8 5px,#E7DFD2 5px,#E7DFD2 10px);
}
.avatar--lg { width: 64px; height: 64px; }
.avatar--md { width: 38px; height: 38px; }

/* ---------- Toggle (interruptor) ---------- */
.toggle { width: 44px; height: 26px; border-radius: var(--r-pill); background: var(--green); display: flex; align-items: center; padding: 3px; }
.toggle__dot { width: 20px; height: 20px; border-radius: 50%; background: #fff; margin-left: auto; }
.toggle--off { background: var(--line); }
.toggle--off .toggle__dot { margin-left: 0; }

/* ---------- Botões de presença (✓ / ✕) ---------- */
.att-btns { display: flex; gap: 6px; }
.att-btn { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; cursor: pointer; border: none; }
.att-btn--yes { background: var(--tint-green); color: var(--green-ink); }
.att-btn--no  { background: var(--tint-coral); color: var(--coral-ink); font-size: 14px; }

/* ---------- Ícone da app ---------- */
.app-icon { border-radius: 16px; object-fit: cover; box-shadow: var(--shadow-icon); }
.app-icon--sm { width: 52px; height: 52px; border-radius: 12px; box-shadow: none; }

/* =========================================================================
   Barra de navegação inferior
   (adição de prototipagem — não fazia parte do design estático)
   ========================================================================= */
.bottom-nav {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: var(--nav-h);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 11px; color: var(--muted); flex: 1; padding: 6px 0;
}
.nav-item__icon { font-size: 20px; line-height: 1; }
.nav-item--active { color: var(--terra); font-weight: 600; }

/* ---------- Utilitários ---------- */
.mt-auto { margin-top: auto; }
.pad-x { padding-left: 24px; padding-right: 24px; }
.stack { display: flex; flex-direction: column; }
.gap-14 { gap: 14px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.flex-1 { flex: 1; }
.text-right { text-align: right; }
