@import url("/input-focus.css");

.auth-shell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
}

.auth-error {
  color: var(--muted, #5b6470);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

/* While Clerk boots we hold the button's footprint with a quiet placeholder instead of
   printing "Chargement…" in the header; the text stays available to screen readers only. */
.auth-loading {
  display: inline-block;
  width: 118px;
  min-height: 36px;
  border-radius: 999px;
  background: rgba(11, 15, 20, 0.05);
  color: transparent;
  font-size: 0;
  line-height: 0;
  overflow: hidden;
  white-space: nowrap;
  animation: auth-loading-pulse 1.4s ease-in-out infinite;
}
@keyframes auth-loading-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .auth-loading { animation: none; } }

.auth-error {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: normal;
}

.auth-error button,
.auth-link {
  border: 0;
  background: transparent;
  color: var(--ink, #0b0f14);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 7px 5px;
  white-space: nowrap;
}

.auth-error button {
  color: var(--cta, #ff5400);
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Header primary: same language as the app's CTAs (12px radius, 800 weight, orange glow). */
.auth-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: var(--cta, #ff5400);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
  padding: 0 18px;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(255, 84, 0, 0.28);
  transition: background .15s ease, box-shadow .15s ease, transform .1s ease;
}

.auth-primary:hover {
  background: var(--cta-hover, #ff8104);
  box-shadow: 0 8px 22px rgba(255, 84, 0, 0.34);
}
.auth-primary:active {
  transform: translateY(1px);
  box-shadow: 0 3px 10px rgba(255, 84, 0, 0.25);
}

.auth-account-button {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 190px;
  min-height: 40px;
  border: 1px solid var(--line, #e3e1da);
  border-radius: 999px;
  background: var(--surface, #fff);
  color: var(--ink, #0b0f14);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  padding-block:4px 4px;padding-inline:5px 10px;
}

.auth-avatar,
.auth-avatar-fallback {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex: none;
}

.auth-avatar {
  object-fit: cover;
}

.auth-avatar-fallback {
  display: grid;
  place-items: center;
  background: var(--cta, #ff5400);
  color: #0b0f14;
  font-size: 12px;
}

.auth-account-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-menu {
  position: absolute;
  z-index: 120;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  width: 220px;
  border: 1px solid var(--line, #e3e1da);
  border-radius: 14px;
  background: var(--surface, #fff);
  box-shadow: 0 14px 40px rgb(11 15 20 / 16%);
  overflow: hidden;
  padding: 6px;
}

.auth-menu-label {
  overflow: hidden;
  margin: 0 5px 5px;
  padding: 7px 5px 9px;
  border-bottom: 1px solid var(--line, #e3e1da);
  color: var(--muted, #5b6470);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-menu button {
  width: 100%;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink, #0b0f14);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 10px;
  text-align:start;
}

.auth-menu button:hover {
  background: var(--surface2, #efece4);
}

.auth-menu .auth-signout {
  color: #b42318;
}

.auth-shell [hidden] {
  display: none !important;
}

/* Scope account layout independently from the smaller sign-in/sign-up cards. */
.tonomoto-profile {
  width: min(960px, calc(100vw - 32px)) !important;
  max-width: 100% !important;
  min-width: 0;
}
.tonomoto-profile .tonomoto-profile-card {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0;
  max-height: calc(100dvh - 48px);
  border-radius: 20px;
  background: #fff;
  color: #0b0f14;
}
.tonomoto-profile .cl-navbar {
  flex: 0 0 200px;
  min-width: 0;
}
.tonomoto-profile .cl-scrollBox {
  flex: 1 1 0;
  min-width: 0;
  background: #fff;
  overflow-y: auto;
}
.tonomoto-profile .cl-pageScrollBox,
.tonomoto-profile .cl-page,
.tonomoto-profile .cl-profileSection,
.tonomoto-profile .cl-profileSectionContent {
  min-width: 0;
  max-width: 100%;
}
.tonomoto-profile .cl-profileSectionContent {
  overflow-wrap: anywhere;
}
@media (max-width: 640px) {
  .tonomoto-profile {
    width: calc(100vw - 16px) !important;
  }
  .tonomoto-profile .tonomoto-profile-card {
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 24px);
    border-radius: 16px;
  }
  .tonomoto-profile .cl-navbar {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    padding: 16px;
  }
  .tonomoto-profile .cl-navbarButtons {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  .tonomoto-profile .cl-scrollBox {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
  }
  .tonomoto-profile .cl-pageScrollBox { padding: 20px 16px; }
  .tonomoto-profile .cl-profileSection {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .tonomoto-profile .cl-profileSectionContent,
  .tonomoto-profile .cl-profileSectionTitle { width: 100%; }
  .tonomoto-profile .cl-profileSectionItem {
    flex-wrap: wrap;
    gap: 12px;
  }
}

@media (max-width: 760px) {
  .auth-account-name,
  .auth-link {
    display: none;
  }

  .auth-primary {
    height: 38px;
    padding: 0 14px;
    font-size: 13.5px;
    box-shadow: 0 4px 12px rgba(255, 84, 0, 0.24);
  }

  .auth-account-button {
    width: 40px;
    padding: 4px;
  }

  /* Mobile: no placeholder at all — the account lives in the bottom "Compte" tab. */
  .auth-loading { display: none; }
}

@media (max-width: 390px) {
  .auth-primary {
    max-width: 88px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
