/* Agenda Ordinum. Layout do portfolio.html do ordinum-website: identidade no
   painel azul à esquerda, conteúdo no trilho claro à direita, e o disco claro
   mordendo o azul. Tokens da matriz_visual_ordinum.md. */
:root {
  --color-navy: #0c204a;
  --color-navy-light: #1a3a6e;
  --color-navy-alpha: rgba(12, 32, 74, 0.08);
  --color-graphite: #2d2d2d;
  --color-gray-600: #4a4a4a;
  --color-gray-400: #8a8a8a;
  --color-gray-200: #e5e5e5;
  --color-gray-100: #f5f5f5;
  --color-gray-50: #fafafa;
  --color-white: #ffffff;
  --color-error: #a3262b;
  --color-error-soft: #ffb9b9;
  --color-blue: #1a4fa0;
  --color-blue-bright: #2d7ae0;
  --color-blue-alpha: rgba(45, 122, 224, 0.12);
  /* O trecho claro do gradiente do painel, para os destaques do trilho. */
  --gradient-light: linear-gradient(135deg, #1a4fa0 0%, #2d7ae0 100%);

  --font-main: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius-card: 8px;
  --radius-btn: 6px;
  --shadow-sm: 0 1px 3px rgba(12, 32, 74, 0.06);
  --shadow-md: 0 4px 16px rgba(12, 32, 74, 0.08);
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --aside-track: 38%;
  --aside-min: 420px;
  --aside-inner-max: 400px;
  --rail-max: 880px;
  --arc-bite: clamp(64px, 6.2vw, 116px);
  --arc-span: 1000px;
  --pad-y: clamp(24px, 3.6vh, 52px);
  --pad-x: clamp(32px, 4.2vw, 80px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-gray-50);
  color: var(--color-graphite);
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--color-navy-light);
  outline-offset: 2px;
}

svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.section-tag {
  display: block;
  margin-bottom: 4px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-navy);
}

/* Split ------------------------------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: minmax(var(--aside-min), var(--aside-track)) 1fr;
  min-height: 100vh;
}

.aside {
  position: relative;
  z-index: 0;
  overflow: hidden;
  overflow: clip;
  background: linear-gradient(162deg, #071d42 0%, #0a2a5e 36%, #1a4fa0 76%, #2d7ae0 100%);
  color: var(--color-white);
}

/* Brilho frio no alto do campo azul. */
.aside::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 60% at 22% 8%, rgba(120, 180, 255, 0.18), transparent 62%);
  pointer-events: none;
}

/* O disco claro deitado, nascendo da direita e curvando sobre o azul. */
.aside::after {
  content: "";
  position: absolute;
  top: -50%;
  left: calc(100% - var(--arc-bite));
  width: var(--arc-span);
  height: 200%;
  border-radius: 50%;
  background: var(--color-gray-50);
  z-index: 0;
}

.aside-inner {
  position: sticky;
  top: 0;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: var(--pad-y) calc(var(--arc-bite) + 20px) var(--pad-y) var(--pad-x);
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  max-width: var(--aside-inner-max);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 34px;
  height: 21px;
}

.brand-mark-ring {
  fill: #0a2a5e;
}

.brand-name {
  font-size: 15px;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
}

/* Identidade compacta: foto e nome lado a lado. */
.identity {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: var(--aside-inner-max);
  margin-top: clamp(28px, 6vh, 64px);
}

.portrait {
  flex: none;
  width: 64px;
  height: 64px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(3, 12, 32, 0.34);
}

.portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Aproxima o rosto, que no enquadramento cheio fica no terço superior. */
  transform: scale(1.4) translateY(9%);
}

.identity-text {
  min-width: 0;
}

.eyebrow {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.name {
  font-size: 26px;
  font-weight: 300;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.lead {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.72);
}

/* Dados de quem agenda, no próprio painel azul. */
.details {
  display: grid;
  gap: clamp(12px, 1.9vh, 18px);
  max-width: var(--aside-inner-max);
  margin-top: clamp(20px, 3.6vh, 40px);
  padding-top: clamp(18px, 3vh, 30px);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.group {
  display: grid;
  gap: 7px;
}

.label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.tag {
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 9.5px;
  letter-spacing: 1.2px;
  color: rgba(255, 255, 255, 0.7);
}

.input {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-btn);
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-white);
  font-size: 15px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.input:focus,
.chips:focus-within {
  outline: none;
  border-color: rgba(255, 255, 255, 0.64);
  background: rgba(255, 255, 255, 0.12);
}

.input[aria-invalid="true"],
.chips.is-invalid {
  border-color: var(--color-error-soft);
}

.segmented {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  justify-self: start;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.seg {
  position: relative;
  z-index: 1;
  min-width: 84px;
  padding: 8px 20px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease, color 0.3s ease;
}

.seg:hover {
  color: var(--color-white);
}

.seg[aria-pressed="true"] {
  background: var(--color-white);
  color: var(--color-navy);
}

/* Com o script no ar, quem desenha o fundo branco é a pílula que desliza: ela
   estica cobrindo o caminho entre as opções e depois encolhe no destino. */
.segmented.is-live .seg[aria-pressed="true"] {
  background: transparent;
}

.seg-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  z-index: 0;
  width: var(--seg-w, 0);
  border-radius: 999px;
  background: var(--color-white);
  box-shadow: 0 2px 10px rgba(3, 12, 32, 0.28);
  transform: translateX(var(--seg-x, 0));
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.segmented.no-anim .seg-indicator {
  transition: none;
}

.seg:active {
  transform: scale(0.97);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  cursor: text;
}

.chips input {
  flex: 1;
  min-width: 150px;
  padding: 4px 6px;
  border: 0;
  background: transparent;
  color: var(--color-white);
  font-size: 15px;
}

.chips input:focus {
  outline: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  padding: 3px 4px 3px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.chip-x {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 16px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.72);
}

.chip-x:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--color-white);
}

.hint {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.5);
}

.hint.is-error {
  color: var(--color-error-soft);
}

.trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Trilho ------------------------------------------------------------------ */

.rail {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  padding: var(--pad-y) var(--pad-x);
  background: var(--color-gray-50);
}

.rail-inner {
  width: 100%;
  max-width: var(--rail-max);
  margin: 0 auto;
}

.step {
  animation: enter 0.4s var(--ease) both;
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.rail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 18px;
}

.rail-title {
  font-size: clamp(20px, 2.5vh, 26px);
  font-weight: 300;
  line-height: 1.25;
  color: var(--color-graphite);
}

.month-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.month-label {
  min-width: 132px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--color-navy);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--color-gray-200);
  border-radius: 50%;
  background: var(--color-white);
  color: var(--color-navy);
  transition: border-color 0.2s ease;
}

.icon-btn:hover:not(:disabled) {
  border-color: var(--color-navy);
}

.icon-btn:disabled {
  color: var(--color-gray-200);
  cursor: default;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

/* Calendário e horários lado a lado, os dois em cartão, sem rolagem interna.
   Os cartões têm sempre a mesma altura: o calendário estica e as semanas se
   distribuem no espaço. */
.picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 300px);
  gap: 16px;
  align-items: stretch;
}

.card {
  padding: 16px;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-card);
  background: var(--color-white);
  box-shadow: var(--shadow-sm);
}

.calendar {
  display: flex;
  flex-direction: column;
}

.weekdays,
.days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.days {
  flex: 1;
  grid-auto-rows: 1fr;
  align-items: center;
}

.weekdays {
  margin-bottom: 6px;
}

.weekdays span {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--color-gray-400);
}

.day {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 44px;
  aspect-ratio: 1;
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 14px;
  color: #b3b3b3;
  transition: background 0.2s ease, color 0.2s ease;
}

.day:disabled {
  cursor: default;
}

.day.is-open {
  background: var(--color-blue-alpha);
  color: var(--color-blue);
  font-weight: 600;
}

.day.is-open:hover {
  background: rgba(45, 122, 224, 0.22);
}

.day.is-selected,
.day.is-selected:hover {
  background: var(--gradient-light);
  color: var(--color-white);
  box-shadow: 0 4px 12px rgba(26, 79, 160, 0.28);
}

.day.is-today::after {
  content: "";
  position: absolute;
  bottom: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.times h3 {
  margin-bottom: 12px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--color-navy);
}

.time-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.time-list:empty {
  display: none;
}

.slot {
  height: 34px;
  padding: 0;
  border: 1px solid rgba(26, 79, 160, 0.24);
  border-radius: var(--radius-btn);
  background: var(--color-white);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-navy);
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.slot:hover {
  border-color: var(--color-blue-bright);
  color: var(--color-blue);
}

.slot.is-selected,
.slot.is-selected:hover {
  border-color: transparent;
  background: var(--gradient-light);
  color: var(--color-white);
}

.status {
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-gray-600);
}

.status:empty {
  display: none;
}

/* Barra de confirmação, no tom da linha de destaque do portfolio. */
.confirm {
  position: sticky;
  bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-top: 16px;
  padding: 12px 12px 12px 20px;
  border-radius: var(--radius-card);
  background: var(--gradient-light);
  color: var(--color-white);
  box-shadow: 0 8px 24px rgba(26, 79, 160, 0.28);
  animation: enter 0.4s var(--ease) both;
}

.confirm-text {
  display: grid;
  gap: 1px;
}

.confirm-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.confirm-text strong {
  font-size: 14.5px;
  font-weight: 500;
}

.confirm-btn,
.primary {
  padding: 10px 24px;
  border: 0;
  border-radius: var(--radius-btn);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.2s ease;
}

.confirm-btn {
  background: var(--color-white);
  color: var(--color-blue);
}

.confirm-btn:hover:not(:disabled) {
  background: var(--color-gray-100);
}

.confirm-btn:disabled {
  opacity: 0.7;
  cursor: progress;
}

.primary {
  display: inline-block;
  background: var(--color-navy);
  color: var(--color-white);
}

.primary:hover {
  background: var(--color-navy-light);
}

.form-error {
  margin-top: 12px;
  font-size: 13.5px;
  color: var(--color-error);
}

/* Confirmação ------------------------------------------------------------- */

.step-done {
  max-width: 560px;
}

.done-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 22px;
  border-radius: 50%;
  background: var(--gradient-light);
  color: var(--color-white);
}

.done-mark svg {
  width: 24px;
  height: 24px;
}

.done-text {
  margin: 8px 0 22px;
  font-size: 15px;
  color: var(--color-gray-600);
}

.summary {
  display: grid;
  margin: 0;
  border-top: 1px solid var(--color-gray-200);
}

.summary-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 16px;
  align-items: baseline;
  padding: 13px 0;
  border-bottom: 1px solid var(--color-gray-200);
}

.summary dt {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--color-gray-400);
}

.summary dd {
  display: grid;
  gap: 2px;
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-navy);
  overflow-wrap: anywhere;
}

.summary a {
  color: var(--color-navy-light);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ghost {
  margin-top: 22px;
  padding: 10px 22px;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-btn);
  background: var(--color-white);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-navy);
}

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

/* Página de erro ---------------------------------------------------------- */

.plain {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px 16px;
}

.plain-box {
  display: grid;
  justify-items: center;
  gap: 16px;
  text-align: center;
}

.plain-box h1 {
  font-size: 28px;
  font-weight: 300;
  color: var(--color-navy);
}

/* Telas médias: horários descem para baixo do calendário. */

@media (max-width: 1180px) {
  .picker {
    grid-template-columns: minmax(0, 1fr);
  }

  .time-list {
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  }
}

/* Telas menores: o split vira pilha e o disco nasce da base, como no portfolio. */

@media (max-width: 1000px) {
  :root {
    --pad-x: 32px;
  }

  .split {
    grid-template-columns: minmax(0, 1fr);
  }

  .aside {
    overflow: hidden;
  }

  .aside::after {
    top: auto;
    bottom: -1330px;
    left: 50%;
    width: 240vw;
    height: 1400px;
    transform: translateX(-50%);
  }

  .aside-inner {
    position: static;
    min-height: 0;
    align-items: center;
    padding: 24px var(--pad-x) 96px;
  }

  .topbar {
    width: 100%;
    max-width: none;
  }

  .identity,
  .details {
    width: 100%;
    max-width: 520px;
  }

  .identity {
    margin-top: 28px;
  }

  .rail {
    padding: 8px var(--pad-x) 48px;
  }
}

@media (max-width: 560px) {
  :root {
    --pad-x: 16px;
  }

  .topbar {
    justify-content: center;
  }

  .segmented {
    justify-self: stretch;
  }

  .seg {
    flex: 1;
  }

  .card {
    padding: 12px 8px;
  }

  .times {
    padding: 14px 12px;
  }

  .month-label {
    min-width: 116px;
  }

  .confirm {
    padding-left: 16px;
  }

  .confirm-btn {
    width: 100%;
  }

  .summary-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .step,
  .confirm {
    animation: none;
  }

  * {
    transition: none !important;
  }
}
