/* Standalone web sign-in page (archiv-o.com/login).
 * Builds on styles.css tokens (.glass, .btn, .grad-text, --ink, --grad…).
 * Two-pane on desktop (brand showcase | form), single card on mobile —
 * mirrors the app's AuthLayout so the web sign-in feels like the app's. */

.login-body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.login-footer { position: relative; z-index: 1; padding-top: 72px; }

@media (max-width: 540px) {
  .login-footer { padding-top: 48px; }
}

/* Header: shares noma-shared.css's unified .site-header/.nav system. Only the
   position differs — the sign-in page overlays its split-screen hero, so the
   bar is absolute and scrolls away rather than staying fixed. */
/* Full-bleed so the inner .nav.shell can still center via margin-inline:auto —
   without left/right the absolute header shrink-wraps to the shell width and
   pins the logo to x=0 (the viewport edge). */
.login-nav { position: absolute; left: 0; right: 0; z-index: 5; }
.login-nav .brand { text-decoration: none; color: var(--ink); }

/* ambient glow behind everything */
.login__aura {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(60% 55% at 82% 12%, var(--green-glow), transparent 70%),
    radial-gradient(55% 50% at 12% 88%, rgba(126, 200, 106, 0.16), transparent 72%);
}

.login {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 92px 18px 40px;
}

.login__grid {
  width: 100%;
  max-width: 960px;
  display: grid;
  grid-template-columns: 1fr 1.08fr;
  min-height: 592px;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-brd);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(var(--glass-blur));
}

/* ---------- hero / animation panel (RIGHT on desktop) ---------- */
.login__panel {
  position: relative;
  order: 2; /* hero on the RIGHT — browser mirror of the app (form-right) */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 22px;
  padding: 46px 42px;
  color: #f3fbf5;
  background:
    linear-gradient(155deg, rgba(9, 38, 26, 0.74), rgba(7, 24, 18, 0.86)),
    var(--grad);
  overflow: hidden;
}
.login__panel::after {
  content: "";
  position: absolute;
  width: 340px; height: 340px;
  right: -120px; top: -110px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(183, 218, 50, 0.4), transparent);
  filter: blur(6px);
  pointer-events: none;
}
.login__panel-brand { display: inline-flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.login__panel-brand span { font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: 1.1rem; }
.login__panel-copy { position: relative; z-index: 1; }
.login__panel-copy h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
}
.login__panel-copy p { color: rgba(230, 245, 235, 0.82); font-size: 0.96rem; line-height: 1.55; margin: 0; max-width: 34ch; }
/* ---------- square app preview (hero panel — one unified frame, its own space) ---------- */
.login__preview { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; position: relative; z-index: 1; }
.pv {
  width: min(300px, 100%);
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
}
.pv__media { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- form column (LEFT on desktop, DOM-first) ---------- */
.login__form-col {
  order: 1; /* DOM-first for a11y, shown on the LEFT on desktop */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 46px 38px;
  background: var(--bg);
}
.login__card { width: 100%; max-width: 366px; }
.login__head { text-align: center; margin-bottom: 22px; }
.login__head h1 { font-family: Georgia, "Times New Roman", serif; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 4px; }
.login__head p { color: var(--ink-soft); font-size: 0.92rem; margin: 0; }

.login__field { margin: 0 0 12px; }
.login__field label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--ink); margin: 0 0 6px; }
.login__field input {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--r-sm);
  border: 1px solid var(--glass-brd);
  background: var(--glass-bg-subtle);
  color: var(--ink);
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.login__field input::placeholder { color: var(--ink-faint); }
.login__field input:focus {
  outline: none;
  border-color: var(--archivo-teal);
  box-shadow: 0 0 0 3px var(--green-glow);
}

.login__row { display: flex; justify-content: flex-end; margin: -4px 0 14px; }
.login__link {
  background: none; border: none; padding: 0;
  color: var(--archivo-teal); font: inherit; font-size: 0.82rem; font-weight: 600;
  cursor: pointer;
}
.login__link:hover { text-decoration: underline; }

.login__or { display: flex; align-items: center; gap: 10px; color: var(--ink-faint); font-size: 0.8rem; margin: 16px 0; }
.login__or::before, .login__or::after { content: ""; flex: 1; height: 1px; background: var(--glass-brd); }

.btn--block { width: 100%; justify-content: center; }
.btn--google { display: flex; align-items: center; gap: 10px; }

.login__msg {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-size: 0.86rem;
  line-height: 1.4;
  text-align: center;
}
.login__msg[hidden] { display: none; }
.login__msg--warn { background: rgba(180, 35, 31, 0.12); color: #d9433f; }
.login__msg--ok { background: rgba(31, 157, 107, 0.14); color: #1f9d6b; }
.login__msg--info { background: rgba(37, 99, 235, 0.14); color: #2f6bff; }
.login__msg a { color: inherit; font-weight: 700; text-decoration: underline; }

/* login vs register mode — toggle which controls are visible (JS flips
   .login__card[data-mode]). Keeps one card doing both jobs. */
.login__card[data-mode="login"] .is-register-only { display: none; }
.login__card[data-mode="register"] .is-login-only { display: none; }

.login__fine { margin: 20px 0 0; text-align: center; font-size: 0.84rem; color: var(--ink-faint); }
.login__fine a { color: var(--archivo-teal); font-weight: 600; text-decoration: none; }
.login__fine a:hover { text-decoration: underline; }
.login__guest { margin: 14px 0 0; text-align: center; }
.login__guest a { color: var(--ink-faint); font-size: 0.82rem; text-decoration: none; }
.login__guest a:hover { color: var(--ink-soft); text-decoration: underline; }

/* ---------- plans band (below the sign-in hero) ---------- */
.login__plans {
  position: relative;
  z-index: 1;
  padding: clamp(46px, 8vh, 84px) 18px 76px;
  border-top: 1px solid var(--glass-brd);
}
.login__plans-head { max-width: 620px; margin: 0 auto 40px; text-align: center; }
.login__plans-head h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: clamp(1.7rem, 3.6vw, 2.35rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 12px 0;
}
.login__plans-head p { color: var(--ink-soft); font-size: 0.98rem; line-height: 1.55; margin: 0; }
.login__plans-foot { margin-top: 42px; text-align: center; }
.login__plans-foot .btn { min-height: 44px; }
.login__plans-foot p { margin: 12px 0 0; color: var(--ink-faint); font-size: 0.82rem; }

/* Plan cards — same model as the app's login panel (PlanCards.tsx): accent bar,
   badge, price row, checkmark features, highlighted Go. */
.pgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; max-width: 720px; margin: 0 auto; }
.pcard {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px;
  border-radius: 20px;
  border: 1px solid var(--glass-brd);
  background: var(--glass-bg-strong);
  backdrop-filter: blur(var(--glass-blur));
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.pcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.pcard--hi { border-color: rgba(40, 184, 135, 0.5); box-shadow: var(--shadow-lg); }
.pcard__bar { height: 6px; width: 46px; border-radius: 999px; background: var(--glass-brd); margin-bottom: 18px; }
.pcard--hi .pcard__bar { background: linear-gradient(90deg, #b7da32, #28b887); }
.pcard__badge { position: absolute; right: 18px; top: 18px; padding: 4px 11px; border-radius: 999px; background: rgba(40, 184, 135, 0.16); color: var(--archivo-teal); font-size: 0.72rem; font-weight: 700; }
.pcard h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.15rem; font-weight: 700; color: var(--ink); }
.pcard__price { display: flex; align-items: flex-end; gap: 8px; margin-top: 10px; }
.pcard__amt { font-family: Georgia, "Times New Roman", serif; font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1; color: var(--ink); }
.pcard__cmp { padding-bottom: 4px; font-size: 0.86rem; color: var(--ink-faint); text-decoration: line-through; }
.pcard__sub { padding-bottom: 4px; font-size: 0.86rem; color: var(--ink-soft); }
.pcard__blurb { margin: 12px 0 0; font-size: 0.9rem; line-height: 1.5; color: var(--ink-soft); }
.pcard .btn { margin-top: 20px; min-height: 46px; }
.pcard__feats { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 11px; }
.pcard__feats li { font-size: 0.88rem; line-height: 1.45; color: var(--ink); }
.pcard__feats li:not(.head) {
  padding-left: 26px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M16.5 5.5 8 14l-4.5-4.5' stroke='%2328B887' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat left 3px;
}
.pcard__feats li.head { padding-top: 4px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); }

/* ---------- responsive: collapse to a single card ---------- */
@media (max-width: 860px) {
  .login__grid { grid-template-columns: 1fr; max-width: 420px; min-height: 0; }
  .login__panel { display: none; }
  .login__form-col { padding: 40px 26px; }
  .pgrid { grid-template-columns: 1fr; max-width: 380px; }
}
@media (max-width: 420px) {
  .login { padding-top: 84px; }
  .login__form-col { padding: 34px 20px; }
}

/* App-aligned browser sign-in shell ------------------------------------------------
 * Keep the web page as a plain, full-viewport split layout: square preview first
 * visually, then the form. This deliberately replaces the centred glass card and
 * promotional background above. */
.login__aura { display: none; }

.login {
  display: block;
  min-height: 100vh;
  padding: 0;
}

.login__grid {
  max-width: none;
  min-height: 100vh;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: var(--bg);
  box-shadow: none;
  backdrop-filter: none;
}

.login__panel {
  order: 1;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: clamp(40px, 7vw, 56px);
  color: var(--ink);
  background: var(--bg);
  overflow: visible;
}

.login__panel::after { content: none; }
.login__panel-brand { display: none; }

.login__preview {
  flex: none;
  width: 100%;
  max-width: min(560px, 68vh);
  gap: 20px;
}

.pv {
  width: 100%;
}

.login__form-col {
  order: 2;
  padding: 80px clamp(32px, 7vw, 56px) 48px;
}

.login__card { max-width: 448px; }

@media (max-width: 860px) {
  .login { padding: 84px 0 0; }
  .login__grid { min-height: auto; grid-template-columns: 1fr; }
  .login__form-col { min-height: calc(100vh - 84px); padding: 40px 26px; }
}

@media (max-width: 420px) {
  .login__form-col { padding: 34px 20px; }
}
