/* WeakAI Auth — 1:1 stitch_ai login/register (DESIGN.md + code.html) */
@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0');

:root {
  --auth-surface: #f7f9fb;
  --auth-surface-lowest: #ffffff;
  --auth-surface-container: #eceef0;
  --auth-on-surface: #191c1e;
  --auth-on-surface-variant: #404850;
  --auth-outline: #707881;
  --auth-outline-variant: #bfc7d1;
  --auth-primary: #005d90;
  --auth-primary-container: #0077b6;
  --auth-on-primary: #ffffff;
  --auth-primary-fixed: #cde5ff;
  --auth-secondary: #525f71;
  --auth-secondary-container: #d3e1f6;
  --auth-on-secondary-container: #566475;
  --auth-xs: 4px;
  --auth-sm: 8px;
  --auth-md: 16px;
  --auth-lg: 24px;
  --auth-xl: 32px;
  --auth-gutter: 16px;
  --auth-right-w: 500px;
  --auth-radius-lg: 4px;
  --auth-radius-xl: 8px;
  --auth-radius-full: 12px;
}

body.auth-stitch-body {
  margin: 0;
  overflow: hidden;
  background: var(--auth-surface);
}

body.auth-stitch-body #app {
  min-height: 100vh;
}

.auth-stitch-page .material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  font-size: 24px;
  line-height: 1;
  user-select: none;
}

.auth-stitch-main {
  display: flex;
  min-height: 100vh;
}

/* Left hero — exact code.html structure */
.auth-stitch-hero {
  display: none;
  flex: 1;
  position: relative;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--auth-primary-container);
}

@media (min-width: 1024px) {
  .auth-stitch-hero { display: flex; }
}

.auth-stitch-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.4;
  mix-blend-mode: overlay;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.auth-stitch-hero__grad {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: linear-gradient(to bottom right, rgba(0, 119, 182, 0.8), transparent, rgba(0, 93, 144, 0.6));
}

.auth-stitch-hero__content {
  position: relative;
  z-index: 20;
  padding-left: var(--auth-xl);
  padding-right: var(--auth-xl);
  max-width: 42rem;
}

.auth-stitch-brand-row {
  display: flex;
  align-items: center;
  gap: var(--auth-sm);
  margin-bottom: var(--auth-lg);
}

.auth-stitch-brand-icon {
  width: 48px;
  height: 48px;
  background: var(--auth-surface-lowest);
  border-radius: var(--auth-radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-stitch-brand-icon .material-symbols-outlined {
  color: var(--auth-primary);
  font-size: 30px;
}

.auth-stitch-brand-title {
  font-size: 32px;
  line-height: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--auth-on-primary);
  margin: 0;
}

.auth-stitch-headline {
  font-size: 48px;
  line-height: 56px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--auth-on-primary);
  margin: 0 0 var(--auth-md);
}

.auth-stitch-headline span {
  color: var(--auth-primary-fixed);
  font-weight: 800;
}

.auth-stitch-desc {
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  color: rgba(205, 229, 255, 0.9);
  max-width: 32rem;
  margin: 0 0 var(--auth-xl);
}

.auth-stitch-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--auth-md);
  margin-top: 48px;
}

.auth-stitch-stat {
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.1);
  padding: var(--auth-md);
  border-radius: var(--auth-radius-full);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-stitch-stat strong {
  display: block;
  color: var(--auth-on-primary);
  font-size: 20px;
  line-height: 28px;
  font-weight: 700;
}

.auth-stitch-stat span {
  display: block;
  color: var(--auth-primary-fixed);
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.05em;
  font-weight: 500;
  opacity: 0.8;
}

.auth-stitch-hero__foot {
  position: absolute;
  bottom: var(--auth-xl);
  left: var(--auth-xl);
  z-index: 20;
  display: flex;
  gap: var(--auth-lg);
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* Right panel — exact 500px */
.auth-stitch-panel {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--auth-surface);
  padding: var(--auth-gutter);
}

@media (min-width: 1024px) {
  .auth-stitch-panel { width: var(--auth-right-w); flex-shrink: 0; }
}

.auth-stitch-panel__inner {
  width: 100%;
  max-width: 28rem; /* max-w-md = 448px */
}

.auth-stitch-mobile-brand {
  display: flex;
  align-items: center;
  gap: var(--auth-xs);
  margin-bottom: var(--auth-xl);
  justify-content: center;
}

@media (min-width: 1024px) {
  .auth-stitch-mobile-brand { display: none; }
}

.auth-stitch-mobile-brand .material-symbols-outlined {
  color: var(--auth-primary);
  font-size: 30px;
}

.auth-stitch-mobile-brand span:last-child {
  font-size: 24px;
  line-height: 32px;
  font-weight: 700;
  color: var(--auth-primary);
}

.auth-stitch-card {
  background: var(--auth-surface-lowest);
  padding: var(--auth-xl);
  border-radius: var(--auth-radius-full);
  border: 1px solid var(--auth-outline-variant);
  box-shadow: 0 4px 24px rgba(0, 119, 182, 0.04);
}

.auth-stitch-card__head {
  margin-bottom: var(--auth-xl);
}

.auth-stitch-card__head h3 {
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
  color: var(--auth-on-surface);
  margin: 0 0 var(--auth-xs);
}

.auth-stitch-card__head p {
  font-size: 14px;
  line-height: 20px;
  color: var(--auth-on-surface-variant);
  margin: 0;
}

.auth-stitch-tabs {
  display: flex;
  border-bottom: 1px solid var(--auth-outline-variant);
  margin-bottom: var(--auth-xl);
  position: relative;
}

.auth-stitch-tab {
  flex: 1;
  padding: var(--auth-md) 0;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--auth-on-surface-variant);
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  font-family: inherit;
}

.auth-stitch-tab.is-active {
  color: var(--auth-primary);
}

.auth-stitch-tab.is-active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--auth-primary);
}

.auth-stitch-forms {
  display: flex;
  flex-direction: column;
  gap: var(--auth-lg);
}

.auth-stitch-fields {
  display: flex;
  flex-direction: column;
  gap: var(--auth-md);
}

.auth-stitch-fields.is-hidden { display: none; }

.auth-stitch-field {
  display: flex;
  flex-direction: column;
  gap: var(--auth-xs);
}

.auth-stitch-field label {
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.05em;
  font-weight: 500;
  color: var(--auth-on-surface-variant);
}

.auth-stitch-input-wrap {
  position: relative;
}

.auth-stitch-input-wrap > .material-symbols-outlined.auth-ico-left {
  position: absolute;
  left: var(--auth-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--auth-on-surface-variant);
  font-size: 18px;
  pointer-events: none;
}

.auth-stitch-input-wrap > .auth-ico-right {
  position: absolute;
  right: var(--auth-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--auth-on-surface-variant);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.auth-stitch-input-wrap > .auth-ico-right:hover {
  color: var(--auth-on-surface);
}

.auth-stitch-input-wrap > .auth-ico-right .material-symbols-outlined {
  font-size: 18px;
}

.auth-stitch-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--auth-surface);
  border: 1px solid var(--auth-outline-variant);
  border-radius: var(--auth-radius-lg);
  padding: var(--auth-md);
  padding-left: 44px;
  font-size: 14px;
  line-height: 20px;
  color: var(--auth-on-surface);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}

.auth-stitch-input:focus {
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 1px var(--auth-primary);
}

.auth-stitch-code-row {
  display: flex;
  gap: var(--auth-sm);
}

.auth-stitch-code-row .auth-stitch-input-wrap { flex: 1; }

.auth-stitch-code-btn {
  padding: 0 var(--auth-md);
  color: var(--auth-primary);
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.05em;
  font-weight: 500;
  background: var(--auth-secondary-container);
  border: none;
  border-radius: var(--auth-radius-lg);
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}

.auth-stitch-code-btn:hover { background: rgba(211, 225, 246, 0.8); }
.auth-stitch-code-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-stitch-utils {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.auth-stitch-utils label {
  display: flex;
  align-items: center;
  gap: var(--auth-xs);
  cursor: pointer;
  color: var(--auth-on-surface-variant);
}

.auth-stitch-utils label:hover { color: var(--auth-on-surface); }

.auth-stitch-utils input[type="checkbox"] {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  border: 1px solid var(--auth-outline-variant);
  accent-color: var(--auth-primary);
}

.auth-stitch-utils a {
  color: var(--auth-primary);
  text-decoration: none;
}

.auth-stitch-utils a:hover { text-decoration: underline; }

.auth-stitch-submit {
  width: 100%;
  box-sizing: border-box;
  background: var(--auth-primary-container);
  color: var(--auth-on-primary);
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.05em;
  font-weight: 600;
  padding: var(--auth-lg) 0;
  border: none;
  border-radius: var(--auth-radius-lg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--auth-sm);
  font-family: inherit;
  transition: opacity .15s, transform .1s;
}

.auth-stitch-submit:hover { opacity: 0.9; }
.auth-stitch-submit:active { transform: scale(0.98); }
.auth-stitch-submit:disabled { opacity: 0.65; cursor: not-allowed; }
.auth-stitch-submit .material-symbols-outlined {
  font-size: 18px;
  transition: transform .15s;
}
.auth-stitch-submit:hover .material-symbols-outlined {
  transform: translateX(4px);
}

.auth-stitch-divider {
  position: relative;
  padding: var(--auth-md) 0;
}

.auth-stitch-divider::before {
  content: '';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  border-top: 1px solid var(--auth-outline-variant);
  top: 50%;
  height: 0;
}

.auth-stitch-divider span {
  position: relative;
  display: block;
  width: fit-content;
  margin: 0 auto;
  background: var(--auth-surface-lowest);
  padding: 0 var(--auth-md);
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.05em;
  color: var(--auth-on-surface-variant);
}

.auth-stitch-social {
  display: flex;
  justify-content: center;
  gap: var(--auth-xl);
}

.auth-stitch-social button {
  padding: var(--auth-sm);
  border-radius: 9999px;
  border: 1px solid var(--auth-outline-variant);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}

.auth-stitch-social button:hover { background: var(--auth-surface); }
.auth-stitch-social .material-symbols-outlined {
  color: var(--auth-secondary);
  font-size: 24px;
}

.auth-stitch-switch {
  text-align: center;
  font-size: 14px;
  line-height: 20px;
  color: var(--auth-on-surface-variant);
  padding-top: var(--auth-md);
  margin: 0;
}

.auth-stitch-switch a {
  color: var(--auth-primary);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.auth-stitch-switch a:hover { text-decoration: underline; }

.auth-stitch-stores {
  margin-top: var(--auth-xl);
  display: flex;
  justify-content: center;
  gap: var(--auth-md);
  opacity: 0.4;
}

.auth-stitch-store {
  display: flex;
  align-items: center;
  gap: var(--auth-xs);
  padding: var(--auth-xs) var(--auth-md);
  border: 1px solid var(--auth-outline-variant);
  border-radius: var(--auth-radius-lg);
  filter: grayscale(1);
  cursor: pointer;
  transition: filter .15s;
  background: transparent;
  font-family: inherit;
  color: inherit;
}

.auth-stitch-store:hover { filter: grayscale(0); }
.auth-stitch-store .material-symbols-outlined { font-size: 18px; }
.auth-stitch-store b {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
}

.auth-stitch-error {
  background: #ffdad6;
  color: #93000a;
  border: 1px solid #ffdad6;
  border-radius: var(--auth-radius-lg);
  padding: var(--auth-sm) var(--auth-md);
  font-size: 13px;
  line-height: 18px;
  margin-bottom: var(--auth-md);
}

.auth-stitch-error.is-hidden { display: none; }

/* Register-specific: denser fields still same card width */
.auth-stitch-card.is-register .auth-stitch-forms {
  gap: var(--auth-md);
}
