/* =========================================================================
   1v14 — dashboard sign-in
   Standalone stylesheet for dashboard.1v14.com auth. One card, two states,
   a violet panel that slides between them. Adapts the 1v14 dark / violet
   creator-tech identity; does not load the marketing site stylesheet.

   Sections: tokens · reset · frame · card · forms · google · panel ·
             desktop split + slide · mobile vertical adaptation ·
             reduced motion · no-js
   ========================================================================= */

/* ----- tokens (mirrors the 1v14 site palette) ------------------------- */
:root {
  --ink: #0B0B14;
  --ink-raised: #14141F;
  --slate: #1F1F2E;
  --line: #2A2A3D;
  --line-strong: #393252;

  --text: #F8FAFC;
  --text-dim: #A8A7BD;
  --text-mute: #6E6D84;

  --violet: #8B5CF6;
  --violet-deep: #6D28D9;
  --violet-soft: rgba(139, 92, 246, 0.16);
  --signal: #19D69A;
  --danger: #F87171;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;

  --font: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --split: 901px;
}

/* ----- reset -------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(75vw 55vh at 12% -12%, rgba(139, 92, 246, 0.16), transparent 60%),
    radial-gradient(60vw 50vh at 105% 112%, rgba(109, 40, 217, 0.18), transparent 55%),
    var(--ink);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 3px;
  border-radius: 6px;
}
::selection { background: var(--violet); color: #fff; }

.auth-skip {
  position: absolute;
  left: 1rem;
  top: -3.5rem;
  z-index: 50;
  background: var(--violet);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  transition: top 0.18s var(--ease);
}
.auth-skip:focus { top: 1rem; }

/* ----- frame ------------------------------------------------------- */
.auth-viewport {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.auth-home {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  width: max-content;
  margin: 1.5rem 0 0 1.7rem;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.04em;
  color: var(--text-dim);
  transition: color 0.16s var(--ease);
}
.auth-home:hover { color: var(--text); }
.auth-home svg { width: 24px; height: 24px; display: block; }

#auth-main {
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem 3.25rem;
}

/* ----- card ------------------------------------------------------- */
.auth-card {
  position: relative;
  width: 100%;
  max-width: 940px;
  background: var(--ink-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 80px -34px rgba(0, 0, 0, 0.75);
}

/* ----- form sides (shared) -------------------------------------- */
.auth-side__inner {
  width: 100%;
  max-width: 352px;
}

.auth-side h1 {
  margin: 0 0 0.4rem;
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.02;
}
.auth-side h1:focus { outline: none; }
.auth-side h1:focus-visible { outline: 2px solid var(--violet); outline-offset: 4px; }

.auth-side__sub {
  margin: 0 0 1.8rem;
  color: var(--text-dim);
  font-size: 0.98rem;
  max-width: 34ch;
}

.auth-error {
  margin: 0 0 1.25rem;
  padding: 0.7rem 0.9rem;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.42);
  border-radius: var(--radius-sm);
  color: #fecaca;
  font-size: 0.9rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.auth-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
}
.auth-field input {
  width: 100%;
  padding: 0.72rem 0.85rem;
  background: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.auth-field input:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 3px var(--violet-soft);
}
.auth-field input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 40px var(--ink) inset;
  caret-color: var(--text);
}

.auth-hint {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--text-mute);
  transition: color 0.16s var(--ease);
}
.auth-hint.is-met { color: var(--signal); }
.auth-hint.is-met::before { content: "\2713\00a0"; font-weight: 700; }

.auth-submit {
  margin-top: 0.4rem;
  padding: 0.8rem 1rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(120deg, var(--violet-deep), var(--violet));
  color: #fff;
  font-weight: 700;
  font-size: 0.98rem;
  transition: filter 0.16s var(--ease), transform 0.12s var(--ease);
}
.auth-submit:hover { filter: brightness(1.08); }
.auth-submit:active { transform: translateY(1px); }

.auth-or {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 1.4rem 0;
  color: var(--text-mute);
  font-size: 0.8rem;
}
.auth-or::before,
.auth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-google {
  min-height: 44px;
  display: flex;
  color-scheme: light;
}

.auth-switch-line {
  margin: 1.6rem 0 0;
  font-size: 0.9rem;
  color: var(--text-dim);
}
.auth-switch-line a {
  color: var(--violet);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ----- branded panel (shared) --------------------------------- */
.auth-panel {
  color: #fff;
  background: linear-gradient(155deg, var(--violet-deep) 0%, #5b21b6 46%, #3b1178 100%);
  overflow: hidden;
}

.auth-panel__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.04em;
}
.auth-panel__brand svg { width: 22px; height: 22px; display: block; }

.auth-panel__mark {
  position: absolute;
  right: -14%;
  bottom: -16%;
  width: 78%;
  height: auto;
  color: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.auth-panel__pane h2 {
  margin: 0 0 0.6rem;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.auth-panel__pane p {
  margin: 0 0 1.6rem;
  color: rgba(255, 255, 255, 0.82);
  max-width: 32ch;
}

.auth-panel__switch {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  padding: 0.7rem 1.3rem;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-sm);
  font-weight: 700;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease),
    color 0.16s var(--ease);
}
.auth-panel__switch:hover {
  background: #fff;
  border-color: #fff;
  color: var(--violet-deep);
}
.auth-panel__switch:focus-visible { outline-color: #fff; }

.auth-panel__tag {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.62);
}

/* =========================================================================
   Desktop — full split panel that slides between the two states
   ========================================================================= */
@media (min-width: 901px) {
  .auth-card {
    min-height: 564px;
    max-height: calc(100vh - 6rem);
  }

  .auth-side {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    display: flex;
    overflow-y: auto;
    transition: opacity 0.45s var(--ease), transform 0.45s var(--ease),
      visibility 0.45s step-end;
  }
  .auth-side--login { left: 0; }
  .auth-side--signup { left: 50%; }

  .auth-side__inner {
    margin: auto;
    padding: 2.7rem 2.5rem;
  }

  /* the state that is currently under the panel */
  .auth-card[data-mode="login"] .auth-side--signup,
  .auth-card[data-mode="signup"] .auth-side--login {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.45s var(--ease), transform 0.45s var(--ease),
      visibility 0s;
  }
  .auth-card[data-mode="login"] .auth-side--signup { transform: translateX(26px); }
  .auth-card[data-mode="signup"] .auth-side--login { transform: translateX(-26px); }

  .auth-panel {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 5;
    width: 50%;
    height: 100%;
    transition: transform 0.6s var(--ease);
  }
  .auth-card[data-mode="login"] .auth-panel { transform: translateX(100%); }
  .auth-card[data-mode="signup"] .auth-panel { transform: translateX(0); }

  .auth-panel__brand {
    position: absolute;
    top: 2.2rem;
    left: 2.6rem;
  }

  .auth-panel__pane {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.6rem;
    opacity: 0;
    visibility: hidden;
    transform: translateX(18px);
    transition: opacity 0.4s var(--ease), transform 0.4s var(--ease),
      visibility 0s 0.4s;
  }
  .auth-card[data-mode="login"] .auth-panel__pane--to-signup,
  .auth-card[data-mode="signup"] .auth-panel__pane--to-login {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.4s var(--ease) 0.12s, transform 0.4s var(--ease) 0.12s;
  }

  .auth-panel__tag {
    position: absolute;
    left: 2.6rem;
    right: 2.6rem;
    bottom: 2rem;
  }
}

/* =========================================================================
   Mobile / narrow — vertical adaptation, not a squeezed split
   The panel becomes a slim brand header; the two states stack and the
   active one slides up into place.
   ========================================================================= */
@media (max-width: 900px) {
  #auth-main { padding: 1.25rem 1rem 2.5rem; }

  .auth-card {
    display: flex;
    flex-direction: column;
    overflow: visible;
    border-radius: var(--radius);
  }

  .auth-panel {
    position: relative;
    display: flex;
    align-items: center;
    padding: 1.35rem 1.5rem;
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  }
  .auth-panel__brand { font-size: 1.05rem; }
  .auth-panel__mark {
    width: 42%;
    right: -6%;
    bottom: -60%;
  }
  .auth-panel__pane,
  .auth-panel__tag { display: none; }

  .auth-side { display: flex; }
  .auth-side__inner {
    max-width: none;
    margin: 0;
    padding: 1.9rem 1.5rem 2.2rem;
  }
  .auth-card[data-mode="login"] .auth-side--signup,
  .auth-card[data-mode="signup"] .auth-side--login {
    display: none;
  }

  .auth-google { justify-content: flex-start; }
}

@media (max-width: 900px) and (prefers-reduced-motion: no-preference) {
  .auth-side.is-entering {
    animation: authSlideUp 0.32s var(--ease) both;
  }
  @keyframes authSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: none; }
  }
}

/* ----- one deliberate load settle ------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .auth-card { animation: authRise 0.5s var(--ease) both; }
  @keyframes authRise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
  }
}

/* ----- reduced motion — switch states instantly ---------------- */
@media (prefers-reduced-motion: reduce) {
  .auth-card,
  .auth-side,
  .auth-panel,
  .auth-panel__pane {
    animation: none !important;
    transition: none !important;
  }
}

/* ----- no-JS — each route shows its own working form + a link --- */
.no-js .auth-side { transition: none; }
