/* =========================================================================
   Auth pages (login / register) + OTP modal.
   Aligned to design-system-v2: Loto-Québec blue brand, Lato, dark surfaces.
   Shared tokens mirror dsv2 values verified on portail.lotoquebec.com.
   ========================================================================= */
:root {
  --lq-page: #095892;
  --lq-surface: #06314f;
  --lq-surface-2: #0a3d61;
  --lq-line: rgba(255, 255, 255, 0.14);
  --lq-action: #0061d4;
  --lq-action-2: #36a9ff;
  --lq-ink: #ffffff;
  --lq-soft: #d7e5f2;
  --lq-muted: #b3cde1;
  --lq-faint: #9fc0dd;
  --lq-danger: #ff7a7a;
  --lq-radius: 14px;
}

#avert-header {
  top: 0 !important;
  left: 0 !important;
  min-width: 0 !important;
  width: 100% !important;
}
#avert-header .avert2 {
  display: block !important;
}

/* ---- page backdrop: layered glow over the brand blue ---- */
.auth-page {
  position: relative;
  padding: 3.5rem 1rem 5rem;
  background:
    radial-gradient(60rem 40rem at 78% -10%, rgba(54, 169, 255, 0.16), transparent 60%),
    radial-gradient(48rem 36rem at 12% 110%, rgba(0, 97, 212, 0.22), transparent 60%);
}

/* ---- title + eyebrow ---- */
.auth-page .auth-title {
  text-align: center;
  margin: 0 auto 1.4rem;
  max-width: 520px;
  color: var(--lq-ink);
  font-family: latoblack, Arial, Helvetica, sans-serif;
  font-size: 3.2rem;
  line-height: 1.08;
  animation: auth-rise 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.auth-page .auth-title::before {
  content: "Mon Espacejeux";
  display: block;
  color: var(--lq-muted);
  font-family: latomedium, Arial, Helvetica, sans-serif;
  font-size: 1.3rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

/* ---- card ---- */
.auth-wrapper {
  position: relative;
  max-width: 520px;
  margin: 0 auto 3rem;
  padding: 2.4rem 2.2rem 2rem;
  background: var(--lq-surface);
  border: 1px solid var(--lq-line);
  border-radius: var(--lq-radius);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
  animation: auth-rise 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  animation-delay: 0.06s;
}
/* brand accent bar at the top edge of the card */
.auth-wrapper::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--lq-action), var(--lq-action-2));
}

@keyframes auth-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-page .title {
  margin: 0 0 0.4em 0;
}

.auth-form {
  display: block;
  width: 100%;
}

.auth-intro {
  margin: 0 0 1.4rem 0;
  color: var(--lq-muted);
  font-family: latoregular, Arial, Helvetica, sans-serif;
  font-size: 1.4rem;
  line-height: 1.5;
}

.auth-label {
  display: block;
  margin: 1.2rem 0 0.4rem;
  color: var(--lq-soft);
  font-family: latomedium, Arial, Helvetica, sans-serif;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}

.auth-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.95rem 1.05rem;
  font-family: latoregular, Arial, Helvetica, sans-serif;
  font-size: 1.45rem;
  line-height: 1.3;
  background: var(--lq-surface-2);
  border: 1px solid var(--lq-line);
  border-radius: 8px;
  color: var(--lq-ink);
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.auth-input::placeholder { color: var(--lq-faint); }

.auth-input:focus {
  outline: none;
  border-color: var(--lq-action-2);
  background: #0c456e;
  box-shadow: 0 0 0 3px rgba(54, 169, 255, 0.25);
}

.auth-input:invalid:not(:placeholder-shown) {
  border-color: var(--lq-danger);
}

/* native date/calendar icon visible on dark inputs */
.auth-input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.7;
  cursor: pointer;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 1.2rem;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1.1rem 0 0.3rem;
  font-size: 1.25rem;
}

.auth-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 1rem 0;
  font-family: latoregular, Arial, Helvetica, sans-serif;
  font-size: 1.25rem;
  color: var(--lq-soft);
  line-height: 1.4;
}

.auth-checkbox input {
  margin-top: 0.2em;
  width: 1.5rem;
  height: 1.5rem;
  accent-color: var(--lq-action-2);
  flex: 0 0 auto;
}

.auth-link,
.auth-checkbox a,
.auth-switch a {
  color: var(--lq-action-2);
  text-decoration: none;
}

.auth-link:hover,
.auth-checkbox a:hover,
.auth-switch a:hover {
  text-decoration: underline;
}

.auth-submit {
  display: block;
  width: 100%;
  margin: 1.6rem 0 0.6rem;
  padding: 1.1rem 1em;
  font-family: latomedium, Arial, Helvetica, sans-serif;
  font-size: 1.5rem;
  font-weight: normal;
  color: #fff;
  background: var(--lq-action);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: background 0.18s, transform 0.12s, box-shadow 0.18s;
}

.auth-submit:hover {
  background: var(--lq-action-2);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -10px rgba(54, 169, 255, 0.7);
}
.auth-submit:active { transform: translateY(0); }
.auth-submit:focus-visible { outline: 2px solid var(--lq-action-2); outline-offset: 2px; }

.auth-switch {
  margin: 1.2rem 0 0;
  text-align: center;
  font-family: latoregular, Arial, Helvetica, sans-serif;
  font-size: 1.3rem;
  color: var(--lq-muted);
}

/* =========================== OTP modal =========================== */
.otp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 22, 38, 0.66);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 1em;
  animation: otp-fade 0.18s ease-out;
}

@keyframes otp-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes otp-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.otp-modal {
  background: var(--lq-surface);
  border: 1px solid var(--lq-line);
  border-radius: var(--lq-radius);
  width: 100%;
  max-width: 430px;
  padding: 2rem 2rem 1.6rem;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.7);
  position: relative;
  color: var(--lq-ink);
  animation: otp-pop 0.22s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.otp-modal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: var(--lq-radius) var(--lq-radius) 0 0;
  background: linear-gradient(90deg, var(--lq-action), var(--lq-action-2));
}

.otp-close {
  position: absolute;
  top: 0.5rem;
  right: 0.7rem;
  background: transparent;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: var(--lq-faint);
  cursor: pointer;
  padding: 0.25em 0.5em;
  transition: color 0.15s;
}

.otp-close:hover { color: #fff; }

.otp-title {
  margin: 0 0 0.5rem;
  font-family: latoblack, Arial, Helvetica, sans-serif;
  font-size: 2rem;
  color: var(--lq-ink);
}

.otp-desc {
  margin: 0 0 1.4rem;
  font-family: latoregular, Arial, Helvetica, sans-serif;
  font-size: 1.35rem;
  color: var(--lq-muted);
  line-height: 1.45;
}
.otp-desc strong { color: var(--lq-soft); }

.otp-inputs {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.6rem 0 0.9rem;
}

.otp-inputs input {
  width: 3rem;
  height: 3.6rem;
  font-size: 1.8rem;
  text-align: center;
  border: 1px solid var(--lq-line);
  border-radius: 8px;
  background: var(--lq-surface-2);
  color: var(--lq-ink);
  font-variant-numeric: tabular-nums;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.otp-inputs input:focus {
  outline: none;
  border-color: var(--lq-action-2);
  background: #0c456e;
  box-shadow: 0 0 0 3px rgba(54, 169, 255, 0.25);
}

.otp-error {
  display: none;
  margin: 0.4rem 0 0.9rem;
  padding: 0.7rem 0.9rem;
  background: rgba(255, 122, 122, 0.12);
  border-left: 3px solid var(--lq-danger);
  color: var(--lq-danger);
  font-family: latoregular, Arial, Helvetica, sans-serif;
  font-size: 1.25rem;
  border-radius: 6px;
}

.otp-error.is-visible { display: block; }

.otp-validate {
  display: block;
  width: 100%;
  margin: 0.4rem 0 1rem;
  padding: 1rem 1em;
  font-family: latomedium, Arial, Helvetica, sans-serif;
  font-size: 1.5rem;
  color: #fff;
  background: var(--lq-action);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: background 0.18s, transform 0.12s, box-shadow 0.18s;
}

.otp-validate:hover {
  background: var(--lq-action-2);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -10px rgba(54, 169, 255, 0.7);
}
.otp-validate:active { transform: translateY(0); }

.otp-resend-row {
  text-align: center;
  font-family: latoregular, Arial, Helvetica, sans-serif;
  font-size: 1.25rem;
  color: var(--lq-muted);
}

.otp-resend {
  background: transparent;
  border: none;
  color: var(--lq-action-2);
  font: inherit;
  cursor: pointer;
  padding: 0.2em 0.4em;
}

.otp-resend[disabled] {
  color: var(--lq-faint);
  cursor: not-allowed;
}

.otp-resend:not([disabled]):hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  .auth-page .auth-title { font-size: 2.6rem; }
  .auth-grid { grid-template-columns: 1fr; }
  .otp-inputs input { width: 2.6rem; height: 3.2rem; font-size: 1.5rem; }
}
