/* Styles Cloee — d'après les maquettes, mobile d'abord. Couleurs/polices : tokens.css uniquement. */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.45;
  font-variant-numeric: lining-nums;
}

h1,
h2,
h3 {
  font-family: var(--font-title);
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1.05;
  margin: 0;
}

h1 {
  font-size: 40px;
}

h2 {
  font-size: 30px;
}

h3 {
  font-size: 22px;
}

p {
  margin: 0;
}

a {
  color: var(--text);
}

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

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.icon {
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.muted {
  color: var(--text-muted);
  font-size: 15px;
}

.eyebrow {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}

/* Structure : en-tête, contenu, barre d'onglets */

.app-header {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand img {
  display: block;
  height: 36px;
  width: auto;
  border-radius: 9px;
}

.brand span {
  font-size: 15px;
  color: var(--text-muted);
}

.app-main {
  max-width: 560px;
  margin: 0 auto;
  padding: 18px 16px 120px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.app-main:focus {
  outline: none;
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}

.tabbar__inner {
  display: flex;
  width: 100%;
  max-width: 560px;
}

.tab {
  flex: 1;
  min-height: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.tab[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

.tab[aria-current="page"] .icon {
  stroke-width: 2.1;
}

.tab__icon {
  position: relative;
  display: flex;
}

.tab__badge {
  position: absolute;
  top: -6px;
  right: -12px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: var(--on-primary);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px var(--accent);
}

/* Titres de page et retour */

.page-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.back {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  margin-left: -10px;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  align-self: flex-start;
}

/* Boutons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: var(--on-primary);
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn--outline {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1.5px var(--primary);
}

.btn--small {
  min-height: 44px;
  padding: 0 16px;
  font-size: 15px;
}

.btn--block {
  width: 100%;
}

.btn--link {
  min-height: 44px;
  padding: 0 4px;
  background: transparent;
  color: var(--text);
  text-decoration: underline;
  font-weight: 600;
}

.btn:disabled {
  background: var(--tint);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
}

.btn-row {
  display: flex;
  gap: 10px;
}

.btn-row > * {
  flex: 1;
}

.link-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* Cartes, lignes, blocs */

.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card--flush {
  padding: 0;
  gap: 0;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.row + .row {
  border-top: 1px solid var(--border);
}

.row__main {
  flex: 1;
  min-width: 0;
}

.row__title {
  font-size: 17px;
  font-weight: 600;
}

.divider {
  height: 1px;
  background: var(--border);
}

.block {
  background: var(--tint);
  border-radius: var(--radius-block);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.summary {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 4px 16px;
}

.summary__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}

.summary__row + .summary__row {
  border-top: 1px solid var(--border);
}

.summary__label {
  width: 84px;
  flex-shrink: 0;
  font-size: 15px;
  color: var(--text-muted);
}

.summary__value {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
}

.note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 15px;
  color: var(--text-muted);
}

.quote {
  font-style: italic;
  color: var(--text-muted);
}

/* Avatars et choix */

.avatar {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--tint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-size: 23px;
  font-weight: 500;
  color: var(--text);
}

.avatar--surface {
  background: var(--surface);
}

.avatar--small {
  width: 30px;
  height: 30px;
  font-size: 16px;
  box-shadow: 0 0 0 2px var(--surface);
}

.avatars {
  display: flex;
}

.avatars .avatar + .avatar {
  margin-left: -8px;
}

.choices {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dog-choice {
  flex: 1;
  min-width: 96px;
  border: 0;
  border-radius: 14px;
  padding: 10px 6px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
}

.dog-choice[aria-pressed="true"] {
  background: var(--tint);
  box-shadow: inset 0 0 0 1.5px var(--primary);
  font-weight: 600;
}

.segmented {
  flex: 1;
  min-height: 46px;
  border: 0;
  border-radius: var(--radius-chip);
  background: var(--bg);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.segmented[aria-pressed="true"] {
  background: var(--primary);
  color: var(--on-primary);
}

/* Réservation : étapes */

.step-title {
  font-size: 29px;
}

.step-title--future {
  opacity: 0.45;
}

.step-done {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Grille jours × créneaux (docs/planity.png) */

.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.week-nav__title {
  flex: 1;
  text-align: center;
  font-weight: 600;
}

.icon-btn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.days {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(84px, 1fr);
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
}

.day {
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.day__head {
  text-align: center;
  padding-bottom: 4px;
}

.day__weekday {
  display: block;
  font-size: 15px;
}

.day__date {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
}

.slot {
  min-height: 44px;
  border: 0;
  border-radius: var(--radius-slot);
  background: var(--tint-soft);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px;
}

.slot small {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}

.slot[aria-pressed="true"] {
  background: var(--primary);
  color: var(--on-primary);
}

.slot[aria-pressed="true"] small {
  color: var(--on-primary);
}

.slot:disabled {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--border);
  color: var(--text-muted);
  text-decoration: line-through;
  cursor: not-allowed;
}

/* Planning responsable : un créneau ouvert est plein, un fermé est en pointillés. */

.slot--open {
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--primary);
}

.slot--closed {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--border);
  color: var(--text-muted);
}

.slot--booked {
  background: var(--tint);
}

.slot--open[aria-pressed="true"],
.slot--closed[aria-pressed="true"] {
  color: var(--text);
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.slot--open[aria-pressed="true"] {
  background: var(--surface);
}

.slot--closed[aria-pressed="true"] {
  background: transparent;
}

.slot--open[aria-pressed="true"] small,
.slot--closed[aria-pressed="true"] small {
  color: var(--text-muted);
}

/* Bandeau de jours (agenda) */

.day-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.day-chip {
  min-width: 46px;
  min-height: 58px;
  border-radius: var(--radius-chip);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 13px;
  background: var(--surface);
}

.day-chip strong {
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
}

.day-chip[aria-current="date"] {
  background: var(--primary);
  color: var(--on-primary);
}

/* Agenda : créneaux du jour */

.agenda-slot {
  display: flex;
  gap: 12px;
}

.agenda-slot__time {
  width: 64px;
  flex-shrink: 0;
  padding-top: 14px;
}

.agenda-slot__time strong {
  display: block;
  font-size: 16px;
}

.agenda-slot .card {
  flex: 1;
}

/* Mes rendez-vous */

.rdv {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.date-block {
  width: 56px;
  flex-shrink: 0;
  border-radius: var(--radius-chip);
  background: var(--tint);
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 13px;
}

.date-block strong {
  font-family: var(--font-title);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.05;
}

/* Statuts */

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}

.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status--pending::before {
  background: var(--accent);
}

.status--confirmed::before {
  background: var(--primary);
}

.status--refused,
.status--expired,
.status--cancelled_by_client,
.status--cancelled_by_admin {
  color: var(--text-muted);
}

/* Formulaires */

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 15px;
  font-weight: 600;
}

.field input,
.field textarea {
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-chip);
  background: var(--surface);
  font-size: 17px;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 1px var(--primary);
}

.field[aria-invalid="true"] input,
.field[aria-invalid="true"] textarea {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.field__hint {
  font-size: 14px;
  color: var(--text-muted);
}

.field__error {
  font-size: 15px;
  font-weight: 600;
}

/* Messages */

.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border-radius: var(--radius-chip);
  padding: 12px 14px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
  font-size: 16px;
}

.alert::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-top: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--primary);
}

.alert--error {
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

.alert--error::before {
  background: var(--accent);
}

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 20;
  max-width: 528px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-card);
  background: var(--primary);
  color: var(--on-primary);
}

.toast .btn--link {
  color: var(--on-primary);
}

/* Connexion */

.login {
  max-width: 420px;
  margin: 24px auto 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}

.login__logo {
  width: 100%;
  border-radius: var(--radius-block);
}

.login__google {
  display: flex;
  justify-content: center;
  min-height: 48px;
}

@media (min-width: 768px) {
  h1 {
    font-size: 48px;
  }

  .days {
    grid-auto-columns: 1fr;
    overflow-x: visible;
  }
}

/* Mises en page utilitaires */

.stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.inline--between {
  justify-content: space-between;
}

.hero-logo {
  width: 160px;
  border-radius: var(--radius-card);
}

a.card,
a.row {
  text-decoration: none;
}

.stack--tight {
  gap: 8px;
}

.day-strip--grow {
  flex: 1;
}

.card.rdv {
  flex-direction: row;
}

.days.card {
  display: grid;
}

.card.step-done {
  flex-direction: row;
}
