*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #000;
  color: #f5f5f7;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ── Light Theme ── */
html.light body { background: #f2f2f7; color: #1c1c1e; }
html.light .auth-bg {
  background: radial-gradient(ellipse 60% 50% at 30% 50%, rgba(0,122,255,0.07) 0%, transparent 60%),
              radial-gradient(ellipse 50% 40% at 70% 50%, rgba(175,82,222,0.05) 0%, transparent 60%);
}
html.light .auth-grid {
  background-image: linear-gradient(rgba(0,0,0,0.04) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(0,0,0,0.04) 1px, transparent 1px);
}
html.light .auth-card {
  background: rgba(255,255,255,0.88);
  border-color: rgba(0,0,0,0.10);
  box-shadow: 0 8px 40px rgba(0,0,0,0.10);
}
html.light .auth-logo-name { color: #1c1c1e; }
html.light .auth-tabs { background: rgba(0,0,0,0.06); }
html.light .auth-tab { color: #6c6c70; }
html.light .auth-tab.active { background: #ffffff; color: #1c1c1e; box-shadow: 0 1px 6px rgba(0,0,0,0.10); }
html.light .field-label { color: #6c6c70; }
html.light .field-input {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.12);
  color: #1c1c1e;
}
html.light .field-input::placeholder { color: #aeaeb2; }
html.light .field-input:focus { border-color: rgba(0,122,255,0.50); background: #fff; }
html.light .pw-eye { color: #aeaeb2; }
html.light .pw-eye:hover { color: #6c6c70; }
html.light .auth-footer { color: #6c6c70; }
html.light .auth-footer a { color: #007aff; }
html.light .auth-divider { color: #aeaeb2; }
html.light .auth-divider::before, html.light .auth-divider::after { background: rgba(0,0,0,0.10); }
html.light .spinner { border-color: rgba(255,255,255,0.4); border-top-color: #fff; }
.auth-bg {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse 60% 50% at 30% 50%, rgba(10,132,255,0.1) 0%, transparent 60%),
              radial-gradient(ellipse 50% 40% at 70% 50%, rgba(191,90,242,0.08) 0%, transparent 60%);
  pointer-events: none;
}
.auth-grid {
  position: fixed; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}
.auth-card {
  position: relative;
  width: 100%; max-width: 420px;
  padding: 40px 36px;
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  box-shadow: 0 8px 60px rgba(0,0,0,0.5);
  margin: 20px;
}
.auth-logo {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 32px;
}
.auth-logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #0a84ff, #5ac8fa);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 2px 16px rgba(10,132,255,0.4);
  flex-shrink: 0;
}
.auth-logo-name { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
.auth-tabs { display: flex; gap: 4px; margin-bottom: 28px; background: rgba(255,255,255,0.05); border-radius: 12px; padding: 4px; }
.auth-tab {
  flex: 1; padding: 10px;
  border: none; background: transparent; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600;
  color: #86868b; border-radius: 9px;
  transition: all 0.2s;
}
.auth-tab.active { background: rgba(255,255,255,0.1); color: #f5f5f7; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 600; color: #86868b; }
.field-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  font-family: inherit; font-size: 15px;
  color: #f5f5f7;
  outline: none;
  transition: border-color 0.15s;
}
.field-input:focus { border-color: rgba(10,132,255,0.6); background: rgba(10,132,255,0.05); }
.field-input::placeholder { color: #48484a; }
.auth-btn {
  width: 100%;
  padding: 14px;
  background: #0a84ff;
  color: #fff;
  border: none; border-radius: 12px;
  font-family: inherit; font-size: 15px; font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 4px 20px rgba(10,132,255,0.3);
  margin-top: 6px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.auth-btn:hover { background: #007aff; transform: translateY(-1px); box-shadow: 0 6px 28px rgba(10,132,255,0.4); }
.auth-btn:active { transform: translateY(0); }
.auth-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.auth-error {
  padding: 12px 14px;
  background: rgba(255,69,58,0.1);
  border: 1px solid rgba(255,69,58,0.3);
  border-radius: 10px;
  font-size: 13px;
  color: #ff453a;
  display: none;
}
.auth-error.visible { display: block; }
.auth-footer {
  margin-top: 20px; text-align: center;
  font-size: 13px; color: #86868b;
}
.auth-footer a { color: #0a84ff; font-weight: 600; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 4px 0; color: #48484a; font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1;
  height: 1px; background: rgba(255,255,255,0.08);
}
.form-panel { display: none; }
.form-panel.active { display: flex; flex-direction: column; gap: 14px; }

/* password eye toggle */
.field-pw-wrap {
  position: relative;
  display: flex; align-items: center;
}
.field-pw-wrap .field-input {
  padding-right: 44px;
}
.pw-eye {
  position: absolute; right: 0;
  width: 42px; height: 100%;
  background: transparent; border: none;
  color: #86868b; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: 0 12px 12px 0;
  transition: color 0.15s;
  flex-shrink: 0;
}
.pw-eye:hover { color: #f5f5f7; }

.auth-success {
  padding: 12px 14px;
  background: rgba(52,199,89,0.1);
  border: 1px solid rgba(52,199,89,0.3);
  border-radius: 10px;
  font-size: 13px;
  color: #34c759;
  display: none;
}
.auth-success.visible { display: block; }
html.light .auth-success { background: rgba(52,199,89,0.08); border-color: rgba(52,199,89,0.25); color: #248a3d; }

/* ── Dusty Lilac Theme ── */
html.lilac body { background: #f8f0fb; color: #2d1040; }
html.lilac .auth-bg {
  background: radial-gradient(ellipse 60% 50% at 30% 50%, rgba(155,89,182,0.12) 0%, transparent 60%),
              radial-gradient(ellipse 50% 40% at 70% 50%, rgba(216,180,226,0.10) 0%, transparent 60%);
}
html.lilac .auth-grid {
  background-image: linear-gradient(rgba(155,89,182,0.04) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(155,89,182,0.04) 1px, transparent 1px);
}
html.lilac .auth-card {
  background: rgba(248,240,251,0.92);
  border-color: rgba(180,120,200,0.20);
  box-shadow: 0 8px 40px rgba(155,89,182,0.12);
}
html.lilac .auth-logo-name { color: #2d1040; }
html.lilac .auth-tabs { background: rgba(180,120,200,0.10); }
html.lilac .auth-tab { color: #7a4d8f; }
html.lilac .auth-tab.active { background: #ffffff; color: #2d1040; box-shadow: 0 1px 6px rgba(155,89,182,0.12); }
html.lilac .field-label { color: #7a4d8f; }
html.lilac .field-input {
  background: rgba(180,120,200,0.08);
  border-color: rgba(180,120,200,0.18);
  color: #2d1040;
}
html.lilac .field-input::placeholder { color: #c4a0d0; }
html.lilac .field-input:focus { border-color: rgba(155,89,182,0.50); background: rgba(248,240,251,0.95); }
html.lilac .pw-eye { color: #c4a0d0; }
html.lilac .pw-eye:hover { color: #7a4d8f; }
html.lilac .auth-footer { color: #7a4d8f; }
html.lilac .auth-footer a { color: #9b59b6; }
html.lilac .auth-divider { color: #c4a0d0; }
html.lilac .auth-divider::before, html.lilac .auth-divider::after { background: rgba(180,120,200,0.15); }
html.lilac .auth-btn { background: #9b59b6; box-shadow: 0 4px 20px rgba(155,89,182,0.30); }
html.lilac .auth-btn:hover { background: #8e44ad; box-shadow: 0 6px 28px rgba(155,89,182,0.40); }
html.lilac .spinner { border-color: rgba(255,255,255,0.4); border-top-color: #fff; }
html.lilac .btn-google { background: #fff; border-color: rgba(180,120,200,0.20); color: #2d1040; box-shadow: 0 1px 4px rgba(155,89,182,0.08); }
html.lilac .btn-google:hover { background: #f8f0fb; border-color: rgba(180,120,200,0.30); }
html.lilac .auth-success { background: rgba(46,204,113,0.08); border-color: rgba(46,204,113,0.25); color: #1a8a3d; }

/* Google button */
.btn-google {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  color: #f5f5f7;
  cursor: pointer;
  transition: all 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  text-decoration: none;
  box-sizing: border-box;
}
.btn-google:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); transform: translateY(-1px); }
.btn-google:active { transform: translateY(0); }
html.light .btn-google {
  background: #fff;
  border-color: rgba(0,0,0,0.15);
  color: #1c1c1e;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
html.light .btn-google:hover { background: #f5f5f7; border-color: rgba(0,0,0,0.2); }

/* spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
