/* DEVI custom sign-in — Resend-style, quiet dark, no glass/glow */
:root {
  --bg: #141416;
  --card: #101013;
  --border: #26262c;
  --stroke: #34343c;
  --t1: #ffffff;
  --t2: #a1a1a8;
  --t3: #8a8a94;
  --accent: #4b8df8;
  --accent-hover: #70a7ff;
  --ok: #34c87a;
  --danger: #f07178;
  --radius: 8px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--t1);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--t2);
  font-size: 14px;
  font-weight: 500;
  min-height: 40px;
}
.back:hover { color: var(--t1); }
.back img { width: 18px; height: 18px; }

.stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px 48px;
}
.card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px 28px;
}
.brand {
  display: flex;
  justify-content: center;
  margin: 0 0 28px;
}
.brand img { height: 28px; width: auto; }
h1 {
  margin: 0 0 6px;
  font-size: 1.55rem;
  font-weight: 650;
  letter-spacing: -.02em;
  line-height: 1.2;
  text-align: center;
}
.sub {
  margin: 0 0 28px;
  color: var(--t2);
  font-size: 15px;
  text-align: center;
}
.switch {
  margin: 22px 0 0;
  text-align: center;
  color: var(--t2);
  font-size: 14.5px;
}
.switch a { font-weight: 600; }

/* Future social slot — hidden until Google/GitHub apps exist */
.social { display: none; margin: 0 0 18px; }
.social.ready { display: block; }
.social .provider {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  margin: 0 0 10px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: transparent;
  color: var(--t1);
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}
.social .provider:hover { border-color: var(--t3); }
.divider {
  display: none;
  align-items: center;
  gap: 12px;
  margin: 4px 0 18px;
  color: var(--t3);
  font-size: 13px;
}
.social.ready + .divider { display: flex; }
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.field { margin: 0 0 16px; }
.field label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
  color: var(--t1);
  font-weight: 600;
  font-size: 14px;
}
.field label .side {
  font-weight: 500;
  font-size: 13px;
  color: var(--accent);
}
.field label .side:hover { color: var(--accent-hover); }
.field input {
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: transparent;
  color: var(--t1);
  font: inherit;
  font-size: 16px;
}
.field input::placeholder { color: var(--t3); }
.field input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}
.pwfield { position: relative; }
.pwfield input { padding-right: 40px; }
.pwfield input::-ms-reveal,
.pwfield input::-ms-clear { display: none; }
.togglepw {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--t3);
  line-height: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.togglepw:hover { color: var(--t2); }
.togglepw:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -4px;
}
.togglepw svg { display: block; width: 16px; height: 16px; }

.checklist {
  list-style: none;
  margin: -4px 0 18px;
  padding: 0;
}
.checklist li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  color: var(--t3);
  font-size: 13.5px;
}
.checklist li::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--stroke);
  flex: none;
}
.checklist li.ok { color: var(--ok); }
.checklist li.ok::before {
  border-color: var(--ok);
  background:
    radial-gradient(circle at 50% 50%, var(--ok) 0 3px, transparent 3.5px);
}

.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin: 4px 0 0;
  padding: 11px 16px;
  border: 0;
  border-radius: var(--radius);
  background: #fff;
  color: #101013;
  font: inherit;
  font-weight: 650;
  font-size: 15px;
  cursor: pointer;
}
.primary:hover { background: #f2f2f4; }
.primary:disabled {
  opacity: .38;
  cursor: not-allowed;
}
.primary.busy { opacity: .72; cursor: wait; }

.alts {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 18px 0 0;
}
.alts button {
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--t2);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
}
.alts button:hover { color: var(--t1); }
.alts button:disabled { opacity: .4; cursor: not-allowed; }

.legal {
  margin: 20px 0 0;
  color: var(--t3);
  font-size: 12.5px;
  line-height: 1.45;
  text-align: center;
}
.legal a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal a:hover { color: var(--accent-hover); }

.status {
  margin: 14px 0 0;
  min-height: 1.35em;
  color: var(--t2);
  font-size: 14px;
  text-align: center;
}
.status.err { color: var(--danger); }
.status.ok { color: var(--ok); }

/* Progressive password reveal */
.step-password {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  transition: max-height .35s var(--ease), opacity .28s var(--ease), transform .28s var(--ease);
  pointer-events: none;
}
.step-password.open {
  max-height: 220px;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  margin-top: 0;
}

@media (max-width: 480px) {
  .card { padding: 28px 22px 24px; border: 0; background: transparent; }
  .stage { padding: 8px 12px 36px; align-items: flex-start; }
}
