/* vidkov: the sign-in and sign-up screen.
 *
 * Deliberately separate from the dashboard's utility classes and from base.css. Everything here is
 * scoped under .auth-screen, so loading this file cannot change a single pixel of the app behind it,
 * and the app's Tailwind reset cannot reach in.
 *
 * The old screen was a centred glass card on an animated gradient with three floating circles. That
 * is the house style of every template, and on an unknown brand it reads as unserious, which is
 * exactly the wrong note on the page where someone decides whether to hand over an email address.
 * This is a two-column page: the form on the left at a comfortable measure, and on the right the
 * three things a stranger actually wants to know before starting. On a phone the right column moves
 * below the form, because the form is what they came for.
 */

.auth-screen {
  --a-ink-900: #10231f;
  --a-ink-800: #1c332e;
  --a-ink-700: #33514a;
  --a-ink-600: #4d6a63;
  --a-ink-500: #6b8580;
  --a-ink-400: #93a8a3;
  --a-ink-300: #c2d0cc;
  --a-ink-200: #e0e8e6;
  --a-ink-100: #eff4f2;
  --a-ink-50:  #f7faf9;
  --a-green-700: #0a6b5c;
  --a-green-600: #0d8271;
  --a-green-500: #109383;
  --a-green-100: #d9f0ec;
  --a-green-50:  #eefaf7;
  --a-amber-700: #78350f;
  --a-amber-600: #a16207;
  --a-amber-100: #fef3c7;
  --a-red-600: #b4232a;
  --a-red-100: #fdeaea;
  --a-radius: 8px;

  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #fff;
  color: var(--a-ink-800);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans',
               'Liberation Sans', sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
  font-size: 1rem;
  line-height: 1.6;
  text-align: left;
}

.auth-screen *, .auth-screen *::before, .auth-screen *::after { box-sizing: border-box; }

/* -------------------------------------------------------------- top bar */

.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--a-ink-200);
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 520;
  color: var(--a-ink-600);
  text-decoration: none;
  padding: 6px 10px 6px 6px;
  border-radius: 6px;
}
.auth-back:hover { color: var(--a-ink-900); background: var(--a-ink-100); }

.auth-lang { display: inline-flex; border: 1px solid var(--a-ink-200); border-radius: 7px; overflow: hidden; }
.auth-lang button {
  appearance: none;
  border: 0;
  background: #fff;
  color: var(--a-ink-500);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 560;
  padding: 5px 11px;
  cursor: pointer;
  border-right: 1px solid var(--a-ink-200);
}
.auth-lang button:last-child { border-right: 0; }
.auth-lang button:hover { color: var(--a-ink-900); background: var(--a-ink-50); }
.auth-lang button.is-on { background: var(--a-ink-900); color: #fff; }

/* -------------------------------------------------------------- two columns */

.auth-body {
  flex: 1;
  display: grid;
  align-items: start;
  gap: 0;
  width: 100%;
}
@media (min-width: 940px) {
  .auth-body { grid-template-columns: minmax(0, 1fr) minmax(0, 0.86fr); }
}

.auth-main { padding: 40px 20px 56px; display: flex; justify-content: center; }
.auth-card { width: 100%; max-width: 420px; }

.auth-aside {
  padding: 40px 20px 56px;
  background: var(--a-ink-50);
  border-top: 1px solid var(--a-ink-200);
  align-self: stretch;
}
@media (min-width: 940px) {
  .auth-aside { border-top: 0; border-left: 1px solid var(--a-ink-200); padding: 56px 44px; }
}
.auth-aside-inner { max-width: 380px; margin: 0 auto; }

/* -------------------------------------------------------------- brand + headings */

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 680;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--a-ink-900);
  text-decoration: none;
  margin-bottom: 28px;
}
.auth-brand .brand-mark {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 7px;
  background: var(--a-green-600);
  color: #fff;
  font-size: 13px;
}

.auth-title {
  font-size: 1.65rem;
  font-weight: 640;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--a-ink-900);
  margin: 0 0 6px;
}
.auth-sub { color: var(--a-ink-600); font-size: 0.94rem; margin: 0 0 26px; }
.auth-sub strong { color: var(--a-ink-900); font-weight: 600; }

/* -------------------------------------------------------------- fields */

.auth-form { margin: 0; }

.auth-screen .field { display: block; margin-bottom: 18px; }
.auth-screen .field > label,
.auth-screen .label {
  display: block;
  font-size: 0.86rem;
  font-weight: 580;
  color: var(--a-ink-800);
  margin-bottom: 6px;
}

.auth-screen .input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  font: inherit;
  font-size: 1rem;
  color: var(--a-ink-900);
  background: #fff;
  border: 1px solid var(--a-ink-300);
  border-radius: var(--a-radius);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.auth-screen .input::placeholder { color: var(--a-ink-400); }
.auth-screen .input:hover { border-color: var(--a-ink-400); }
.auth-screen .input:focus {
  outline: none;
  border-color: var(--a-green-600);
  box-shadow: 0 0 0 3px var(--a-green-100);
}
.auth-screen .input[aria-invalid="true"] { border-color: var(--a-red-600); }
.auth-screen .input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px var(--a-red-100); }

.input-wrap { position: relative; }
.input-wrap .input { padding-right: 46px; }
.input-wrap .reveal {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--a-ink-500);
  width: 38px; height: 38px;
  border-radius: 6px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.input-wrap .reveal:hover { color: var(--a-ink-900); background: var(--a-ink-100); }

.code-input {
  letter-spacing: 0.42em;
  font-size: 1.35rem;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, 'SF Mono', Consolas, monospace;
}

.auth-screen .hint { font-size: 0.84rem; color: var(--a-ink-600); margin: 6px 0 0; }
.auth-screen .error-text { font-size: 0.84rem; color: var(--a-red-600); margin: 6px 0 0; font-weight: 540; }

.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.linklike {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 560;
  color: var(--a-green-700);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.linklike:hover { color: var(--a-green-600); text-decoration: underline; text-underline-offset: 0.18em; }
.linklike[disabled] { color: var(--a-ink-400); cursor: not-allowed; text-decoration: none; }

/* -------------------------------------------------------------- password panel */

/* Shown on focus and kept afterwards. The rules matter twice: while choosing a password, and again
   when one has just been refused, and the old placeholder-only version had vanished by both. */
.pw-panel {
  margin-top: 12px;
  padding: 14px 16px;
  background: var(--a-ink-50);
  border: 1px solid var(--a-ink-200);
  border-radius: var(--a-radius);
}

.pw-meter { display: flex; gap: 4px; margin-bottom: 8px; }
.pw-meter span {
  height: 4px;
  flex: 1;
  border-radius: 999px;
  background: var(--a-ink-200);
  transition: background-color .2s ease;
}
.pw-meter span.on.s1 { background: var(--a-red-600); }
.pw-meter span.on.s2 { background: #d97706; }
.pw-meter span.on.s3 { background: var(--a-green-500); }
.pw-meter span.on.s4 { background: var(--a-green-700); }

.pw-label { font-size: 0.82rem; font-weight: 580; margin: 0 0 10px; }
.pw-label.t0 { color: var(--a-ink-500); }
.pw-label.t1 { color: var(--a-red-600); }
.pw-label.t2 { color: #b45309; }
.pw-label.t3 { color: var(--a-green-600); }
.pw-label.t4 { color: var(--a-green-700); }

.pw-rules { list-style: none; padding: 0; margin: 0 0 10px; }
.pw-rules li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--a-ink-600);
  margin-bottom: 4px;
}
.pw-rules li i { font-size: 0.78rem; color: var(--a-ink-400); width: 14px; text-align: center; }
.pw-rules li.ok { color: var(--a-ink-800); }
.pw-rules li.ok i { color: var(--a-green-600); }

.pw-tip { font-size: 0.82rem; color: var(--a-ink-500); margin: 0; }
.pw-tip em { color: var(--a-ink-700); font-style: normal; font-weight: 560; }

/* -------------------------------------------------------------- consent */

.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.86rem;
  color: var(--a-ink-600);
  line-height: 1.55;
  margin: 4px 0 20px;
  cursor: pointer;
}
.consent input[type="checkbox"] {
  flex: none;
  width: 17px; height: 17px;
  margin: 2px 0 0;
  accent-color: var(--a-green-600);
  cursor: pointer;
}
.consent a { color: var(--a-green-700); text-decoration: underline; text-underline-offset: 0.16em; }
.consent a:hover { color: var(--a-green-600); }

/* -------------------------------------------------------------- messages */

.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 18px;
  border-left: 3px solid var(--a-red-600);
  background: var(--a-red-100);
  border-radius: 0 var(--a-radius) var(--a-radius) 0;
  font-size: 0.9rem;
  color: #7f1d1d;
}
.auth-alert i { margin-top: 3px; color: var(--a-red-600); }

.auth-note {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 15px;
  margin-bottom: 18px;
  border-left: 3px solid var(--a-green-500);
  background: var(--a-green-50);
  border-radius: 0 var(--a-radius) var(--a-radius) 0;
  font-size: 0.88rem;
  color: var(--a-ink-700);
}
.auth-note i { margin-top: 3px; color: var(--a-green-600); }
.auth-note p { margin: 0 0 6px; }
.auth-note p:last-child { margin-bottom: 0; }
.auth-note strong { color: var(--a-ink-900); font-weight: 600; }

/* -------------------------------------------------------------- buttons */

.auth-screen .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--a-green-600);
  border-radius: var(--a-radius);
  background: var(--a-green-600);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 560;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.auth-screen .btn:hover { background: var(--a-green-700); border-color: var(--a-green-700); }
.auth-screen .btn[disabled] { opacity: .55; cursor: not-allowed; }
.auth-screen .btn-block { width: 100%; }

.auth-screen .loader {
  width: 17px; height: 17px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: authspin .7s linear infinite;
}
@keyframes authspin { to { transform: rotate(360deg); } }

.auth-switch {
  margin: 20px 0 0;
  font-size: 0.9rem;
  color: var(--a-ink-600);
  text-align: center;
}

/* -------------------------------------------------------------- the right column */

/* The trust column. An unknown brand cannot borrow Apple's silence: a stranger has no memory to
   fill the gaps with, so the three questions they are actually asking get answered here in plain
   words: what it does, what it costs to try, and what happens to what they type in. */

.auth-aside h2 {
  font-size: 1.12rem;
  font-weight: 620;
  letter-spacing: -0.015em;
  color: var(--a-ink-900);
  margin: 0 0 20px;
}

.auth-points { list-style: none; padding: 0; margin: 0 0 28px; }
.auth-points li { display: flex; gap: 13px; margin-bottom: 20px; }
.auth-points li:last-child { margin-bottom: 0; }
.auth-points .pt-icon {
  flex: none;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--a-green-100);
  color: var(--a-green-700);
  font-size: 13px;
}
.auth-points .pt-title { font-size: 0.94rem; font-weight: 580; color: var(--a-ink-900); margin: 3px 0 3px; }
.auth-points .pt-text { font-size: 0.88rem; color: var(--a-ink-600); margin: 0; line-height: 1.55; }

.auth-facts {
  border-top: 1px solid var(--a-ink-200);
  padding-top: 22px;
  font-size: 0.86rem;
  color: var(--a-ink-600);
}
.auth-facts p { margin: 0 0 8px; }
.auth-facts p:last-child { margin-bottom: 0; }
.auth-facts i { color: var(--a-green-600); width: 15px; margin-right: 7px; }
.auth-facts a { color: var(--a-green-700); }

/* -------------------------------------------------------------- foot */

.auth-foot {
  padding: 18px 20px 26px;
  text-align: center;
  font-size: 0.84rem;
  color: var(--a-ink-500);
  border-top: 1px solid var(--a-ink-200);
  margin: 0;
}
.auth-foot a { color: var(--a-ink-600); text-decoration: none; }
.auth-foot a:hover { color: var(--a-green-700); text-decoration: underline; }

.auth-screen :focus-visible { outline: 2px solid var(--a-green-600); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  .auth-screen *, .auth-screen *::before, .auth-screen *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
