/* =========================================================
   Auth / Login page — visual refresh only.
   Scoped under .auth-page so nothing else on the site is affected.
   Brand colors preserved from soft-ui-dashboard.css:
     info solid   : #17c1e8
     info gradient: #21d4fd -> #2152ff (310deg)
     body text    : #67748e
========================================================= */

.auth-page {
  --brand-info: #17c1e8;
  --brand-grad-start: #21d4fd;
  --brand-grad-end: #2152ff;
  --ink: #252f40;
  --muted: #67748e;
  --line: #e7eaf1;
  --field-bg: #f8fafc;
  background: radial-gradient(120% 140% at 100% 0%, #eef6fb 0%, #f6f8fb 45%, #f6f8fb 100%);
  min-height: 100vh;
  font-family: "Inter", "Open Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.auth-page * {
  box-sizing: border-box;
}

.auth-shell {
  min-height: 100vh;
  padding: 0;
}

.auth-grid {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}

/* ---------- Left: form ---------- */

.auth-form-panel {
  flex: 1 1 50%;
  width: 50%;
  margin: 16px 0 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}

.auth-form-card {
  width: 100%;
  max-width: 468px;
  background: #ffffff;
  border-radius: 20px;
  padding: 48px 40px 40px;
  box-shadow: 0 1px 2px rgba(23, 29, 45, 0.04), 0 24px 48px -24px rgba(23, 29, 45, 0.18);
  border: 1px solid rgba(231, 234, 241, 0.8);
}

.auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
}

.auth-brand-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.auth-form-header {
  text-align: center;
  margin-bottom: 30px;
}

.auth-title {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--ink);
}

.auth-subtitle {
  font-size: 1.1rem;
  color: var(--muted);
  margin: 0;
}

.auth-field {
  margin-bottom: 16px;
}

.auth-label {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 14px;
  display: inline-flex;
  color: #9aa5b8;
  pointer-events: none;
}

.auth-input-icon svg {
  width: 21px;
  height: 21px;
}

.auth-input {
  width: 100%;
  height: 56px;
  padding: 0 16px 0 48px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--field-bg);
  font-size: 1.1rem;
  font-family: inherit;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.auth-input::placeholder {
  color: #a9b1c2;
}

.auth-input:hover {
  border-color: #d3d9e5;
}

.auth-input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--brand-info);
  box-shadow: 0 0 0 4px rgba(23, 193, 232, 0.14);
}

.auth-row-end {
  display: flex;
  justify-content: flex-end;
  margin: 2px 0 22px;
}

.auth-link {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--brand-grad-end);
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
  color: var(--brand-info);
}

.auth-submit {
  width: 100%;
  height: 58px;
  border: none;
  border-radius: 12px;
  background-image: linear-gradient(310deg, var(--brand-grad-start) 0%, var(--brand-grad-end) 100%);
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 10px 24px -10px rgba(33, 82, 255, 0.55);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px -10px rgba(33, 82, 255, 0.6);
  filter: brightness(1.03);
}

.auth-submit:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px -8px rgba(33, 82, 255, 0.5);
}

.auth-alert {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 0.98rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
}

.auth-alert-success {
  background: rgba(34, 197, 94, 0.1);
  color: #15803d;
  border: 1px solid rgba(34, 197, 94, 0.22);
}

.auth-alert-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.22);
}

.auth-form-footer {
  text-align: center;
  padding-top: 18px;
  margin-top: 4px;
}

.auth-footnote {
  text-align: center;
  font-size: 0.85rem;
  color: #9aa5b8;
  margin-top: 22px;
}

/* ---------- Right: brand panel ---------- */

.auth-brand-panel {
  position: relative;
  flex: 1 1 50%;
  width: 50%;
  margin: 16px 16px 16px 0;
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-image: linear-gradient(310deg, var(--brand-grad-start) 0%, var(--brand-grad-end) 100%);
}

.auth-brand-panel.is-plain {
  background-image: none;
  background-color: #f6fafd;
  border: 1px solid var(--line);
}

.auth-brand-pattern {
  position: absolute;
  inset: -6%;
  width: 112%;
  height: 112%;
  opacity: 0.1;
  object-fit: cover;
  animation: authPatternDrift 22s ease-in-out infinite alternate;
}

@keyframes authPatternDrift {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
  100% {
    transform: translate(-2%, 1.5%) rotate(1deg) scale(1.03);
  }
}

.auth-brand-glow-a,
.auth-brand-glow-b {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  animation: authGlowDrift 9s ease-in-out infinite alternate;
}

.auth-brand-glow-a {
  width: 340px;
  height: 340px;
  top: -100px;
  right: -100px;
  background: rgba(255, 255, 255, 0.28);
}

.auth-brand-glow-b {
  width: 280px;
  height: 280px;
  bottom: -80px;
  left: -80px;
  background: rgba(255, 255, 255, 0.18);
  animation-duration: 11s;
  animation-delay: -3s;
}

.auth-brand-panel.is-plain .auth-brand-glow-a {
  background: rgba(33, 212, 253, 0.16);
}

.auth-brand-panel.is-plain .auth-brand-glow-b {
  background: rgba(33, 82, 255, 0.12);
}

@keyframes authGlowDrift {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(-18px, 22px) scale(1.08);
  }
}

.auth-brand-content {
  position: relative;
  z-index: 2;
  padding: 48px;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-brand-mark-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 148px;
  height: 148px;
  margin-bottom: 6px;
}

.auth-brand-mark-halo {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 70%);
  animation: authHaloPulse 3.6s ease-in-out infinite;
}

.auth-brand-panel.is-plain .auth-brand-mark-halo {
  background: radial-gradient(circle, rgba(33, 82, 255, 0.16) 0%, rgba(33, 82, 255, 0) 70%);
}

@keyframes authHaloPulse {
  0%,
  100% {
    transform: scale(0.85);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
  }
}

.auth-brand-mark {
  position: relative;
  width: 104px;
  height: 104px;
  object-fit: contain;
  animation: authFloat 5s ease-in-out infinite;
}

.auth-brand-title {
  margin-top: 20px;
  font-size: 1.55rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.auth-brand-panel.is-plain .auth-brand-title {
  color: var(--ink);
}

.auth-brand-tagline {
  margin: 2px 0 36px;
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
}

.auth-brand-panel.is-plain .auth-brand-tagline {
  color: var(--muted);
}

@keyframes authFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.auth-carousel {
  position: relative;
  width: 100%;
  height: 84px;
}

.auth-float-card {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(6px);
  text-align: left;
  opacity: 0;
  transform: translateY(16px);
  animation: authCarousel 14s ease-in-out infinite;
}

.auth-carousel-item:nth-child(1) {
  animation-delay: 0s;
}

.auth-carousel-item:nth-child(2) {
  animation-delay: 3.5s;
}

.auth-carousel-item:nth-child(3) {
  animation-delay: 7s;
}

.auth-carousel-item:nth-child(4) {
  animation-delay: 10.5s;
}

@keyframes authCarousel {
  0% {
    opacity: 0;
    transform: translateY(16px);
  }
  4% {
    opacity: 1;
    transform: translateY(0);
  }
  21% {
    opacity: 1;
    transform: translateY(0);
  }
  26%,
  100% {
    opacity: 0;
    transform: translateY(-16px);
  }
}

.auth-brand-panel.is-plain .auth-float-card {
  background: #ffffff;
  border-color: var(--line);
  box-shadow: 0 16px 32px -20px rgba(23, 29, 45, 0.25);
}

.auth-float-badge {
  position: relative;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-brand-panel.is-plain .auth-float-badge {
  background: linear-gradient(310deg, var(--brand-grad-start) 0%, var(--brand-grad-end) 100%);
}

.auth-float-badge svg {
  width: 18px;
  height: 18px;
  color: #ffffff;
}

.auth-float-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  animation: authPulseRing 2.8s ease-out infinite;
}

.auth-brand-panel.is-plain .auth-float-ring {
  border-color: rgba(33, 82, 255, 0.35);
}

@keyframes authPulseRing {
  0% {
    transform: scale(0.85);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

.auth-float-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.auth-float-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

.auth-brand-panel.is-plain .auth-float-title {
  color: var(--ink);
}

.auth-float-sub {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
}

.auth-brand-panel.is-plain .auth-float-sub {
  color: var(--muted);
}

.auth-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
}

.auth-carousel-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  animation: authDotPulse 14s ease-in-out infinite;
}

.auth-brand-panel.is-plain .auth-carousel-dots span {
  background: rgba(33, 82, 255, 0.25);
}

.auth-carousel-dots span:nth-child(1) {
  animation-delay: 0s;
}

.auth-carousel-dots span:nth-child(2) {
  animation-delay: 3.5s;
}

.auth-carousel-dots span:nth-child(3) {
  animation-delay: 7s;
}

.auth-carousel-dots span:nth-child(4) {
  animation-delay: 10.5s;
}

@keyframes authDotPulse {
  0%,
  26%,
  100% {
    opacity: 0.6;
    transform: scale(1);
  }
  10%,
  18% {
    opacity: 1;
    transform: scale(1.35);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-brand-glow-a,
  .auth-brand-glow-b,
  .auth-brand-mark,
  .auth-brand-mark-halo,
  .auth-brand-pattern,
  .auth-float-card,
  .auth-float-ring,
  .auth-carousel-dots span {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .auth-carousel-item:not(:first-child) {
    display: none;
  }
}

@media (max-width: 991.98px) {
  .auth-brand-panel {
    display: none;
  }
  .auth-form-panel {
    padding: 40px 20px;
  }
}

@media (max-width: 420px) {
  .auth-form-card {
    padding: 34px 22px 28px;
    border-radius: 16px;
  }
}

/* ---------- Téléphone (<=760px) : écran "app" plein cadre, pas une carte desktop réduite ---------- */
@media (max-width: 760px) {
  .auth-page {
    background: #ffffff;
  }

  .auth-shell {
    min-height: 100dvh;
  }

  .auth-grid {
    display: block;
    min-height: 100dvh;
  }

  .auth-form-panel {
    width: 100%;
    margin: 0;
    padding: 40px 26px 28px;
    min-height: 100dvh;
    justify-content: flex-start;
  }

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

  .auth-brand {
    justify-content: flex-start;
    margin-bottom: 20px;
  }

  .auth-brand-logo {
    width: 52px;
    height: 52px;
  }

  .auth-form-header {
    text-align: left;
    margin-bottom: 28px;
  }

  .auth-title {
    font-size: 1.8rem;
  }

  .auth-input {
    background: #f3f5f9;
  }

  .auth-form-footer {
    text-align: left;
    padding-top: 22px;
  }

  .auth-footnote {
    text-align: left;
  }
}

/* ---------- Petits téléphones (<=380px) : encore un peu plus compact ---------- */
@media (max-width: 380px) {
  .auth-form-panel {
    padding: 32px 20px 24px;
  }

  .auth-title {
    font-size: 1.55rem;
  }

  .auth-brand-logo {
    width: 46px;
    height: 46px;
  }

  .auth-input {
    height: 52px;
  }

  .auth-submit {
    height: 54px;
  }
}
