:root {
  --text: #122455;
  --muted: #4c628f;
  --surface: rgba(255, 255, 255, 0.62);
  --glass-surface-top: rgba(255, 255, 255, 0.46);
  --glass-surface-bottom: rgba(223, 233, 255, 0.24);
  --glass-border: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --border: #c8d7f1;
  --brand-navy: #1d2f68;
  --brand-blue: #2f7df6;
  --brand-teal: #22c8ef;
  --danger: #8a1f1f;
  --input-border: #b7ccee;
  --input-bg-top: #f8fbff;
  --input-bg-bottom: #e8f0ff;
  --input-inset:
    inset 1px 1px 2px rgba(130, 153, 196, 0.3),
    inset -1px -1px 2px rgba(255, 255, 255, 0.86);
  --btn-surface-top: #f8fbff;
  --btn-surface-bottom: #e8f0ff;
  --btn-surface-border: #acc4ea;
  --btn-shadow:
    6px 6px 12px rgba(99, 126, 177, 0.26),
    -4px -4px 9px rgba(255, 255, 255, 0.8);
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 14%, rgba(34, 200, 239, 0.3), transparent 36%),
    radial-gradient(circle at 86% 6%, rgba(155, 88, 242, 0.26), transparent 34%),
    radial-gradient(circle at 52% 60%, rgba(87, 130, 246, 0.2), transparent 42%),
    linear-gradient(180deg, #f7faff, #eaf0ff);
}

.auth-layout {
  width: min(100% - 2rem, 980px);
  margin-inline: auto;
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  padding: 2.2rem 0;
}

.auth-layout::before,
.auth-layout::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  filter: blur(42px);
}

.auth-layout::before {
  width: min(64vw, 560px);
  height: min(64vw, 560px);
  left: -8%;
  top: 18%;
  background: radial-gradient(
    circle,
    rgba(44, 198, 190, 0.34) 0%,
    rgba(44, 198, 190, 0.12) 38%,
    transparent 72%
  );
}

.auth-layout::after {
  width: min(56vw, 460px);
  height: min(56vw, 460px);
  right: -6%;
  top: 6%;
  background: radial-gradient(
    circle,
    rgba(155, 88, 242, 0.32) 0%,
    rgba(124, 166, 245, 0.16) 45%,
    transparent 74%
  );
}

.auth-brand {
  line-height: 0;
  margin-bottom: 1rem;
}

.auth-logo {
  display: block;
  width: clamp(154px, 22vw, 252px);
  height: auto;
}

.auth-card {
  width: min(100%, 560px);
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, var(--glass-surface-top), var(--glass-surface-bottom));
  -webkit-backdrop-filter: blur(30px) saturate(192%);
  backdrop-filter: blur(30px) saturate(192%);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow:
    0 24px 54px rgba(11, 30, 74, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  padding: 1.35rem;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.08)),
    radial-gradient(circle at 14% 4%, rgba(255, 255, 255, 0.5), transparent 46%);
  pointer-events: none;
}

.auth-card > * {
  position: relative;
  z-index: 1;
}

.auth-header h1 {
  margin: 0.68rem 0 0.45rem;
  font: 700 clamp(1.75rem, 4vw, 2.2rem) / 1.06 "Sora", sans-serif;
  letter-spacing: -0.03em;
  color: var(--brand-navy);
}

.auth-header p {
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  margin: 0;
  display: inline-flex;
  padding: 0.3rem 0.72rem;
  border-radius: 999px;
  background: rgba(21, 36, 95, 0.08);
  color: var(--brand-navy);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 700;
}

.auth-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 1.2rem 0 0.95rem;
}

.mode-button {
  border: 1px solid var(--btn-surface-border);
  border-radius: 11px;
  background: linear-gradient(155deg, var(--btn-surface-top), var(--btn-surface-bottom));
  color: #38517f;
  font: 700 0.92rem/1 "Manrope", sans-serif;
  padding: 0.64rem 0.8rem;
  cursor: pointer;
  box-shadow: var(--btn-shadow);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.mode-button.is-active {
  border-color: rgba(47, 125, 246, 0.74);
  color: #1e4fa5;
  background: linear-gradient(
    115deg,
    rgba(47, 125, 246, 0.3),
    rgba(155, 88, 242, 0.24)
  );
  box-shadow:
    7px 7px 13px rgba(100, 130, 176, 0.22),
    -4px -4px 9px rgba(255, 255, 255, 0.82),
    inset 0 0 0 1px rgba(255, 255, 255, 0.48);
}

.provider-stack {
  display: grid;
  gap: 0.9rem;
  justify-items: center;
}

.provider-button {
  width: 100%;
  border: 1px solid var(--btn-surface-border);
  border-radius: 12px;
  background: linear-gradient(160deg, var(--btn-surface-top), var(--btn-surface-bottom));
  color: #2d4573;
  font: 700 0.92rem/1 "Manrope", sans-serif;
  padding: 0.67rem 0.8rem;
  cursor: pointer;
  box-shadow: var(--btn-shadow);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.provider-button-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.provider-icon {
  width: 1.1rem;
  height: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 1.1rem;
}

.provider-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.provider-icon-shopify {
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 1.1rem;
}

.provider-icon-shopify svg {
  transform: scale(1.2, 1.08);
  transform-origin: center;
}

.provider-button:hover,
.provider-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(47, 125, 246, 0.64);
  background: linear-gradient(160deg, #f9fcff, #eaf2fc);
}

.mode-button:active,
.provider-button:active {
  transform: translateY(0);
  box-shadow:
    inset 2px 2px 4px rgba(122, 149, 189, 0.22),
    inset -2px -2px 4px rgba(255, 255, 255, 0.72);
}

.provider-button-compact {
  width: min(50%, 300px);
}

.more-options {
  width: 100%;
}

.more-options-toggle {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  padding: 0.06rem 0;
  cursor: pointer;
  user-select: none;
}

.more-options-toggle::-webkit-details-marker {
  display: none;
}

.more-options-toggle::before,
.more-options-toggle::after {
  content: "";
  border-top: 1px solid #d6e2f4;
  transition: border-color 160ms ease, opacity 160ms ease;
}

.more-options-text {
  color: #5d6f96;
  font: 700 0.84rem/1 "Manrope", sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0 0.62rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    color 160ms ease,
    opacity 160ms ease;
}

.more-options-text::after {
  content: "";
  width: 0.38rem;
  height: 0.38rem;
  margin-left: 0.32rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  transform-origin: center;
  transition: transform 160ms ease;
}

.more-options-toggle:hover .more-options-text,
.more-options-toggle:focus-visible .more-options-text {
  color: #2357ae;
  opacity: 0.95;
}

.more-options[open] .more-options-toggle {
  color: #2458b1;
}

.more-options[open] .more-options-toggle::before,
.more-options[open] .more-options-toggle::after {
  border-color: rgba(47, 125, 246, 0.6);
}

.more-options[open] .more-options-text {
  color: #2458b1;
}

.more-options[open] .more-options-text::after {
  transform: rotate(225deg) translateY(-1px);
}

.more-options-content {
  margin-top: 0.64rem;
  display: grid;
  justify-items: center;
}

.more-options-content .provider-button {
  width: min(50%, 300px);
}

.divider {
  margin: 1rem 0 0.9rem;
  position: relative;
  text-align: center;
}

.divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px solid #d6e2f4;
}

.divider span {
  position: relative;
  background: transparent;
  padding: 0 0.62rem;
  color: #5d6f96;
  font-size: 0.84rem;
  font-weight: 700;
}

.auth-form {
  display: grid;
  gap: 0.75rem;
}

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

.field {
  display: grid;
  gap: 0.32rem;
}

.field span {
  color: #3f527e;
  font-size: 0.82rem;
  font-weight: 700;
}

.field .field-warning {
  margin: 0;
  color: #aa1f1f;
  font-size: 0.78rem;
  font-weight: 700;
}

.field input {
  width: 100%;
  border: 1px solid var(--input-border);
  border-radius: 10px;
  padding: 0.64rem 0.72rem;
  font: 500 0.94rem/1.2 "Manrope", sans-serif;
  color: var(--text);
  background: linear-gradient(160deg, var(--input-bg-top), var(--input-bg-bottom));
  box-shadow: var(--input-inset);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field input:focus {
  outline: 0;
  border-color: rgba(47, 125, 246, 0.58);
  background: linear-gradient(160deg, #fbfdff, #eef4fd);
  box-shadow:
    var(--input-inset),
    0 0 0 2px rgba(47, 125, 246, 0.2);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 2.8rem;
}

.password-toggle {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #4a6090;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: rgba(47, 125, 246, 0.14);
  color: #1d4e9d;
}

.password-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: currentColor;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  font: 700 0.93rem/1 "Manrope", sans-serif;
  padding: 0.72rem 0.96rem;
  cursor: pointer;
  box-shadow: var(--btn-shadow);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-teal));
  border-color: rgba(47, 125, 246, 0.6);
  box-shadow:
    8px 8px 14px rgba(76, 101, 170, 0.26),
    -4px -4px 9px rgba(255, 255, 255, 0.76);
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
  box-shadow:
    inset 2px 2px 4px rgba(102, 129, 168, 0.22),
    inset -2px -2px 4px rgba(255, 255, 255, 0.72);
}

.auth-message {
  margin: 0.95rem 0 0;
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  font-weight: 700;
  font-size: 0.87rem;
}

.auth-message[data-level="error"] {
  color: var(--danger);
  background: rgba(225, 77, 77, 0.14);
  border: 1px solid rgba(228, 71, 71, 0.3);
}

.auth-message[data-level="success"] {
  color: #0f6648;
  background: rgba(44, 193, 144, 0.14);
  border: 1px solid rgba(44, 193, 144, 0.3);
}

.auth-note {
  margin: 0.95rem 0 0;
  color: #5d7098;
  font-size: 0.82rem;
  font-weight: 600;
}

@media (max-width: 640px) {
  .auth-card {
    padding: 1rem;
  }

  .auth-mode-switch {
    grid-template-columns: 1fr;
  }

  .provider-button-compact,
  .more-options {
    width: 100%;
  }

  .more-options-content .provider-button {
    width: 100%;
  }
}

