/* ==========================================================================
   Yacada — dedicated login
   ========================================================================== */

html.sp-auth-page,
body.sp-auth-page {
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100vh;
  background: var(--sp-bg);
  color: var(--sp-text);
  font-family: var(--sp-font);
  font-size: 13px;
  line-height: 1.75;
}

.sp-auth *,
.sp-auth *::before,
.sp-auth *::after {
  box-sizing: border-box;
}

.sp-auth {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, .92fr);
  min-height: 100vh;
}

.sp-auth a {
  color: inherit;
  text-decoration: none;
}

.sp-auth button,
.sp-auth input {
  font: inherit;
}

/* Visual side ------------------------------------------------------------ */

.sp-auth__visual {
  position: relative;
  overflow: hidden;
  display: flex;
  background:
    radial-gradient(46rem 32rem at 18% 8%, rgba(246, 238, 49, .26), transparent 60%),
    radial-gradient(38rem 28rem at 90% 90%, rgba(22, 107, 88, .16), transparent 60%),
    linear-gradient(150deg, #0b0c08 0%, #14170e 48%, #202516 100%);
  color: #eef5fa;
}

.sp-auth__visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(70% 70% at 30% 30%, #000, transparent 78%);
  -webkit-mask-image: radial-gradient(70% 70% at 30% 30%, #000, transparent 78%);
  pointer-events: none;
}

.sp-auth__visual-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: clamp(28px, 4vw, 52px) clamp(28px, 5vw, 68px);
}

.sp-auth__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sp-auth__brand .sp-mark {
  border-radius: 14px;
  box-shadow: 0 18px 40px -20px rgba(246, 238, 49, .75);
}

.sp-auth__brand b,
.sp-auth__brand small {
  display: block;
}

.sp-auth__brand b {
  font-size: 15px;
  letter-spacing: -.01em;
}

.sp-auth__brand small {
  font-size: 9.5px;
  color: #a9bdca;
}

.sp-auth__pitch {
  margin-top: auto;
  margin-bottom: auto;
  max-width: 540px;
  padding-block: 48px 24px;
}

.sp-auth__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 9.5px;
  font-weight: 700;
  color: #ffd98b;
  border: 1px solid rgba(255, 211, 107, .28);
  background: rgba(246, 238, 49, .12);
  border-radius: 999px;
  padding: 5px 11px;
  margin-bottom: 20px;
}

.sp-auth__pitch h2 {
  margin: 0 0 14px;
  font-size: clamp(2.1rem, 1.4rem + 3vw, 4rem);
  line-height: 1.16;
  letter-spacing: -.045em;
  font-weight: 800;
}

.sp-auth__pitch p {
  margin: 0;
  max-width: 42ch;
  font-size: clamp(.9rem, .82rem + .25vw, 1.05rem);
  line-height: 2;
  color: #b8cbd8;
}

.sp-auth__orbs {
  position: absolute;
  inset-inline-start: 0;
  bottom: 86px;
  width: 100%;
  height: 300px;
  pointer-events: none;
  z-index: 0;
  opacity: .9;
}

.sp-auth__orbs svg {
  position: absolute;
  inset-inline-start: 0;
  bottom: 0;
  width: 100%;
  height: auto;
}

.sp-auth__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
}

.sp-auth__orb--a {
  width: 220px;
  height: 220px;
  inset-inline-end: 6%;
  top: 24px;
  background: radial-gradient(circle at 35% 35%, rgba(255, 249, 143, .5), rgba(246, 238, 49, .08) 62%, transparent 70%);
  animation: sp-auth-float 9s ease-in-out infinite;
}

.sp-auth__orb--b {
  width: 110px;
  height: 110px;
  inset-inline-end: 34%;
  top: 130px;
  background: radial-gradient(circle at 35% 35%, rgba(67, 203, 176, .35), rgba(22, 107, 88, .04) 65%, transparent 72%);
  animation: sp-auth-float 12s ease-in-out infinite reverse;
}

@keyframes sp-auth-float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -14px, 0); }
}

.sp-auth__facts {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.sp-auth__facts li {
  min-width: 120px;
  padding: 10px 13px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  backdrop-filter: blur(8px);
}

.sp-auth__facts b,
.sp-auth__facts span {
  display: block;
}

.sp-auth__facts b {
  font-size: 15px;
  color: #fff;
  letter-spacing: -.02em;
}

.sp-auth__facts span {
  font-size: 8.5px;
  color: #9db2c1;
}

.sp-auth__copyright {
  position: relative;
  z-index: 1;
  margin-top: 22px;
  font-size: 8.5px;
  color: #6f8697;
}

/* Form side -------------------------------------------------------------- */

.sp-auth__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(18px, 3vw, 38px);
  background:
    radial-gradient(40rem 26rem at 100% 0%, rgba(246, 238, 49, .09), transparent 60%),
    var(--sp-surface);
}

.sp-auth__toolbar {
  position: absolute;
  top: clamp(16px, 2.5vw, 28px);
  inset-inline: clamp(18px, 3vw, 34px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sp-auth__back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--sp-text-muted) !important;
  padding: 6px 8px;
  border-radius: 8px;
}

.sp-auth__back:hover {
  background: var(--sp-surface-2);
  color: var(--sp-text) !important;
}

.sp-auth__card {
  width: min(100%, 392px);
  padding: 28px 30px 24px;
  border-radius: 22px;
  border: 1px solid var(--sp-border);
  background: var(--sp-surface);
  box-shadow: var(--sp-shadow-2);
}

.sp-auth__mobilebrand {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.sp-auth__mobilebrand b,
.sp-auth__mobilebrand small {
  display: block;
}

.sp-auth__mobilebrand b {
  font-size: 13px;
}

.sp-auth__mobilebrand small {
  font-size: 8.5px;
  color: var(--sp-text-faint);
}

.sp-auth__kicker {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  font-weight: 700;
  color: var(--sp-solar-strong);
  background: var(--sp-solar-soft);
  border-radius: 999px;
  padding: 4px 9px;
  margin-bottom: 10px;
}

.sp-auth__card h1 {
  margin: 0;
  font-size: clamp(1.25rem, 1rem + .8vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.35;
}

.sp-auth__lead {
  margin: 7px 0 18px;
  font-size: 10.5px;
  line-height: 1.9;
  color: var(--sp-text-muted);
}

.sp-auth__notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 9.5px;
  line-height: 1.8;
  margin-bottom: 13px;
  background: var(--sp-critical-soft);
  color: var(--sp-text);
  border: 1px solid rgba(217, 80, 69, .25);
}

.sp-auth__notice svg {
  flex: none;
  margin-top: 2px;
  color: var(--sp-critical);
}

.sp-auth__notice--success {
  background: var(--sp-success-soft);
  border-color: rgba(22, 140, 109, .22);
}

.sp-auth__notice--success svg {
  color: var(--sp-success);
}

.sp-auth__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sp-auth__trap {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
}

.sp-auth__field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sp-auth__field > span {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--sp-text-muted);
}

.sp-auth__input {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 43px;
  padding: 0 11px;
  border: 1px solid var(--sp-border);
  border-radius: 11px;
  background: var(--sp-surface-2);
  color: var(--sp-text-faint);
  transition: border-color var(--sp-dur) var(--sp-ease), box-shadow var(--sp-dur) var(--sp-ease), background var(--sp-dur) var(--sp-ease);
}

.sp-auth__input:focus-within {
  border-color: var(--sp-solar-text);
  box-shadow: 0 0 0 3px rgba(246, 238, 49, .16);
  background: var(--sp-surface);
}

.sp-auth__input input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--sp-text);
  font-size: 11.5px;
  height: 41px;
  outline: none;
}

.sp-auth__input input::placeholder {
  color: var(--sp-text-faint);
  font-size: 10.5px;
}

.sp-auth__reveal {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--sp-text-faint);
  cursor: pointer;
}

.sp-auth__reveal:hover {
  background: var(--sp-surface-3);
  color: var(--sp-text);
}

.sp-auth__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: -2px;
}

.sp-auth__hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 8.5px;
  color: var(--sp-text-faint);
}

.sp-auth__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 44px;
  margin-top: 3px;
  border: 0;
  border-radius: 11px;
  background: var(--sp-navy);
  color: #fff8ea !important;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 16px 32px -20px rgba(8, 20, 32, .7);
  transition: transform var(--sp-dur) var(--sp-ease), box-shadow var(--sp-dur) var(--sp-ease), background var(--sp-dur) var(--sp-ease);
}

[data-theme="dark"] .sp-auth__submit {
  background: var(--sp-gradient-solar);
  color: #241502 !important;
}

.sp-auth__submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 38px -20px rgba(246, 238, 49, .55);
}

.sp-auth__submit:active {
  transform: translateY(0);
}

.sp-auth__help {
  margin-top: 18px;
  padding-top: 13px;
  border-top: 1px solid var(--sp-border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.sp-auth__help > span {
  font-size: 9px;
  color: var(--sp-text-faint);
}

.sp-auth__help div {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sp-auth__help a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 8.5px;
  color: var(--sp-text-muted) !important;
  direction: ltr;
}

.sp-auth__help a:hover {
  color: var(--sp-solar-strong) !important;
}

.sp-auth__legal {
  margin: 13px 0 0;
  font-size: 8px;
  line-height: 1.9;
  color: var(--sp-text-faint);
}

.sp-auth__demo {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  color: var(--sp-text-muted) !important;
  border: 1px solid var(--sp-border);
  background: var(--sp-surface);
  padding: 7px 12px;
  border-radius: 999px;
}

.sp-auth__demo:hover {
  color: var(--sp-solar-strong) !important;
  border-color: var(--sp-solar-text);
}

/* Responsive ------------------------------------------------------------- */

@media (max-width: 1000px) {
  .sp-auth {
    grid-template-columns: 1fr;
  }

  .sp-auth__visual {
    display: none;
  }

  .sp-auth__mobilebrand {
    display: flex;
  }

  .sp-auth__panel {
    min-height: 100vh;
    justify-content: center;
    background:
      radial-gradient(46rem 30rem at 90% -10%, rgba(246, 238, 49, .14), transparent 60%),
      var(--sp-bg);
  }

  .sp-auth__card {
    margin-top: 34px;
  }
}

@media (max-width: 480px) {
  .sp-auth__panel {
    padding: 16px;
    justify-content: flex-start;
    padding-top: 68px;
  }

  .sp-auth__card {
    padding: 22px 18px 18px;
    border-radius: 18px;
  }

  .sp-auth__toolbar {
    inset-inline: 16px;
    top: 16px;
  }

  .sp-auth__row {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .sp-auth__hint {
    font-size: 8px;
  }
}

/* ==========================================================================
   Login method switcher + mobile (OTP) sign-in
   ========================================================================== */

.sp-auth__switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  border-radius: var(--sp-radius-sm);
  background: var(--sp-surface-2);
  border: 1px solid var(--sp-border);
}

.sp-auth__switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--sp-text-muted);
  transition: background 160ms, color 160ms;
}

.sp-auth__switch:hover { color: var(--sp-text); }

.sp-auth__switch.is-active {
  background: var(--sp-surface);
  color: var(--sp-text);
  box-shadow: var(--sp-shadow-1);
}

.sp-auth__switch.is-active .sp-icon { color: var(--sp-solar-strong); }

.sp-auth__subtitle {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  margin: 18px 0 4px;
}

.sp-auth__subtitle .sp-icon { color: var(--sp-solar-strong); }

.sp-auth__sublead {
  font-size: 10.5px;
  color: var(--sp-text-muted);
  line-height: 2;
  margin-bottom: 10px;
}

.sp-auth__notice--info {
  background: var(--sp-info-soft);
  color: #1c3f86;
  border-color: rgba(62, 114, 223, 0.24);
}

[data-theme="dark"] .sp-auth__notice--info { color: #b9cdf7; }
