:root {
  --primary-color: #ff3333;
  --secondary-color: #1a1a1a;
  --background-dark: #0a0a0a;
  --text-color: #e0e0e0;
  --text-muted: #999999;
  --border-color: #333333;
  --input-background: #2a2a2a;
  --border-radius-md: 12px;
  --border-radius-lg: 20px;
  --spacing-unit: 1.5rem;
}

html, body {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  overflow: hidden !important;
  height: 100% !important;
  width: 100% !important;
}

::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, var(--background-dark) 0%, #151515 100%);
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 20px 0;
  box-sizing: border-box;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  position: relative;
}

body::before, body::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,51,51,0.15) 0%, rgba(255,51,51,0) 70%);
    border-radius: 50%;
    filter: blur(60px);
    z-index: 0;
}

body::before {
    top: -100px;
    left: -100px;
}

body::after {
    bottom: -100px;
    right: -100px;
}

#loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--background-dark);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999999;
}

#loader-overlay.is-visible {
  display: flex;
}

.is-hidden {
  display: none !important;
}

.progress-bar.is-loaded {
  width: 100%;
}

.loader-logo-container {
  margin-bottom: 25px;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pulse-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: pulseLogo var(--loader-pulse-duration, 0.85s) infinite ease-in-out;
}

@keyframes pulseLogo {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.progress-container {
  width: 200px;
  height: 4px;
  background: #151515;
  border: 1px solid #222;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background-color: var(--primary-color);
  border-radius: 4px;
  transition: width var(--loader-progress-duration, 0.18s) ease;
}

.container-auth {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  padding: 1rem var(--spacing-unit) var(--spacing-unit);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
  margin-bottom: auto;
  overflow: visible;
}

.remembered-account-banner {
  width: 100%;
  margin: 0 0 1rem;
  padding: 0.75rem 0.85rem;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid rgba(255, 68, 75, 0.38);
  border-radius: 16px;
  background: rgba(24, 20, 21, 0.88);
  color: var(--text-color);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.34), 0 0 24px rgba(255, 51, 51, 0.08);
  backdrop-filter: blur(18px);
  text-align: left;
  transform: none;
}

.remembered-account-banner:hover {
  background: rgba(34, 25, 26, 0.96);
  border-color: rgba(255, 76, 82, 0.72);
  transform: translateY(-2px);
}

.remembered-account-banner:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 3px;
}

.remembered-account-banner.is-loading {
  opacity: 0.68;
  pointer-events: none;
}

.remembered-account-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #ff4d52, #d91f27);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(255, 51, 51, 0.25);
}

.remembered-account-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.remembered-account-title {
  overflow: hidden;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remembered-account-subtitle {
  color: #999;
  font-size: 0.74rem;
  font-weight: 400;
}

.remembered-account-arrow {
  color: var(--primary-color);
  font-size: 1.15rem;
  text-align: center;
  transition: transform 0.2s ease;
}

.remembered-account-banner:hover .remembered-account-arrow {
  transform: translateX(3px);
}

.auth-box {
  background-color: rgba(21, 21, 21, 0.75);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 2.5rem;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
  text-align: center;
  margin-bottom: 1.5rem;
}

.logo {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 2.5rem;
  color: var(--primary-color);
  letter-spacing: -1px;
  margin-bottom: 2rem;
  text-transform: uppercase;
  text-shadow: 0 0 20px rgba(255, 51, 51, 0.2);
}

h1,
h2 {
  font-weight: 600;
  margin-bottom: 2rem;
  font-size: 1.5rem;
  letter-spacing: -0.5px;
}

input {
  width: 100%;
  padding: 1rem;
  margin-bottom: 1.2rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  background-color: var(--input-background);
  color: var(--text-color);
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  box-sizing: border-box;
  transition: all 0.3s ease;
  color-scheme: dark;
}

input[type="date"] {
  color: var(--text-color);
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(0.72);
  cursor: pointer;
}

input:focus {
  border-color: var(--primary-color);
  outline: none;
  background-color: #2e2e2e;
  box-shadow: 0 0 15px rgba(255, 51, 51, 0.15);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text-color) !important;
  caret-color: var(--text-color);
  border-color: var(--border-color);
  box-shadow: 0 0 0 1000px var(--input-background) inset !important;
  -webkit-box-shadow: 0 0 0 1000px var(--input-background) inset !important;
  transition: background-color 9999s ease-out, color 9999s ease-out;
}

button {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, #ff4d4d, #d91f27);
  color: white;
  border: none;
  border-radius: var(--border-radius-md);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(255, 51, 51, 0.24);
  transition: 0.3s ease;
  margin-top: 0.5rem;
}

button:hover {
  background-color: #e62e2e;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(255, 51, 51, 0.3);
}

.link-auth {
  display: block;
  margin-top: 1.5rem;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}

.link-auth:hover {
  text-decoration: underline;
}

.link-forgot {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: 0.3s;
    opacity: 0.9;
}

.link-forgot:hover {
    opacity: 1;
    text-decoration: underline;
    transform: translateY(-1px);
}

.floating-back-arrow {
    position: absolute;
    top: 30px;
    left: 30px;
    width: 45px;
    height: 45px;
    background: rgba(21, 21, 21, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 10;
}

.floating-back-arrow:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(255, 51, 51, 0.3);
}

.auth-lang-switcher {
    position: relative;
    top: auto;
    left: auto;
    flex: 0 0 auto;
    margin-top: auto;
    transform: none;
    z-index: 10;
}

.registration-age-notice {
  margin: -0.55rem 0 1rem;
  color: #a9a9b2;
  font-size: 0.76rem;
  line-height: 1.45;
  text-align: left;
}

.registration-legal-consent {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 0.7rem;
  align-items: start;
  margin: 0 0 0.65rem;
  color: #bebec6;
  font-size: 0.76rem;
  line-height: 1.5;
  text-align: left;
}

.registration-legal-consent input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0.1rem 0 0;
  accent-color: var(--primary-color);
}

.registration-legal-consent a {
  color: var(--primary-color);
  text-underline-offset: 2px;
}

/* ---- Marque "B" du chargement (voir interface.css pour le detail) ----
   L'ancien /faviconUrl.ico etait une image matricielle etiree, donc floue.
   L'animation est ici et non dans le SVG : la CSP interdit 'unsafe-inline'
   pour style-src. */
.app-loader-mark {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.app-loader-mark-trace {
    stroke-dasharray: 420;
    stroke-dashoffset: 420;
    animation: loaderMarkTrace var(--loader-trace-duration, 1.7s) ease-in-out infinite;
}

@keyframes loaderMarkTrace {
    0%   { stroke-dashoffset: 420; opacity: .35; }
    45%  { stroke-dashoffset: 0;   opacity: 1; }
    70%  { stroke-dashoffset: 0;   opacity: 1; }
    100% { stroke-dashoffset: -420; opacity: .35; }
}

@media (prefers-reduced-motion: reduce) {
    .app-loader-mark-trace { animation: none; stroke-dashoffset: 0; }
}
