/* Auth pages — Sports Équilibre
   Palette: noir/blanc dominant + accent bleu
*/

:root {
  --auth-bg: #f6f7fb;
  --auth-card: #ffffff;
  --auth-text: #0b1220;
  --auth-muted: rgba(11, 18, 32, 0.62);
  --auth-border: rgba(0, 0, 0, 0.10);
  --auth-shadow: 0 18px 50px rgba(0, 0, 0, 0.12), 0 6px 18px rgba(0, 0, 0, 0.08);
  --brand: #2563eb;
  --brand-hover: #1d4ed8;
}

body.auth-page {
  min-height: 100vh;
  margin: 0;
  color: var(--auth-text);
  background:
    radial-gradient(1200px 600px at 20% 10%, rgba(37, 99, 235, 0.08), transparent 55%),
    radial-gradient(900px 500px at 80% 20%, rgba(0, 0, 0, 0.06), transparent 60%),
    var(--auth-bg);
}

/* Ensure borders/padding never overflow width (fixes button slight overflow) */
body.auth-page *,
body.auth-page *::before,
body.auth-page *::after {
  box-sizing: border-box;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.auth-card {
  width: 100%;
  max-width: 520px;
  background: var(--auth-card);
  border: 1px solid var(--auth-border);
  border-radius: 16px;
  box-shadow: var(--auth-shadow);
  padding: 28px;
}

.auth-card--wide {
  max-width: 860px;
}

.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.auth-brand {
  font-weight: 800;
  letter-spacing: 0.2px;
  font-size: 14px;
  color: rgba(0, 0, 0, 0.75);
  text-decoration: none;
}

.auth-brand span {
  color: var(--brand);
}

.auth-back {
  font-size: 13px;
  color: var(--auth-muted);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 10px;
}

.auth-back:hover {
  background: rgba(37, 99, 235, 0.08);
  color: rgba(0, 0, 0, 0.78);
}

.auth-header {
  text-align: center;
  margin: 6px 0 18px;
}

.auth-title {
  margin: 0 0 6px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.auth-subtitle {
  margin: 0;
  color: var(--auth-muted);
  font-size: 15px;
  line-height: 1.6;
}

.auth-error {
  display: none;
  background: rgba(239, 68, 68, 0.08);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 14px 0;
  font-size: 14px;
}

.btn-auth {
  width: 100%;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.12);
  background: #fff;
  color: #111;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.btn-auth:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(0,0,0,0.10);
  border-color: rgba(37, 99, 235, 0.35);
}

.btn-auth:active {
  transform: translateY(0);
}

.btn-primary-auth {
  border: 1px solid rgba(37, 99, 235, 0.35);
  background: var(--brand);
  color: #fff;
}

.btn-primary-auth:hover {
  background: var(--brand-hover);
  border-color: rgba(37, 99, 235, 0.55);
}

.btn-danger-auth {
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: #ef4444;
  color: #fff;
}

.btn-danger-auth:hover {
  background: #dc2626;
  border-color: rgba(239, 68, 68, 0.55);
}

.google-logo {
  width: 20px;
  height: 20px;
}

.auth-note {
  margin: 14px 0 0;
  color: var(--auth-muted);
  font-size: 13px;
  text-align: center;
  line-height: 1.6;
}

/* Conditions content */
.conditions-scroll {
  margin-top: 14px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(0,0,0,0.02);
  border-radius: 14px;
  padding: 16px;
  max-height: 48vh;
  overflow: auto;
}

.conditions-scroll h2 {
  font-size: 16px;
  margin: 18px 0 10px;
  font-weight: 800;
}

.conditions-scroll p, .conditions-scroll li {
  color: rgba(0, 0, 0, 0.75);
  font-size: 14px;
  line-height: 1.8;
}

.conditions-checks {
  margin-top: 16px;
  border: 1px solid rgba(0,0,0,0.08);
  background: #fff;
  border-radius: 14px;
  padding: 14px;
}

.check-row {
  display: flex;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 12px;
}

.check-row + .check-row {
  margin-top: 6px;
}

.check-row:hover {
  background: rgba(37, 99, 235, 0.06);
}

.check-row input[type="checkbox"] {
  /* Custom checkbox to ensure identical size across states/browsers */
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: 3px;
  flex: 0 0 20px;
  border-radius: 6px;
  border: 2px solid rgba(0, 0, 0, 0.22);
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.check-row label {
  margin: 0;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(0,0,0,0.78);
}

.check-row input[type="checkbox"]::after {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid transparent;
  border-bottom: 2px solid transparent;
  transform: rotate(-45deg);
  margin-top: -1px;
}

.check-row input[type="checkbox"]:checked {
  background: var(--brand);
  border-color: rgba(37, 99, 235, 0.9);
}

.check-row input[type="checkbox"]:checked::after {
  border-left-color: #fff;
  border-bottom-color: #fff;
}

.check-row input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.22);
  border-color: rgba(37, 99, 235, 0.9);
}

.auth-actions {
  margin-top: 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.auth-actions .btn-auth {
  flex: 1;
  min-width: 220px;
}

/* Account */
.account-head {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: flex-start;
  margin-top: 10px;
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(37, 99, 235, 0.25);
  background: #f3f4f6;
}

.account-meta h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.account-meta p {
  margin: 4px 0 0;
  color: var(--auth-muted);
  font-size: 13px;
}

/* Billing panels */
.account-panels {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 860px) {
  .account-panels {
    grid-template-columns: 1.2fr 0.8fr;
    gap: 14px;
  }
}

.panel {
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  padding: 14px;
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.2px;
}

.panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px;
  border-radius: 12px;
  background: rgba(0,0,0,0.02);
}

.panel-row + .panel-row {
  margin-top: 8px;
}

.panel-row .label {
  color: rgba(0,0,0,0.72);
  font-size: 13px;
}

.panel-row .value {
  font-size: 13px;
  font-weight: 800;
  color: rgba(0,0,0,0.82);
  text-align: right;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(0,0,0,0.03);
  color: rgba(0,0,0,0.72);
}

.badge--ok {
  background: rgba(16, 185, 129, 0.10);
  border-color: rgba(16, 185, 129, 0.25);
  color: #065f46;
}

.badge--warn {
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.25);
  color: #92400e;
}

.badge--muted {
  background: rgba(37, 99, 235, 0.06);
  border-color: rgba(37, 99, 235, 0.18);
  color: rgba(37, 99, 235, 0.95);
}

.btn-auth[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.08);
}

.table th, .table td {
  padding: 10px 10px;
  font-size: 13px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.table th {
  text-align: left;
  color: rgba(0,0,0,0.65);
  background: rgba(0,0,0,0.02);
  font-weight: 900;
}

.table td {
  color: rgba(0,0,0,0.78);
}

.table tr:last-child td {
  border-bottom: none;
}

.muted {
  color: var(--auth-muted);
}

@media (max-width: 520px) {
  .auth-card { padding: 20px; }
  .auth-title { font-size: 24px; }
  .conditions-scroll { max-height: 52vh; }
}

/* =========================
   Account dashboard — plein écran, menu par onglets
   ========================= */
body.auth-page.account-dashboard .auth-shell {
  min-height: 100vh;
  display: block;
  padding: 0;
}

body.auth-page.account-dashboard .auth-card {
  max-width: none;
  width: 100%;
  border-radius: 0;
  border: none;
  box-shadow: none;
  padding: 0;
  background: transparent;
}

.dash-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.dash-topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dash-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 16px 34px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
}

@media (max-width: 920px) {
  .dash-layout {
    grid-template-columns: 1fr;
  }
}

.dash-nav {
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 16px;
  padding: 12px;
}

.dash-nav .account-head {
  margin-top: 0;
  padding: 6px 6px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.dash-menu {
  margin-top: 12px;
  display: grid;
  gap: 6px;
}

.dash-link {
  width: 100%;
  text-align: left;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-weight: 800;
  font-size: 13px;
  color: rgba(0,0,0,0.78);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dash-link:hover {
  background: rgba(37, 99, 235, 0.06);
}

.dash-link.active {
  background: rgba(37, 99, 235, 0.10);
  border-color: rgba(37, 99, 235, 0.22);
  color: rgba(37, 99, 235, 0.95);
}

.dash-main {
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 16px;
  padding: 14px;
}

.tab {
  display: none;
}

.tab.active {
  display: block;
}

.tab-title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.2px;
}

.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 720px) {
  .cards {
    grid-template-columns: 1fr;
  }
}

.card {
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  background: rgba(0,0,0,0.01);
  padding: 12px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 900;
}

/* Offers */
.offers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
  justify-items: stretch;
}

@media (max-width: 840px) {
  .offers-grid {
    grid-template-columns: 1fr;
  }
}

.offers-section-title {
  grid-column: 1 / -1;
  margin: 2px 0 8px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.3px;
  color: rgba(0,0,0,0.55);
}

.offer-card2 {
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 16px;
  background: rgba(255,255,255,0.92);
  padding: 12px;
}

.offer-card2--article {
  border-color: rgba(37, 99, 235, 0.22);
  background: rgba(255,255,255,0.98);
}

/* Onglets niveau / distance (compte — même logique que la page d’accueil) */
.offer-card2 .account-plan-tabs {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.offer-card2 .club-plan-levels .plan-tabs {
  flex-wrap: wrap;
}

.offer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.offer-name {
  font-weight: 900;
  color: rgba(0,0,0,0.82);
  font-size: 14px;
}

.offer-price {
  margin-top: 2px;
  font-weight: 900;
  color: rgba(37, 99, 235, 0.95);
  font-size: 13px;
}

.offer-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: rgba(0,0,0,0.70);
  font-size: 13px;
  line-height: 1.6;
}

.offer-article-niveau .article-niveau-select {
  display: block;
  background: #fff;
  color: rgba(0,0,0,0.88);
  border: 1px solid rgba(0,0,0,0.14);
  box-sizing: border-box;
}

.offer-article-niveau .article-niveau-select:focus {
  border-color: rgba(37, 99, 235, 0.45);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Filters + form */
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 900;
  color: rgba(0,0,0,0.62);
  margin-bottom: 6px;
}

.field input, .field select {
  width: 100%;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(255,255,255,0.95);
  font-size: 14px;
  outline: none;
}

.field input:focus, .field select:focus {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.form .grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 720px) {
  .form .grid2 { grid-template-columns: 1fr; }
}

/* Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0,0,0,0.18);
  transition: 0.2s;
  border-radius: 999px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 999px;
  box-shadow: 0 6px 12px rgba(0,0,0,0.16);
}

.switch input:checked + .slider {
  background-color: rgba(37, 99, 235, 0.55);
}

.switch input:checked + .slider:before {
  transform: translateX(18px);
}

.switch input:disabled + .slider {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Clickable invoice rows */
.row-click {
  cursor: pointer;
}
.row-click:hover td {
  background: rgba(37, 99, 235, 0.06);
}

/* Invoice detail */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 720px) {
  .detail-grid { grid-template-columns: 1fr; }
}

/* Settings checklist */
.checklist {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}
.checkitem {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.06);
  background: rgba(0,0,0,0.01);
  font-size: 13px;
  color: rgba(0,0,0,0.78);
}
.checkitem input {
  width: 18px;
  height: 18px;
}

/* Toast */
.toast {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 99999;
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  font-size: 13px;
  font-weight: 800;
  color: rgba(0,0,0,0.78);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
  max-width: min(520px, calc(100vw - 28px));
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast--ok { border-color: rgba(16, 185, 129, 0.25); }
.toast--warn { border-color: rgba(245, 158, 11, 0.25); }
.toast--info { border-color: rgba(37, 99, 235, 0.25); }

/* Notifications */
.notif-list {
  display: grid;
  gap: 10px;
}

.notif-item {
  border: 1px solid rgba(0,0,0,0.07);
  background: rgba(0,0,0,0.01);
  border-radius: 14px;
  padding: 10px;
}

.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.notif-msg {
  margin-top: 8px;
  color: rgba(0,0,0,0.78);
  font-size: 13px;
  line-height: 1.6;
}

/* Entitlements / access */
.entitlements {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.ent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.07);
  background: rgba(0,0,0,0.01);
}

.ent-name {
  font-weight: 900;
  color: rgba(0,0,0,0.82);
  font-size: 13px;
}

