/* ============================================================
   vanilla — auth pages
   ============================================================ */

:root {
  --bg:         #04060a;
  --card:       #080c12;
  --surface:    rgba(255, 255, 255, 0.02);
  --surface-2:  rgba(255, 255, 255, 0.035);
  --line:       rgba(127, 227, 255, 0.12);
  --line-soft:  rgba(255, 255, 255, 0.055);
  --accent:     #7fe3ff;
  --accent-2:   #38bdf8;
  --text:       #e8f3fa;
  --muted:      #7a8794;
  --muted-2:    #4d5862;
  --bad:        #f87171;
  --ok:         #34d399;
  --sans:       'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono:       'JetBrains Mono', ui-monospace, monospace;
  --ease:       cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  position: relative;
  overflow-x: hidden;
}

::selection { background: rgba(127, 227, 255, 0.25); }

.auth-bg {
  position: fixed; inset: 0;
  background:
    radial-gradient(700px circle at 20% -10%, rgba(127, 227, 255, 0.09), transparent 65%),
    radial-gradient(600px circle at 90% 110%, rgba(56, 189, 248, 0.06), transparent 60%),
    linear-gradient(rgba(127, 227, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127, 227, 255, 0.022) 1px, transparent 1px);
  background-size: auto, auto, 60px 60px, 60px 60px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 80%);
  pointer-events: none;
}

.auth-back {
  position: fixed; top: 1.5rem; left: 1.75rem; z-index: 5;
  display: inline-flex; align-items: center; gap: 0.5rem;
  color: var(--muted-2);
  text-decoration: none;
  font-size: 0.8rem; font-weight: 500;
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}
.auth-back:hover { color: var(--accent); transform: translateX(-2px); }

/* ---------- layout ---------- */
.auth-wrap {
  position: relative; z-index: 2;
  width: 100%; max-width: 940px;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
  animation: lift 0.6s var(--ease) both;
}
@keyframes lift { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- card ---------- */
.auth-card {
  background: linear-gradient(180deg, #0a0e15, #06090e);
  padding: 2.4rem 2rem 2rem;
}

.auth-logo {
  display: inline-flex; align-items: center; gap: 0.55rem;
  color: #fff; text-decoration: none;
  font-weight: 800; font-size: 1.05rem; letter-spacing: -0.03em;
  margin-bottom: 1.6rem;
}
.auth-mark {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04060a; font-size: 0.8rem; font-weight: 800;
  box-shadow: 0 0 18px rgba(127, 227, 255, 0.3);
  overflow: hidden;
}
.auth-mark svg { width: 58%; height: 58%; display: block; }
.auth-mark img { width: 100%; height: 100%; padding: 3px; object-fit: contain; display: none; }
.auth-mark.has-logo img { display: block; }
.auth-mark.has-logo {
  background: #05080c;
  border: 1px solid var(--line-soft);
  box-shadow: 0 0 18px rgba(127, 227, 255, 0.2);
}

.auth-title { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.025em; color: #fff; }
.auth-sub { font-size: 0.82rem; color: var(--muted); margin-top: 0.3rem; }

/* ---------- tabs ---------- */
.auth-tabs {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  margin: 1.6rem 0 1.5rem;
  padding: 0.25rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line-soft);
  border-radius: 11px;
}
.auth-tab {
  position: relative; z-index: 2;
  background: none; border: 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.82rem; font-weight: 600;
  padding: 0.5rem 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.25s var(--ease);
}
.auth-tab.is-active { color: #04060a; }
.auth-tab-pill {
  position: absolute; z-index: 1;
  top: 0.25rem; left: 0.25rem;
  width: calc(50% - 0.25rem);
  height: calc(100% - 0.5rem);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.25);
  transition: transform 0.32s var(--ease);
}
.auth-tabs.is-signup .auth-tab-pill { transform: translateX(100%); }

/* ---------- form ---------- */
.auth-form { display: flex; flex-direction: column; gap: 0.9rem; }

.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field[hidden] { display: none; }
.field label {
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--muted);
}

.input {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.input:focus-within { border-color: rgba(127, 227, 255, 0.42); box-shadow: 0 0 0 3px rgba(127, 227, 255, 0.07); }
.input.is-error { border-color: rgba(248, 113, 113, 0.55); box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.08); }
.input > i { color: var(--muted-2); font-size: 0.8rem; flex-shrink: 0; }
.input:focus-within > i { color: var(--accent); }

.input input {
  flex: 1; min-width: 0;
  background: none; border: 0; outline: none;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.86rem;
}
.input input::placeholder { color: var(--muted-2); }
#fKey { font-family: var(--mono); font-size: 0.8rem; }

.reveal {
  background: none; border: 0;
  color: var(--muted-2);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.1rem 0.15rem;
  flex-shrink: 0;
  transition: color 0.2s var(--ease);
}
.reveal:hover { color: var(--accent); }

.hint { font-size: 0.7rem; color: var(--muted-2); line-height: 1.5; }
.hint[hidden] { display: none; }

/* ---------- stay logged in ---------- */
.check {
  display: flex; align-items: center; gap: 0.6rem;
  cursor: pointer;
  user-select: none;
  margin-top: 0.1rem;
}
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check-box {
  width: 17px; height: 17px; flex-shrink: 0;
  border-radius: 5px;
  border: 1px solid var(--line-soft);
  background: var(--surface);
  display: grid; place-items: center;
  color: transparent;
  font-size: 0.55rem;
  transition: all 0.2s var(--ease);
}
.check input:checked + .check-box {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #04060a;
  box-shadow: 0 0 14px rgba(127, 227, 255, 0.25);
}
.check-txt { font-size: 0.8rem; color: #b7c6d1; display: flex; flex-direction: column; }
.check-txt em { font-style: normal; font-size: 0.68rem; color: var(--muted-2); }

/* ---------- messages ---------- */
.auth-msg {
  font-size: 0.76rem;
  padding: 0.6rem 0.75rem;
  border-radius: 9px;
  border: 1px solid rgba(248, 113, 113, 0.3);
  background: rgba(248, 113, 113, 0.07);
  color: #fca5a5;
}
.auth-msg[hidden] { display: none; }
.auth-msg.is-ok { border-color: rgba(52, 211, 153, 0.3); background: rgba(52, 211, 153, 0.07); color: #6ee7b7; }

.auth-submit {
  margin-top: 0.3rem;
  width: 100%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04121a;
  border: 0;
  font-family: var(--sans);
  font-size: 0.88rem; font-weight: 800;
  padding: 0.8rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.22s var(--ease);
  box-shadow: 0 6px 22px rgba(56, 189, 248, 0.2);
}
.auth-submit:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(56, 189, 248, 0.32); }
.auth-submit:disabled { opacity: 0.55; cursor: not-allowed; }
.auth-submit.is-busy { pointer-events: none; opacity: 0.7; }

.auth-switch { margin-top: 1.1rem; font-size: 0.78rem; color: var(--muted-2); text-align: center; }
.auth-switch button {
  background: none; border: 0;
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.78rem; font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.auth-switch button:hover { text-decoration: underline; }

.auth-fine {
  margin-top: 0.8rem; padding-top: 0.8rem;
  border-top: 1px solid var(--line-soft);
  font-size: 0.68rem; color: var(--muted-2); text-align: center;
}

/* ---------- aside ---------- */
.auth-aside {
  background: radial-gradient(500px circle at 80% 10%, rgba(127, 227, 255, 0.07), transparent 60%), #06090e;
  padding: 2.4rem 2rem;
  display: flex; flex-direction: column; justify-content: center; gap: 1.4rem;
}
.auth-aside blockquote p {
  font-size: 1.02rem; line-height: 1.6; color: #c6d6e1; font-weight: 500;
}
.auth-points { list-style: none; display: flex; flex-direction: column; gap: 0.7rem; }
.auth-points li { display: flex; align-items: center; gap: 0.65rem; font-size: 0.8rem; color: var(--muted); }
.auth-points i {
  width: 26px; height: 26px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 7px;
  background: rgba(127, 227, 255, 0.07);
  border: 1px solid var(--line);
  color: var(--accent);
  font-size: 0.7rem;
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; max-width: 420px; }
  .auth-aside { display: none; }
  .auth-back { position: static; margin-bottom: 1rem; align-self: flex-start; }
  body { flex-direction: column; align-items: center; justify-content: center; }
}
