:root {
  color-scheme: light;
  --orange: #ff7a00;
  --navy: #0b1f3a;
  --teal: #00a89c;
  --amber: #ffb347;
  --paper: #fffaf5;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(150deg, var(--white), var(--paper));
  color: var(--navy);
  font: 16px/1.65 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

header,
main,
footer {
  width: min(860px, calc(100% - 40px));
  margin-inline: auto;
}

header {
  padding: 44px 0 20px;
}

.brand {
  color: var(--navy);
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.brand::before {
  display: inline-block;
  width: 0.8rem;
  height: 0.8rem;
  margin-right: 0.55rem;
  border-radius: 50%;
  background: var(--orange);
  content: "";
}

main {
  min-height: 65vh;
  padding: 28px 0 64px;
}

h1,
h2 {
  line-height: 1.25;
}

h1 {
  margin-top: 0;
  font-size: clamp(2rem, 6vw, 3.35rem);
}

h2 {
  margin-top: 2.2rem;
  font-size: 1.3rem;
}

a {
  color: #006f68;
}

.lead {
  max-width: 680px;
  font-size: 1.12rem;
}

.card {
  margin: 20px 0;
  padding: 22px;
  border: 1px solid rgb(11 31 58 / 12%);
  border-radius: 18px;
  background: var(--white);
  box-shadow: 0 12px 36px rgb(11 31 58 / 7%);
}

.button {
  display: inline-block;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--orange);
  color: #111111;
  font-weight: 750;
  text-decoration: none;
}

.muted {
  color: #526176;
}

form {
  display: grid;
  gap: 10px;
}

label {
  margin-top: 4px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgb(11 31 58 / 28%);
  border-radius: 6px;
  background: var(--white);
  color: var(--navy);
  font: inherit;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  outline: 3px solid rgb(0 168 156 / 18%);
}

button.button {
  justify-self: start;
  margin-top: 8px;
  border: 0;
  cursor: pointer;
}

.support-note {
  margin-top: 18px;
}

footer {
  padding: 24px 0 42px;
  border-top: 1px solid rgb(11 31 58 / 12%);
  font-size: 0.92rem;
}

footer a {
  margin-left: 18px;
}

ul {
  padding-left: 1.3rem;
}

@media (max-width: 520px) {
  header,
  main,
  footer {
    width: min(100% - 28px, 860px);
  }
}

/* Tableau de bord d'usage */
body.dashboard-page {
  background:
    radial-gradient(circle at 8% 0%, rgb(255 179 71 / 22%), transparent 29rem),
    linear-gradient(150deg, #f9fbff, var(--paper));
}

.dashboard-page header,
.dashboard-page main,
.dashboard-page footer {
  width: min(1180px, calc(100% - 40px));
}

.dashboard-page header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-page main {
  padding-top: 18px;
}

.dashboard-page h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 5vw, 3rem);
}

.dashboard-topline,
.dashboard-actions,
.dashboard-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.button.button-secondary {
  border: 1px solid rgb(11 31 58 / 18%);
  background: var(--white);
  color: var(--navy);
}

.button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.dashboard-login {
  max-width: 430px;
  margin: 40px auto;
}

.dashboard-login h2 {
  margin-top: 0;
}

.dashboard-login .button {
  justify-self: stretch;
}

.dashboard-error {
  margin: 14px 0 0;
  color: #a32424;
  font-weight: 650;
}

.dashboard-panel[hidden],
.dashboard-login[hidden],
.dashboard-error[hidden] {
  display: none;
}

.dashboard-meta {
  margin: 0;
  color: #526176;
}

.period-picker {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid rgb(11 31 58 / 14%);
  border-radius: 999px;
  background: var(--white);
}

.period-picker button {
  padding: 9px 13px;
  border: 0;
  border-right: 1px solid rgb(11 31 58 / 10%);
  background: transparent;
  color: var(--navy);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.period-picker button:last-child {
  border-right: 0;
}

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

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin: 26px 0;
}

.metric-card {
  min-height: 174px;
  margin: 0;
  padding: 20px;
  border: 1px solid rgb(11 31 58 / 10%);
  border-radius: 18px;
  background: rgb(255 255 255 / 92%);
  box-shadow: 0 12px 30px rgb(11 31 58 / 6%);
}

.metric-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: rgb(255 122 0 / 13%);
  color: var(--orange);
  font-size: 1.1rem;
}

.metric-card:nth-child(2) .metric-icon,
.metric-card:nth-child(5) .metric-icon {
  background: rgb(0 168 156 / 13%);
  color: #007d75;
}

.metric-value {
  display: block;
  margin-top: 20px;
  color: var(--navy);
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.metric-label {
  display: block;
  margin-top: 10px;
  color: #526176;
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.35;
}

.chart-card {
  margin-top: 10px;
  padding: 24px;
}

.chart-card h2 {
  margin: 0;
}

.chart-subtitle {
  margin: 5px 0 22px;
  color: #526176;
}

.usage-chart {
  display: flex;
  height: 220px;
  align-items: end;
  gap: clamp(3px, 0.7vw, 9px);
  padding-top: 10px;
  border-bottom: 1px solid rgb(11 31 58 / 14%);
}

.usage-bar {
  position: relative;
  min-width: 5px;
  flex: 1;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, var(--teal), #4cc9bd);
}

.usage-bar:hover::after {
  position: absolute;
  z-index: 1;
  bottom: calc(100% + 7px);
  left: 50%;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--navy);
  color: var(--white);
  content: attr(data-label);
  font-size: 0.72rem;
  font-weight: 700;
  transform: translateX(-50%);
  white-space: nowrap;
}

.chart-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: #69758a;
  font-size: 0.78rem;
}

.dashboard-note {
  margin-top: 22px;
  color: #526176;
  font-size: 0.9rem;
}

@media (max-width: 980px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .dashboard-page header,
  .dashboard-page main,
  .dashboard-page footer {
    width: min(100% - 28px, 1180px);
  }

  .dashboard-page header,
  .dashboard-topline,
  .dashboard-summary {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .metric-card:last-child {
    grid-column: span 2;
  }
}
