*, *::before, *::after { box-sizing: border-box; }
:root {
  --brand-dark: #1b012d;
  --brand-primary: #3e0283;
  --brand-warm: #ed64fc;
  --brand-accent: #d704c5;
  --brand-light: #fdfaff;
  --brand-ink: #1b012d;
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--brand-ink);
  color: #fff;
}
a { color: inherit; text-decoration: none; }
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 0.7fr) minmax(0, 1fr);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.auth-page::before {
  content: '';
  position: absolute;
  inset: -20%;
  z-index: -1;
  background:
    radial-gradient(circle at 18% 25%, rgba(62, 2, 131, 0.42), transparent 24rem),
    radial-gradient(circle at 78% 70%, rgba(237, 100, 252, 0.22), transparent 28rem);
  animation: authGlow 14s ease-in-out infinite alternate;
}
.auth-panel {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(247, 240, 236, 0.96);
  color: var(--brand-ink);
}
.auth-card { width: min(100%, 430px); }
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}
.auth-brand__mark {
  width: 48px;
  height: 48px;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-dark));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 32px rgba(27, 1, 45, 0.24);
}
.auth-brand__mark img { width: 32px; height: 32px; object-fit: contain; border-radius: 0.42rem; }
.auth-brand strong { display: block; font-size: 1rem; font-weight: 900; }
.auth-brand small { color: var(--brand-primary); font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.68rem; }
h1 { margin: 0; font-size: clamp(2rem, 4vw, 3rem); line-height: 1; font-weight: 900; letter-spacing: 0; }
.auth-copy { margin: 0.8rem 0 2rem; color: #6a5546; font-size: 0.98rem; }
.alert {
  margin-bottom: 1rem;
  border: 1px solid rgba(220, 38, 38, 0.18);
  border-radius: 0.8rem;
  padding: 0.85rem 1rem;
  background: rgba(220, 38, 38, 0.08);
  color: #991b1b;
  font-weight: 700;
}
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-dark);
}
.input-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid rgba(27, 1, 45, 0.16);
  border-radius: 0.85rem;
  background: #fff;
  padding: 0 0.9rem;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.input-wrap:focus-within {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px rgba(62, 2, 131, 0.12);
}
.input-wrap i { color: var(--brand-primary); }
.input-wrap input {
  width: 100%;
  min-height: 52px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--brand-ink);
  font: inherit;
  font-weight: 600;
}
.field-hint {
  margin: 0.45rem 0 0;
  color: var(--brand-danger, #991b1b);
  font-size: 0.82rem;
  font-weight: 800;
}
.password-toggle {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-dark);
  background: rgba(62, 2, 131, 0.08);
  cursor: pointer;
}
.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.4rem;
  color: #6a5546;
  font-size: 0.9rem;
  font-weight: 700;
}
.auth-row label { display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer; }
.auth-submit {
  width: 100%;
  min-height: 54px;
  margin-top: 1.5rem;
  border: 0;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-dark));
  color: #fff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 18px 38px rgba(27, 1, 45, 0.24);
  transition: transform 0.16s ease, filter 0.16s ease;
}
.auth-submit:hover { transform: translateY(-1px); filter: brightness(1.04); }
.auth-submit:disabled { cursor: wait; filter: saturate(0.9); opacity: 0.84; }
.auth-divider { align-items:center; color:#8b7894; display:flex; font-size:.76rem; gap:.8rem; margin:1.25rem 0; text-align:center; }
.auth-divider::before,.auth-divider::after { background:rgba(27,1,45,.12); content:''; flex:1; height:1px; }
.auth-google { align-items:center; background:#fff; border:1px solid rgba(27,1,45,.16); border-radius:.85rem; color:#1b012d; display:flex; font-weight:800; gap:.7rem; justify-content:center; min-height:52px; padding:0 1rem; }
.auth-google:hover { border-color:#3e0283; box-shadow:0 0 0 4px rgba(62,2,131,.08); }
.auth-google i { color:#4285f4; }
.auth-switch { color:#6a5546; font-size:.88rem; margin:1.2rem 0 0; text-align:center; }
.auth-switch a { color:#3e0283; font-weight:900; }
.auth-card--register { width:min(100%,620px); }
.auth-fields { display:grid; gap:1rem; grid-template-columns:repeat(2,minmax(0,1fr)); }
.auth-terms { align-items:flex-start; color:#6a5546; display:flex; font-size:.82rem; gap:.55rem; line-height:1.45; margin-top:.25rem; }
.auth-terms input { margin-top:.2rem; }
.auth-status {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(27, 1, 45, 0.12);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.54);
  color: #6a5546;
  font-size: 0.84rem;
}
.auth-status div {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.auth-status span {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
  background: #2f9e44;
  box-shadow: 0 0 0 0 rgba(47, 158, 68, 0.4);
  animation: statusPulse 1.7s ease-in-out infinite;
}
.auth-status strong {
  color: var(--brand-ink);
  font-weight: 900;
}
.auth-status small {
  color: var(--brand-primary);
  font-weight: 800;
}
.auth-visual {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}
.auth-visual::before {
  content: '';
  position: absolute;
  width: min(620px, 76vw);
  aspect-ratio: 1;
  border-radius: 44% 56% 48% 52%;
  background: var(--brand-light);
  opacity: 0.94;
  animation: blob 8s ease-in-out infinite alternate;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.32);
}
.auth-visual__card {
  position: relative;
  width: min(520px, 88%);
  padding: 1.2rem;
  border: 1px solid rgba(247, 240, 236, 0.22);
  border-radius: 1.25rem;
  background: rgba(27, 1, 45, 0.82);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(14px);
  animation: floatCard 5s ease-in-out infinite;
}
.auth-visual__card img { width: min(390px, 86%); display: block; margin: 2.25rem auto; }
.auth-visual__card p { margin: 0; color: #fdfaff; font-size: 1.05rem; line-height: 1.6; }
.auth-visual__card strong { color: #fff; display: block; margin-bottom: 0.35rem; font-size: 1.2rem; }
.auth-visual__ticker {
  position: absolute;
  right: 2rem;
  bottom: 2rem;
  display: flex;
  gap: 0.7rem;
  color: #fdfaff;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.72;
}
.auth-visual__ticker span { animation: pulseText 2.2s ease-in-out infinite; }
.auth-visual__ticker span:nth-child(2) { animation-delay: 0.25s; }
.auth-visual__ticker span:nth-child(3) { animation-delay: 0.5s; }
@keyframes authGlow { to { transform: translate3d(2%, -1%, 0) rotate(5deg) scale(1.05); } }
@keyframes blob { to { border-radius: 56% 44% 58% 42%; transform: rotate(8deg) translateY(-8px); } }
@keyframes floatCard { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes pulseText { 50% { color: #ed64fc; } }
@keyframes statusPulse { 60% { box-shadow: 0 0 0 9px rgba(47, 158, 68, 0); } }
@media (max-width: 940px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-panel { padding: 1.25rem; }
}
@media (max-width: 520px) {
  .auth-status { align-items: flex-start; flex-direction: column; }
  .auth-fields { grid-template-columns:1fr; gap:0; }
}
