:root {
  --bg: #060708;
  --bg-2: #101216;
  --ink: #f3f4f6;
  --muted: #a7acb5;
  --line: rgba(255, 255, 255, 0.10);

  /* ---- Liquid Glass tokens (monochrome) ---- */
  --glass:        rgba(255, 255, 255, 0.06);   /* translucent surface  */
  --glass-strong: rgba(255, 255, 255, 0.11);   /* inputs / pills       */
  --glass-line:   rgba(255, 255, 255, 0.20);   /* rim / edge highlight */
  --glass-blur:   26px;
  --glass-sat:    140%;
  --sheen:        rgba(255, 255, 255, 0.55);    /* specular top light   */

  --card: rgba(255, 255, 255, 0.055);
  /* grayscale "brand" ramp used for pills, buttons, focus, accents */
  --brand:   #d6d9e0;   /* light silver */
  --brand-2: #8b9099;   /* mid gray     */
  --accent:  #e7eaf0;   /* near-white   */
  --danger:  #ff7b8f;
  --radius: 26px;
  --shadow:
    0 30px 80px -20px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 var(--sheen),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 48px);
  overflow-x: hidden;
  perspective: 1500px; /* 3D stage for card tilt */
}

/* ---------- Responsive animated background ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 600px at 80% -10%, #24262b 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 110%, #1a1c20 0%, transparent 55%),
    radial-gradient(700px 700px at 50% 120%, #2a2d33 0%, transparent 55%),
    linear-gradient(160deg, var(--bg), var(--bg-2));
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  animation: float 18s ease-in-out infinite;
  mix-blend-mode: screen;
}
.orb--1 { width: 42vmax; height: 42vmax; left: -8vmax; top: -10vmax; background: radial-gradient(circle, #4a4e57, transparent 70%); }
.orb--2 { width: 38vmax; height: 38vmax; right: -10vmax; bottom: -12vmax; background: radial-gradient(circle, #3a3d44, transparent 70%); animation-delay: -6s; }
.orb--3 { width: 26vmax; height: 26vmax; left: 40%; top: 55%; background: radial-gradient(circle, #5a5e68, transparent 70%); opacity: 0.4; animation-delay: -11s; }

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 75%);
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(2vmax, -2vmax) scale(1.08); }
}

/* ---------- Shell layout ---------- */
.shell {
  position: relative;
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--card);
  border: 1px solid var(--glass-line);
  border-radius: calc(var(--radius) + 8px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.2s ease-out;
  will-change: transform;
}
/* specular sheen sweeping the top edge — the glassy "wet" highlight */
.shell::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.16) 0%, transparent 22%),
    radial-gradient(120% 70% at 50% -20%, rgba(255,255,255,0.18), transparent 60%);
  mix-blend-mode: screen;
  z-index: 3;
}

/* ---------- Brand panel ---------- */
.panel {
  position: relative;
  padding: clamp(28px, 4vw, 44px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  background:
    linear-gradient(160deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02)),
    rgba(255,255,255,0.015);
  border-right: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; }
.brand__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 8px 20px -8px var(--brand);
  color: #fff;
  font-size: 16px;
}
.brand__name { letter-spacing: -0.02em; }
.brand__name b { color: var(--brand); font-weight: 800; }

.panel__title {
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}
.panel__sub { color: var(--muted); line-height: 1.6; max-width: 38ch; }

.features { list-style: none; margin-top: 22px; display: grid; gap: 12px; }
.features li { display: flex; align-items: center; gap: 12px; color: #cdd4ea; font-size: 0.95rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--brand)); box-shadow: 0 0 12px var(--accent); flex: none; }

.panel__foot { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.85rem; }
.avatars { display: flex; }
.av { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--bg-2); margin-left: -8px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.av:first-child { margin-left: 0; }
.av:nth-child(2) { background: linear-gradient(135deg, var(--accent), var(--brand)); }
.av:nth-child(3) { background: linear-gradient(135deg, var(--brand-2), #5a5e68); }

/* ---------- Card / forms ---------- */
.card { padding: clamp(26px, 3.5vw, 40px); position: relative; }

.card__tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--glass-strong);
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  padding: 5px;
  margin-bottom: 26px;
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}
.tab {
  position: relative;
  z-index: 2;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  padding: 11px 0;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.25s;
}
.tab.is-active { color: #0b0d10; }
.tab__pill {
  position: absolute;
  z-index: 1;
  top: 5px;
  left: 5px;
  width: calc(50% - 5px);
  height: calc(100% - 10px);
  border-radius: 999px;
  background: linear-gradient(135deg, #f2f3f6, #c9cdd6);
  box-shadow:
    0 8px 22px -6px rgba(0,0,0,0.55),
    inset 0 1px 0 rgba(255,255,255,0.9),
    inset 0 -2px 6px rgba(0,0,0,0.12);
  transition: transform 0.5s cubic-bezier(.65,.05,.1,1); /* liquid morph */
}
.tab__pill.right { transform: translateX(100%); }

.form { display: none; flex-direction: column; gap: 16px; animation: fade 0.4s ease; }
.form.is-active { display: flex; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.form__head h2 { font-size: 1.5rem; letter-spacing: -0.02em; }
.form__head p { color: var(--muted); margin-top: 6px; font-size: 0.92rem; }

.field { display: grid; gap: 7px; }
.field > label { font-size: 0.85rem; font-weight: 600; color: #c4cbe4; }

.input {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-line);
  border-radius: 16px;
  padding: 0 14px;
  backdrop-filter: blur(8px) saturate(150%);
  -webkit-backdrop-filter: blur(8px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.input:focus-within { border-color: rgba(255,255,255,0.6); box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 0 0 4px rgba(255,255,255,0.14); background: rgba(255,255,255,0.16); }
.input.invalid { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(255,107,129,0.15); }
.input.valid { border-color: rgba(67,232,195,0.55); }
.ic { width: 20px; height: 20px; color: var(--muted); flex: none; }
.input input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  padding: 13px 0;
}
.input input::placeholder { color: #6c7596; }
.toggle {
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
  border-radius: 8px;
  flex: none;
  transition: color 0.2s;
}
.toggle:hover { color: var(--ink); }
.toggle svg { width: 18px; height: 18px; }

.error { color: var(--danger); font-size: 0.78rem; min-height: 0; }

.meter { height: 6px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; border-radius: 999px; transition: width 0.3s, background 0.3s; }

.row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.86rem; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.link { color: var(--brand); text-decoration: none; font-size: 0.86rem; font-weight: 600; }
.link:hover { text-decoration: underline; }

.btn {
  position: relative;
  overflow: hidden;
  margin-top: 4px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 16px;
  padding: 15px;
  font: inherit;
  font-weight: 700;
  color: #0b0d10;
  cursor: pointer;
  background: linear-gradient(135deg, #f4f5f8, #cfd3db);
  box-shadow:
    0 14px 32px -10px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.9),
    inset 0 -3px 8px rgba(0,0,0,0.12);
  transition: transform 0.18s, box-shadow 0.25s, filter 0.25s;
}
/* glossy specular sweep across the top half */
.btn::before {
  content: "";
  position: absolute;
  inset: 0 0 50% 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.35), transparent);
  pointer-events: none;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 20px 42px -10px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.95); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: 0.7; cursor: progress; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.78rem; margin: 4px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.socials { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--glass-line);
  background: var(--glass-strong);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  padding: 13px;
  border-radius: 16px;
  cursor: pointer;
  backdrop-filter: blur(8px) saturate(150%);
  -webkit-backdrop-filter: blur(8px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.social:hover { background: rgba(255,255,255,0.2); border-color: var(--brand); transform: translateY(-1px); }
.social:active { transform: translateY(0); }
.social[disabled] { opacity: 0.6; cursor: progress; }
.social__ic { width: 18px; height: 18px; flex: none; }

/* Google button gets a touch of brand colour on hover */
.social--google:hover { border-color: rgba(255,255,255,0.5); box-shadow: 0 0 0 3px rgba(255,255,255,0.1); }

/* ---------- Simulated OAuth modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s, visibility 0.25s;
}
.modal.open { visibility: visible; opacity: 1; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(4, 8, 20, 0.66); backdrop-filter: blur(4px); }

.modal__window {
  position: relative;
  width: min(400px, 100%);
  background: #fff;
  color: #202124;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 40px 90px -20px rgba(0,0,0,0.6);
  transform: translateY(14px) scale(0.97);
  transition: transform 0.3s cubic-bezier(.6,.2,.1,1);
}
.modal.open .modal__window { transform: none; }

.modal__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: #f1f3f4;
  border-bottom: 1px solid #e3e6ea;
}
.modal__dots { display: flex; gap: 5px; }
.modal__dots i { width: 10px; height: 10px; border-radius: 50%; background: #d7dadd; }
.modal__dots i:nth-child(1) { background: #ff5f57; }
.modal__dots i:nth-child(2) { background: #febc2e; }
.modal__dots i:nth-child(3) { background: #28c840; }
.modal__url {
  flex: 1;
  background: #fff;
  border: 1px solid #e3e6ea;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.78rem;
  color: #5f6368;
  text-align: center;
}
.modal__x { display: grid; place-items: center; border: 0; background: transparent; color: #5f6368; cursor: pointer; padding: 4px; border-radius: 6px; }
.modal__x svg { width: 16px; height: 16px; }
.modal__x:hover { color: #202124; background: rgba(0,0,0,0.05); }

.modal__content { padding: 30px 26px 26px; text-align: center; }

/* Google-style content */
.g-logo { width: 46px; height: 46px; margin: 0 auto 14px; }
.gh-logo { width: 44px; height: 44px; margin: 0 auto 14px; display: block; }
.oauth-h { font-size: 1.35rem; font-weight: 500; color: #202124; }
.oauth-p { color: #5f6368; font-size: 0.9rem; margin-top: 6px; line-height: 1.5; }
.oauth-app { font-weight: 600; color: #1a73e8; }

.acct {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 12px 10px;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  transition: background 0.15s;
}
.acct:hover { background: #f5f6f7; }
.acct + .acct { border-top: 1px solid #ebedef; }
.acct__pic { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 0.95rem; }
.acct__name { font-weight: 500; color: #202124; font-size: 0.95rem; }
.acct__mail { color: #5f6368; font-size: 0.82rem; }
.acct__list { margin: 18px 0 6px; }
.acct__use { color: #1a73e8; font-weight: 500; font-size: 0.9rem; }

/* GitHub-style content (dark) */
.modal__window.dark { background: #0d1117; color: #e6edf3; }
.modal__window.dark .modal__bar { background: #161b22; border-bottom-color: #21262d; }
.modal__window.dark .modal__url { background: #0d1117; border-color: #30363d; color: #8b949e; }
.modal__window.dark .modal__x { color: #8b949e; }
.modal__window.dark .oauth-h { color: #e6edf3; }
.modal__window.dark .oauth-p { color: #8b949e; }
.modal__window.dark .oauth-app { color: #58a6ff; }
.gh-authcard {
  border: 1px solid #30363d;
  border-radius: 10px;
  padding: 18px;
  margin-top: 16px;
  text-align: left;
  background: #161b22;
}
.gh-perm { display: flex; align-items: center; gap: 10px; color: #8b949e; font-size: 0.85rem; margin-top: 10px; }
.gh-perm svg { width: 16px; height: 16px; color: #3fb950; flex: none; }

/* Modal buttons */
.oauth-btn {
  width: 100%;
  margin-top: 18px;
  border: 0;
  border-radius: 8px;
  padding: 11px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
}
.oauth-btn:hover { filter: brightness(0.96); }
.oauth-btn:active { transform: scale(0.99); }
.oauth-btn--g { background: #1a73e8; color: #fff; }
.oauth-btn--gh { background: #238636; color: #fff; }
.oauth-cancel { display: block; width: 100%; margin-top: 10px; background: transparent; border: 0; color: #5f6368; font: inherit; font-weight: 500; padding: 8px; cursor: pointer; }
.modal__window.dark .oauth-cancel { color: #8b949e; }

/* Spinner state */
.oauth-loading { padding: 40px 0 30px; }
.spinner {
  width: 38px; height: 38px;
  margin: 0 auto 18px;
  border: 4px solid #e3e6ea;
  border-top-color: #1a73e8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.modal__window.dark .spinner { border-color: #30363d; border-top-color: #58a6ff; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 160%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.12);
  border: 1px solid var(--glass-line);
  color: var(--ink);
  padding: 14px 22px;
  border-radius: 16px;
  font-weight: 600;
  font-size: 0.9rem;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 20px 50px -16px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.3);
  /* Hidden by default so no empty box stays fixed on screen */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(.6,.2,.1,1), opacity 0.35s ease, visibility 0.35s;
  z-index: 50;
}
.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
}
.toast svg { width: 18px; height: 18px; color: var(--accent); flex: none; }

/* ---------- Keyboard focus (accessibility) ---------- */
:focus-visible { outline: none; }
.btn:focus-visible,
.social:focus-visible,
.tab:focus-visible,
.link:focus-visible,
.toggle:focus-visible,
.check input:focus-visible {
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--brand);
  border-radius: 10px;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .panel__foot { display: none; }
}
@media (max-width: 560px) {
  .shell { border-radius: 18px; }
  .panel { padding: 24px; gap: 18px; }
  .features { display: none; }
  .socials { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .orb { animation: none; }
  .shell { transform: none !important; }
  * { transition-duration: 0.01ms !important; }
}
