/* Residências da Instável — estilos partilhados (identidade Instável: branco, ardósia, laranja, Archivo). */
:root {
  --bg: #ffffff;
  --ink: #111111;
  --title: #282b3a;       /* ardósia (títulos) */
  --muted: #5d6070;
  --faint: #b9bbc4;
  --line: #dcdde3;
  --soft: #f4f4f6;
  --accent: #f3ab47;      /* laranja Instável */
  --accent-ink: #111111;
  --danger: #c0392b;
  --ok: #282b3a;
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); }
a { color: var(--title); text-decoration-color: var(--accent); text-underline-offset: 3px; }
.wrap { max-width: 860px; margin: 0 auto; padding: 40px 16px 90px; }

/* Cabeçalho */
header.top { margin-bottom: 30px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 26px; }
.bars { display: inline-flex; flex-direction: column; gap: 5px; vertical-align: middle; margin-right: 12px; }
.bars i { display: block; width: 34px; height: 9px; background: var(--accent); }
.org { font-size: 11px; font-weight: 700; letter-spacing: .28em; text-transform: uppercase; color: var(--title); display: flex; align-items: center; }
header.top h1 { margin: 0 0 8px; font-size: clamp(34px, 6.5vw, 54px); line-height: 1.05; font-weight: 800; font-stretch: 125%; color: var(--title); letter-spacing: -.01em; }
header.top .sub { font-size: 20px; font-weight: 700; font-stretch: 112%; margin: 0 0 16px; }
header.top p { margin: 0; max-width: 640px; }
.rules { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 18px 0 0; padding: 0; list-style: none; }
.rules li { font-size: 14px; color: var(--muted); padding-left: 15px; position: relative; }
.rules li::before { content: ""; position: absolute; left: 0; top: 8px; width: 8px; height: 8px; background: var(--accent); }

/* Seletor de idioma (como no site da Instável) */
.lang { display: flex; align-items: center; background: var(--accent); padding: 5px 12px; }
.lang .dot { color: rgba(0,0,0,.35); font-size: 12px; padding: 0 2px; }
.lang button { background: none; border: 0; color: rgba(0,0,0,.45); font: inherit; font-size: 13px; font-weight: 800; letter-spacing: .14em; padding: 2px 4px; cursor: pointer; }
.lang button[aria-pressed="true"] { color: #000; }

/* Secções */
section.step { border-top: 2px solid var(--title); padding: 22px 0 30px; margin-bottom: 10px; }
section.step h2 { margin: 0 0 12px; font-size: 26px; font-weight: 800; font-stretch: 125%; color: var(--title); display: flex; gap: 12px; align-items: baseline; }
.hint { color: var(--muted); font-size: 15px; margin: -2px 0 18px; }

/* Calendário mensal */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.cal-head .month { font-weight: 800; font-stretch: 112%; font-size: 18px; text-align: center; text-transform: capitalize; color: var(--title); }
.iconbtn { border: 1.5px solid var(--title); background: transparent; color: var(--title); width: 40px; height: 40px; font-size: 20px; line-height: 1; cursor: pointer; flex: none; }
.iconbtn:disabled { opacity: .2; cursor: default; }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.dow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; text-align: center; padding-bottom: 2px; }
.day { border: 1.5px solid var(--title); background: transparent; color: var(--title); font: inherit; aspect-ratio: 1.7 / 1; min-height: 44px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.day .dn { font-size: 20px; font-weight: 800; font-stretch: 112%; line-height: 1; }
.day.partial { border-style: dashed; }
.day.full, .day.loading { border-color: var(--line); background: var(--soft); color: var(--faint); cursor: default; }
.day.off { border-color: transparent; color: var(--faint); cursor: default; }
.day.sel { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.day:not([disabled]):not(.sel):hover { background: #fff6e8; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 14px; font-size: 14px; color: var(--muted); }
.legend i { display: inline-block; width: 14px; height: 14px; margin-right: 7px; vertical-align: -2px; border: 1.5px solid var(--title); }
.legend i.p { border-style: dashed; }
.legend i.f { border-color: var(--line); background: var(--soft); }
.legend i.s { background: var(--accent); border-color: var(--accent); }
.counter { font-size: 15px; color: var(--muted); margin-top: 10px; }
.counter b { color: var(--title); }

/* Horários */
.sel-list { display: flex; flex-direction: column; gap: 8px; }
.sel-row { display: grid; grid-template-columns: 1fr auto auto auto 34px; gap: 8px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--accent); }
.sel-row .date { font-weight: 700; }
.sel-row .busy { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.sel-row .hrs { font-size: 13px; color: var(--muted); min-width: 34px; text-align: right; }
.empty { color: var(--muted); font-size: 15px; margin: 0; }

/* Formulário */
select, input, textarea { font: inherit; color: var(--ink); border: 1.5px solid var(--line); border-radius: 0; padding: 10px 11px; background: #fff; width: 100%; }
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--title); }
.sel-row select { width: auto; padding: 6px 8px; }
textarea { min-height: 96px; resize: vertical; }
label { display: block; font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.fields .full { grid-column: 1 / -1; }
.note { font-size: 14px; color: var(--ink); margin: 8px 0 0; padding: 9px 12px; background: #fff6e8; border-left: 4px solid var(--accent); }
.req { color: #d4851c; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--title); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; font: inherit; font-size: 15px; cursor: pointer; }
.xbtn { border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--muted); }

.btn { border: 0; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 800; font-stretch: 112%; padding: 14px 26px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover { filter: brightness(.96); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--title); border: 1.5px solid var(--title); }
.btn.ok { background: var(--accent); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { padding: 8px 15px; font-size: 14px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 18px; }

.msg { padding: 12px 14px; font-size: 14px; margin-top: 12px; border-left: 4px solid; }
.msg.err { background: #fdecea; color: #8e2a20; border-color: var(--danger); }
.msg.info { background: #fff6e8; color: var(--ink); border-color: var(--accent); }
.hidden { display: none !important; }
.done { text-align: center; padding: 40px 0; }
.done h2 { justify-content: center; }

/* Página da equipa */
.req-card { border: 1px solid var(--line); border-left: 4px solid var(--accent); padding: 16px; margin-bottom: 12px; background: #fff; }
.req-card h3 { margin: 0 0 4px; font-size: 18px; font-weight: 800; font-stretch: 112%; color: var(--title); }
.req-card .meta { font-size: 14px; color: var(--muted); margin-bottom: 8px; word-break: break-word; }
.req-card .team { font-size: 14px; white-space: pre-wrap; margin: 6px 0; }
.req-card ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
.warn { color: var(--danger); font-weight: 700; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 2px 8px; border: 1.5px solid var(--title); color: var(--title); margin-left: 8px; vertical-align: 3px; }
.tag.okt { background: var(--accent); border-color: var(--accent); color: #000; }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; align-items: center; }
.tabs button[role="tab"] { border: 1.5px solid var(--title); background: transparent; color: var(--title); padding: 7px 14px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.tabs button[role="tab"][aria-selected="true"] { background: var(--title); color: #fff; }

@media (max-width: 600px) {
  .wrap { padding-top: 24px; }
  .org { letter-spacing: .18em; font-size: 10px; }
  .fields { grid-template-columns: 1fr; }
  .grid { gap: 4px; }
  .day { aspect-ratio: 1 / 1; min-height: 40px; }
  .day .dn { font-size: 16px; }
  .sel-row { grid-template-columns: 1fr auto auto 30px; }
  .sel-row .date { grid-column: 1 / -1; }
  .sel-row .hrs { display: none; }
}
