/* ==========================================================================
   MX Store — Full-Screen Authentication Screen
   Compact Purple Hero with Graphic Lines + Raised White Content + Bottom-Anchored Footer
   ========================================================================== */

html:has(body.auth-page) {
  scrollbar-gutter: auto;
  overflow-y: auto;
  background: #ffffff;
}

.auth-page {
  background: #ffffff;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.auth-page::before {
  display: none !important;
}

.auth-shell {
  width: 100%;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

.auth-card {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

/* --------------------------------------------------------------------------
   Upper Layer — Compact Brand Purple Cover with Graphic Vector Lines
   -------------------------------------------------------------------------- */
.auth-cover {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: calc(50svh - 108px);
  padding: max(22px, env(safe-area-inset-top)) 24px 44px;
  color: #ffffff;
  background: linear-gradient(135deg, #4422cb 0%, #5833e7 50%, #7246f6 100%);
}

/* Dynamic Geometric Vector Lines & Flowing Waves */
.auth-cover-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.auth-cover-lines svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Ambient glow orb on top right */
.auth-cover::after {
  content: '';
  position: absolute;
  z-index: -2;
  top: -40px;
  right: -40px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(147, 102, 255, 0.4) 0%, transparent 70%);
  pointer-events: none;
}

.auth-cover-top {
  width: 100%;
  max-width: 440px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin: 0 auto 16px;
}

.auth-brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-decoration: none;
}

.auth-monogram {
  display: inline-flex;
  align-items: baseline;
  font-size: 26px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: -2px;
  color: #ffffff;
}

.auth-monogram span {
  color: #ff6b00; /* Signature MX Orange */
  padding-inline-start: 1px;
}

.auth-intro {
  width: 100%;
  max-width: 440px;
  margin: auto auto 0;
}

.auth-intro h1 {
  margin: 0 0 4px;
  font-size: clamp(28px, 6vw, 34px);
  font-weight: 750;
  letter-spacing: -1px;
  line-height: 1.15;
  color: #ffffff;
}

.auth-intro-copy {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(240, 235, 255, 0.92);
}

/* --------------------------------------------------------------------------
   Lower Layer — Raised Clean White Content (Expanded to Fill Bottom)
   -------------------------------------------------------------------------- */
.auth-content {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-top: -24px;
  padding: 30px 24px max(24px, env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  background: #ffffff;
  box-shadow: 0 -8px 26px rgba(28, 16, 75, 0.07);
}

.auth-content-inner {
  width: 100%;
  max-width: 440px;
  flex: 1;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-main-action {
  width: 100%;
}

.auth-content h2 {
  margin: 0 0 6px;
  font-size: clamp(21px, 4.6vw, 24px);
  font-weight: 750;
  letter-spacing: -0.5px;
  line-height: 1.25;
  color: #12101a;
}

.auth-description {
  margin: 0 0 22px;
  font-size: 14.5px;
  line-height: 1.5;
  color: #636175;
}

/* --------------------------------------------------------------------------
   The Brand Google Button — Harmonious Dual-Tone (Purple + White)
   -------------------------------------------------------------------------- */
.auth-google {
  width: 100%;
  min-height: 60px;
  padding: 8px 12px;
  display: grid;
  grid-template-columns: 40px 1fr 36px;
  align-items: center;
  gap: 12px;
  border: 1.5px solid #5b35f2;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f4edff 100%);
  color: #1e114b;
  box-shadow:
    0 10px 25px -5px rgba(91, 53, 242, 0.25),
    0 2px 6px rgba(91, 53, 242, 0.08),
    inset 0 1px 0 #ffffff;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.auth-google-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(91, 53, 242, 0.14);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.auth-google-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

[data-google-label] {
  text-align: center;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.2px;
  color: #1e114b;
}

.auth-google-arrow {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6c47ff 0%, #4e26e8 100%);
  color: #ffffff;
  box-shadow: 0 4px 10px -2px rgba(91, 53, 242, 0.45);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.auth-google-arrow svg {
  width: 18px;
  height: 18px;
}

.auth-google:hover:not(:disabled) {
  background: linear-gradient(180deg, #ffffff 0%, #ebe2fe 100%);
  border-color: #4821dd;
  box-shadow:
    0 14px 30px -4px rgba(91, 53, 242, 0.35),
    0 4px 12px rgba(91, 53, 242, 0.14);
  transform: translateY(-2px);
}

.auth-google:hover:not(:disabled) .auth-google-arrow {
  transform: translateX(3px);
  box-shadow: 0 6px 14px -2px rgba(91, 53, 242, 0.55);
}

.auth-google:active:not(:disabled) {
  transform: translateY(0);
  background: #ebe2fe;
  box-shadow: 0 4px 12px -2px rgba(91, 53, 242, 0.2);
}

.auth-google:focus-visible {
  outline: 3px solid #ff6b00; /* Signature MX Orange for sharp contrast */
  outline-offset: 3px;
}

.auth-google:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-google[aria-busy="true"] {
  opacity: 0.95;
  cursor: wait;
}

.auth-google[aria-busy="true"] .auth-google-arrow {
  display: none;
}

.auth-spinner {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(91, 53, 242, 0.25);
  border-top-color: #5b35f2;
  border-radius: 50%;
  animation: auth-spin 0.8s linear infinite;
}

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

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   Footer Action Block — Pushed to Bottom of Viewport
   -------------------------------------------------------------------------- */
.auth-footer-action {
  width: 100%;
  margin-top: auto;
  padding-top: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-consent {
  width: 100%;
  margin: 0;
  text-align: center;
}

.auth-consent p {
  margin: 0;
  color: #727084;
  font-size: 12.5px;
  line-height: 1.8;
}

.auth-text-link {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: #5531ea;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(85, 49, 234, 0.4);
  cursor: pointer;
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

.auth-text-link:hover {
  color: #3b16cf;
  text-decoration-color: currentColor;
}

.auth-text-link:focus-visible {
  outline: 2px solid #ff6b00;
  outline-offset: 2px;
  border-radius: 2px;
}

.auth-support {
  margin-top: 14px;
  padding: 6px 12px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #727084;
  text-decoration: none;
  align-self: center;
  transition: color var(--transition-fast);
}

.auth-support span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #5531ea;
  font-weight: 650;
  transition: transform var(--transition-fast);
}

.auth-support svg {
  width: 14px;
  height: 14px;
}

.auth-support:hover span {
  color: #3b16cf;
  transform: translateX(2px);
}

.auth-support:focus-visible {
  outline: 2px solid #ff6b00;
  outline-offset: 3px;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Messages & Flash Alerts
   -------------------------------------------------------------------------- */
.auth-message:empty {
  display: none;
}

.auth-message {
  margin-top: 14px;
  font-size: 13px;
}

.auth-message .flash {
  padding: 12px 16px;
  margin: 0;
  border-radius: 12px;
  line-height: 1.5;
  text-align: center;
}

.auth-message .flash.error {
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border: 1px solid rgba(180, 47, 66, 0.2);
}

.auth-message .flash.success {
  background: var(--status-success-bg);
  color: var(--status-success);
  border: 1px solid rgba(21, 114, 78, 0.2);
}

/* --------------------------------------------------------------------------
   Notice Dialog (Terms / Privacy Modal)
   -------------------------------------------------------------------------- */
.auth-notice {
  width: min(520px, calc(100% - 32px));
  max-height: calc(100svh - 48px);
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 24px;
  color: var(--text);
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(24, 16, 48, 0.25);
}

.auth-notice::backdrop {
  background: rgba(18, 12, 38, 0.55);
  backdrop-filter: blur(4px);
}

.auth-notice-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.auth-notice-heading h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.4px;
}

.auth-notice-close {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--surface-raised);
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.auth-notice-close svg {
  width: 20px;
  height: 20px;
}

.auth-notice-close:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.auth-notice-close:focus-visible {
  outline: 2px solid #ff6b00;
}

.auth-notice p {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.auth-notice p:last-child {
  margin-bottom: 0;
}

.auth-notice a {
  color: #5531ea;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Desktop Adjustments
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
  .auth-cover {
    min-height: calc(50svh - 120px);
    padding-top: 28px;
    padding-bottom: 44px;
  }
  .auth-cover-top {
    max-width: 440px;
    margin-bottom: 20px;
  }
  .auth-intro {
    max-width: 440px;
  }
  .auth-content {
    margin-top: -24px;
    padding: 36px 32px 40px;
  }
  .auth-content-inner {
    max-width: 440px;
  }
  .auth-footer-action {
    padding-top: 48px;
  }
}

@media (max-width: 480px) {
  .auth-cover {
    padding: max(16px, env(safe-area-inset-top)) 18px 36px;
  }
  .auth-cover-top {
    margin-bottom: 14px;
  }
  .auth-content {
    padding: 26px 18px max(20px, env(safe-area-inset-bottom));
  }
  .auth-intro h1 {
    font-size: 28px;
  }
}

@media (max-width: 359px) {
  .auth-cover, .auth-content {
    padding-left: 14px;
    padding-right: 14px;
  }
  .auth-intro h1 {
    font-size: 26px;
  }
  .auth-content h2 {
    font-size: 19px;
  }
  .auth-google {
    gap: 8px;
    padding-inline: 8px;
  }
  [data-google-label] {
    font-size: 14.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-page *,
  .auth-page *::before,
  .auth-page *::after {
    animation: none !important;
    transition: none !important;
  }
}
