/* login.css — V76 polished split-screen brand login.
 * Layout: 60/40 split on desktop (brand-hero left, form right).
 * Mobile: stacks (brand banner top, form below).
 * All colours from --brand-dark / --brand-mid / --brand-light tokens.
 */

html, body {
  background: var(--surface-page);
  color: var(--text-primary);
}
body { font-family: var(--font-sans); }

.login-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  background: var(--surface-page);
}

/* ── Left pane: brand hero ──────────────────────────────────── */
.login-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(2rem, 5vw, 4rem) clamp(2rem, 5vw, 4.5rem);
  /* Two-stop gradient using brand-dark + a slightly warmer dark
   * for depth. Animated very slowly so it feels alive without
   * distracting. */
  background:
    radial-gradient(ellipse at top right, rgba(106,173,228,0.35) 0%, transparent 55%),
    radial-gradient(ellipse at bottom left, rgba(43,45,110,0.85) 0%, var(--brand-dark) 70%),
    linear-gradient(135deg, #1e2057 0%, var(--brand-dark) 50%, #353890 100%);
  background-size: 200% 200%, 180% 180%, 100% 100%;
  animation: heroGradientShift 28s ease-in-out infinite;
  color: #fff;
}
@keyframes heroGradientShift {
  0%, 100% { background-position: 0% 0%, 100% 100%, 0 0; }
  50%      { background-position: 100% 100%, 0% 0%, 0 0; }
}

/* Decorative oversized infinity mark — semi-transparent, slowly
 * floats / breathes. SVG pulled from /img/neo-infinity-mark-white.svg. */
.login-hero::before {
  content: '';
  position: absolute;
  top: -6%;
  right: -12%;
  width: 90%;
  height: 110%;
  background: url('/img/neo-infinity-mark-white.svg') center/contain no-repeat;
  opacity: 0.08;
  filter: blur(0.6px);
  animation: heroInfinityFloat 14s ease-in-out infinite;
  pointer-events: none;
}
@keyframes heroInfinityFloat {
  0%, 100% { transform: translate(0, 0) rotate(-4deg); }
  50%      { transform: translate(-8px, -16px) rotate(4deg); }
}

/* Subtle decorative dot grid in the bottom-left — adds texture. */
.login-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60%;
  height: 60%;
  background-image: radial-gradient(rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 18px 18px;
  pointer-events: none;
  mask-image: linear-gradient(to top right, rgba(0,0,0,1) 10%, rgba(0,0,0,0) 70%);
  -webkit-mask-image: linear-gradient(to top right, rgba(0,0,0,1) 10%, rgba(0,0,0,0) 70%);
}

.login-hero-top { position: relative; z-index: 2; }
.login-hero-mid { position: relative; z-index: 2; max-width: 480px; }
.login-hero-bot { position: relative; z-index: 2; }

.login-hero-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.login-hero-logo img {
  width: 200px;
  max-width: 100%;
  height: auto;
}
.login-hero-tagline {
  font-size: 11px;
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--brand-mid);
  margin-top: 2px;
  animation: taglinePulse 2.5s ease-in-out infinite;
}
@keyframes taglinePulse {
  0%, 100% { opacity: 0.50; }
  50%      { opacity: 1.00; }
}

.login-hero-greeting {
  font-family: var(--font-serif);
  font-size: clamp(36px, 4.4vw, 60px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0 0 8px;
  animation: heroFadeIn 0.6s ease-out 0.1s both;
}
.login-hero-welcome {
  font-family: var(--font-serif);
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 400;
  line-height: 1.3;
  color: rgba(255,255,255,0.85);
  margin: 0 0 18px;
  animation: heroFadeIn 0.6s ease-out 0.25s both;
}
.login-hero-blurb {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255,255,255,0.65);
  max-width: 440px;
  animation: heroFadeIn 0.6s ease-out 0.4s both;
}
@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-hero-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.4px;
}
.login-hero-meta-divider {
  width: 1px;
  height: 12px;
  background: rgba(255,255,255,0.20);
}

/* ── Right pane: form ───────────────────────────────────────── */
.login-pane {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 4vw, 3.5rem) clamp(1.5rem, 5vw, 4rem);
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}
.login-pane-inner {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  animation: paneFadeIn 0.5s ease-out 0.2s both;
}
@keyframes paneFadeIn {
  from { opacity: 0; transform: translateX(8px); }
  to   { opacity: 1; transform: translateX(0); }
}

.login-pane-title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--brand-dark);
  margin: 0 0 6px;
}
.login-pane-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 28px;
  line-height: 1.5;
}

.login-form { display: grid; gap: 1rem; }

.field { display: grid; gap: 0.4rem; }
.field-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 800;
  color: var(--brand-dark);
}
.field-input {
  font: inherit;
  font-size: 15px;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-primary);
  color: var(--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  width: 100%;
}
.field-input:hover:not(:focus) {
  border-color: rgba(43,45,110,0.30);
}
.field-input:focus {
  outline: none;
  border-color: var(--brand-mid);
  box-shadow: 0 0 0 3px rgba(106,173,228,0.20);
  background: #fff;
}

/* Password / access-code show/hide toggle */
.field-password { position: relative; }
.field-password .field-input { padding-right: 44px; }
.field-password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
}
.field-password-toggle:hover {
  background: var(--brand-light);
  color: var(--brand-dark);
}
.field-password-toggle svg { width: 18px; height: 18px; }

.login-submit {
  margin-top: 0.5rem;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #fff;
  background: var(--brand-dark);
  border: none;
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  cursor: pointer;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(43,45,110,0.20);
}
.login-submit:hover:not(:disabled) {
  background: var(--brand-mid);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(43,45,110,0.30);
}
.login-submit:active:not(:disabled) { transform: translateY(0); }
.login-submit:disabled { background: var(--text-tertiary); cursor: wait; }
.login-submit svg { width: 16px; height: 16px; }

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 8px;
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-default);
}

.login-dev-skip {
  display: block;
  width: 100%;
  background: transparent;
  border: 1.5px dashed var(--border-default);
  color: var(--text-secondary);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.login-dev-skip:hover {
  border-color: var(--brand-mid);
  color: var(--brand-dark);
  background: var(--brand-light);
}

.login-error {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: #FBEAEA;
  color: var(--danger);
  border: 1px solid var(--danger);
  font-size: 13px;
  line-height: 1.45;
}
.login-error[hidden] { display: none; }
.login-error.locked  { background: #FEF3E2; color: var(--amber); border-color: var(--amber); }

.login-pane-foot {
  margin-top: 32px;
  font-size: 11px;
  color: var(--text-tertiary);
  text-align: center;
  letter-spacing: 0.3px;
}

/* ── Mobile (≤ 900px): stack hero on top of form ──────────── */
@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-hero {
    padding: 1.75rem 1.5rem 1.5rem;
    min-height: 220px;
    gap: 16px;
  }
  .login-hero::before { width: 110%; right: -30%; opacity: 0.06; }
  .login-hero-mid { max-width: none; }
  .login-hero-greeting { font-size: clamp(28px, 7vw, 40px); }
  .login-hero-welcome  { font-size: clamp(16px, 4vw, 22px); }
  .login-hero-blurb    { display: none; }
  .login-hero-meta     { display: none; }
  .login-pane { padding: 1.5rem; }
  .login-pane-inner { max-width: none; }
}

/* ── Feedback widget on login page (V74) ─────────────────────
 * Self-contained styles — login.css only loads on the login page so
 * we can't share with the in-app .feedback-fab from app.css. Same
 * visuals as the in-app version (see app.css "Feedback widget").
 */
.feedback-fab {
  position: fixed;
  bottom: 22px; right: 22px;
  z-index: 1200;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 10px 14px;
  background: var(--brand-mid);
  color: #fff;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(43,45,110,0.30);
  transition: transform 0.18s ease-out, box-shadow 0.18s, background 0.15s;
}
.feedback-fab:hover {
  transform: translateY(-1px);
  background: var(--brand-dark);
  box-shadow: 0 10px 28px rgba(43,45,110,0.45);
}
.feedback-fab svg { flex-shrink: 0; }

.feedback-scrim {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.40);
  z-index: 1190;
}
.feedback-scrim.open { display: block; }

.feedback-popup {
  display: none;
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(320px, 92vw, 480px);
  max-height: 84vh;
  background: var(--surface-primary);
  border: 3px solid var(--brand-mid);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(43,45,110,0.30);
  z-index: 1195;
  overflow: hidden;
}
.feedback-popup.open { display: flex; flex-direction: column; }

.feedback-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--border-default);
}
.feedback-header h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--brand-dark);
}
.feedback-close {
  width: 30px; height: 30px;
  border: 0; background: transparent;
  border-radius: 50%;
  font-size: 20px; line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
}
.feedback-close:hover { background: var(--brand-light); color: var(--brand-dark); }

.feedback-form {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 18px;
  background: var(--surface-tertiary);
}
.feedback-form label {
  font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-secondary);
}
.feedback-form textarea {
  font: inherit;
  font-size: 13px;
  padding: 10px 12px;
  min-height: 80px;
  background: #fff;
  color: #1A1A1A;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  resize: vertical;
}
.feedback-form textarea:focus {
  outline: none;
  border-color: var(--brand-mid);
}
.feedback-meta {
  font-size: 10px;
  color: var(--text-secondary);
}
.feedback-actions {
  display: flex; align-items: center; gap: 10px;
  margin-top: 4px;
}
.feedback-error {
  margin-top: 6px;
  padding: 6px 10px;
  background: #FBEAEA;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: var(--radius-md);
  font-size: 12px;
}

.btn-primary {
  font: inherit; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.4px;
  padding: 9px 14px;
  background: var(--brand-mid); color: #fff;
  border: 0; border-radius: var(--radius-md);
  cursor: pointer;
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary {
  font: inherit; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.4px;
  padding: 9px 14px;
  background: transparent; color: var(--brand-dark);
  border: 2px solid var(--brand-dark); border-radius: var(--radius-md);
  cursor: pointer;
}
.btn-secondary:hover { background: var(--brand-light); }
