/* PCCVDI login & password-reset — uses the EXACT vs-* design system from
   /vendor/signup so the two pages are visually identical. login.js injects
   the .vs-shell layout and Frappe's built-in form elements are restyled to
   match .vs-field inputs / .vs-btn buttons inside the .vs-form-card slot. */

/* ── Luminous Logic auth tokens (mirror /hub admin + /vendor/signup) ── */
:root {
  --pc-bg: #faf8ff;
  --pc-bg-low: #f2f3ff;
  --pc-bg-card: #ffffff;
  --pc-line: #c7c4d7;
  --pc-line-soft: #e2e7ff;
  --pc-ink: #131b2e;
  --pc-ink-mute: #464554;
  --pc-ink-faint: #767586;
  --pc-indigo: #4648d4;
  --pc-indigo-dark: #2f2ebe;
  --pc-indigo-hi: #6063ee;
  --pc-indigo-soft: #e1e0ff;
}

/* ── Reset Frappe defaults on auth pages ─────────────────────────────── */
body.login-page,
body[data-path="login"],
body[data-path="login#login"],
body[data-path="update-password"],
body.update-password-page {
  background: var(--pc-bg) !important;
  margin: 0 !important;
  min-height: 100vh;
  color: var(--pc-ink);
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.login-page main.container,
body[data-path="login"] main.container,
body[data-path="login#login"] main.container,
body[data-path="update-password"] main.container,
body.update-password-page main.container {
  max-width: none !important;
  width: 100% !important;
  height: auto !important;
  display: block !important;
  padding: 0 !important;
  margin: 0 !important;
}

body[data-path="update-password"] .container,
body.update-password-page .container { height: auto !important; }

/* Strip Frappe form sections of their cards — our slot IS the card */
body.login-page .for-login,
body.login-page .for-login-with-email-link,
body.login-page .for-forgot,
body.login-page .for-signup,
body.login-page section[class^="for-"],
body[data-path="login"] section[class^="for-"] {
  background: transparent !important;
  min-height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
}

body.login-page .login-content,
body[data-path="login"] .login-content,
body[data-path="login#login"] .login-content,
body.login-page .page-card,
body[data-path="login"] .page-card,
body.update-password-page .portal-container,
body[data-path="update-password"] .portal-container {
  display: block !important;
  background: transparent !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: auto !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

body.update-password-page .portal-section { padding: 0 !important; }
body.update-password-page .portal-section.head { display: none !important; }

/* Kill default Frappe navbar/footer on auth pages */
body.login-page nav.navbar,
body.login-page > .navbar,
body.login-page footer.web-footer,
body.update-password-page nav.navbar,
body.update-password-page > .navbar,
body.update-password-page footer.web-footer,
body[data-path="login"] nav.navbar,
body[data-path="login"] footer.web-footer,
body[data-path="login#login"] nav.navbar,
body[data-path="login#login"] footer.web-footer,
body[data-path="update-password"] nav.navbar,
body[data-path="update-password"] footer.web-footer,
body.login-page .page-breadcrumbs,
body.update-password-page .page-breadcrumbs,
body.login-page .page-header-wrapper,
body.update-password-page .page-header-wrapper { display: none !important; }

/* ══════════════════════════════════════════════════════════════════════
   vs-* DESIGN SYSTEM (copied verbatim from /vendor/signup so the two
   pages render with identical styling, spacing and rhythm)
   ════════════════════════════════════════════════════════════════════ */

.vs-section { padding: 48px 24px 80px; }
.vs-shell {
  max-width: 1180px; margin: 0 auto;
  display: grid; grid-template-columns: 380px 1fr; gap: 32px;
  align-items: start;
}
@media (max-width: 920px) {
  .vs-shell { grid-template-columns: 1fr; }
  .vs-summary { order: 2; }
}

/* ── Left summary column ─────────────────────────────────────────── */
.vs-summary { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 88px; }
@media (max-width: 920px) { .vs-summary { position: static; } }

.vs-plan-card {
  background: #ffffff;
  border: 1px solid #c7c4d7;
  border-radius: 16px;
  padding: 26px 24px;
  position: relative;
  overflow: hidden;
}
.vs-plan-featured {
  border-color: #4648d4;
  box-shadow: 0 20px 40px rgba(70, 72, 212, .18);
}
.vs-plan-tag {
  position: absolute; top: 0; right: 0;
  background: #4648d4; color: #fff;
  padding: 5px 12px; font-size: 11px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  border-bottom-left-radius: 10px;
}
.vs-plan-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: #4648d4;
}
.vs-plan-name {
  font-size: 28px; font-weight: 800; color: #131b2e;
  margin: 4px 0 2px; letter-spacing: -0.02em;
}
.vs-plan-price {
  font-size: 36px; font-weight: 800; color: #131b2e;
  margin: 8px 0 6px; letter-spacing: -0.02em;
  display: flex; align-items: center; gap: 12px;
}
.vs-plan-price small { font-size: 16px; color: #464554; font-weight: 500; }
.vs-plan-logo {
  width: 48px; height: 48px; object-fit: contain;
  flex-shrink: 0;
}
.vs-plan-tagline { font-size: 14px; color: #464554; margin-bottom: 18px; }
.vs-plan-features {
  list-style: none; padding: 0; margin: 16px 0 0;
  border-top: 1px solid #e2e7ff; padding-top: 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.vs-plan-features li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14px; color: #131b2e;
}
.vs-plan-features svg { color: #4648d4; flex-shrink: 0; margin-top: 2px; }

.vs-plan-switcher {
  background: #ffffff;
  border: 1px solid #c7c4d7;
  border-radius: 12px;
  padding: 16px 18px;
}
.vs-switcher-label {
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: #464554; margin-bottom: 10px;
}
.vs-switcher-pill {
  display: block; padding: 9px 12px; margin-bottom: 6px;
  border-radius: 8px; background: #f2f3ff;
  color: #4648d4 !important; font-size: 13px; font-weight: 600;
  text-decoration: none !important; transition: background .15s;
}
.vs-switcher-pill:hover { background: #e1e0ff; }

.vs-trust {
  background: #ffffff;
  border: 1px solid #c7c4d7;
  border-radius: 12px;
  padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
}
.vs-trust-row { display: flex; gap: 12px; align-items: flex-start; }
.vs-trust-ic { font-size: 22px; flex-shrink: 0; }
.vs-trust-title { font-size: 14px; font-weight: 700; color: #131b2e; }
.vs-trust-sub { font-size: 12px; color: #464554; margin-top: 1px; }

/* ── Right form column ───────────────────────────────────────────── */
.vs-form-card {
  background: #ffffff;
  border: 1px solid #c7c4d7;
  border-radius: 16px;
  padding: 36px;
  box-shadow: 0 10px 28px rgba(19, 27, 46, .06);
}
@media (max-width: 920px) { .vs-form-card { padding: 24px; } }
.vs-form-head h1 {
  font-size: 30px; font-weight: 800; color: #131b2e;
  margin: 0 0 8px; letter-spacing: -0.02em;
}
.vs-form-head p { color: #464554; font-size: 15px; margin: 0 0 26px; line-height: 1.5; }

.vs-alert {
  padding: 14px 18px; border-radius: 10px; margin-bottom: 18px;
  background: #ffdad6; color: #93000a; font-size: 14px; font-weight: 500;
  border: 1px solid #ffb4ab;
}

.vs-section-head {
  font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: #464554;
  margin: 26px 0 14px; padding-bottom: 8px;
  border-bottom: 1px solid #e2e7ff;
}
.vs-section-head span { color: #767586; font-weight: 500; text-transform: none; letter-spacing: 0; }

.vs-field { margin-bottom: 16px; }
.vs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .vs-grid { grid-template-columns: 1fr; } }
.vs-label {
  display: block; font-size: 13px; font-weight: 600;
  color: #131b2e; margin-bottom: 6px;
}
.vs-req::after { content: " *"; color: #ba1a1a; }
.vs-field input {
  width: 100%; padding: 11px 14px;
  border: 1px solid #c7c4d7; border-radius: 8px;
  font-size: 14px; color: #131b2e; background: #ffffff;
  font-family: inherit; box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
}
.vs-field input::placeholder { color: #767586; }
.vs-field input:focus {
  outline: 0; border-color: #4648d4;
  box-shadow: 0 0 0 3px #e1e0ff;
}
.vs-hint { font-size: 12px; color: #767586; margin-top: 4px; }

.vs-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 13px 22px;
  border-radius: 8px; font-weight: 700; font-size: 15px;
  cursor: pointer; border: 1px solid transparent;
  text-decoration: none !important; line-height: 1.2;
  font-family: inherit;
  transition: all .15s;
}
.vs-btn-block { width: 100%; }
.vs-btn-primary {
  background: #4648d4; color: #ffffff !important;
  box-shadow: 0 8px 20px rgba(70, 72, 212, .22);
}
.vs-btn-primary:hover { background: #6063ee; }
.vs-btn-primary:disabled { opacity: .6; cursor: wait; }
.vs-btn-outline {
  background: #ffffff; color: #131b2e !important;
  border-color: #c7c4d7;
}
.vs-btn-outline:hover { background: #faf8ff; border-color: #4648d4; }

.vs-already {
  text-align: center; font-size: 14px; color: #464554;
  margin-top: 16px;
}
.vs-already a { color: #4648d4; font-weight: 600; }

.vs-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0;
  color: #767586; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
}
.vs-divider::before, .vs-divider::after {
  content: ''; flex: 1; height: 1px; background: #e2e7ff;
}

/* ══════════════════════════════════════════════════════════════════════
   Frappe-form element overrides — make Frappe's <input>, <button>, <a>
   inside .vs-form-card look EXACTLY like .vs-field / .vs-btn
   ════════════════════════════════════════════════════════════════════ */

.vs-form-card #pcLoginFormSlot,
.vs-form-card #pcResetFormSlot { display: block; }

/* Reset Frappe's nested page-card structure */
.vs-form-card .page-card,
.vs-form-card .page-card-head,
.vs-form-card .page-card-body,
.vs-form-card .page-card-actions {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.vs-form-card .page-card-head { display: none !important; }
.vs-form-card .page-card-head img,
.vs-form-card img.app-logo,
.vs-form-card .login-logo,
.vs-form-card .app-name { display: none !important; }
.vs-form-card .indicator.gray,
.vs-form-card .page-card-head .indicator { display: none !important; }

/* Hide Frappe's auto-injected H1/H2 in the login section (we have our own) */
.vs-form-card .for-login > h1:first-child,
.vs-form-card .for-login > h2:first-child { display: none !important; }
.vs-form-card section[class^="for-"] { display: block; }
.vs-form-card section[class^="for-"] .form-signin.hide { display: none !important; }

/* Labels look like vs-label */
.vs-form-card label,
.vs-form-card .form-label,
.vs-form-card .control-label {
  display: block !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--pc-ink) !important;
  margin-bottom: 6px !important;
  margin-top: 16px !important;
}
.vs-form-card label:first-of-type { margin-top: 0 !important; }
.vs-form-card .form-group { margin-bottom: 14px !important; }

/* Inputs look like vs-field input */
.vs-form-card input[type="email"],
.vs-form-card input[type="text"],
.vs-form-card input[type="password"],
.vs-form-card input.form-control {
  width: 100% !important;
  padding: 11px 14px !important;
  font-size: 14px !important;
  border: 1px solid var(--pc-line) !important;
  border-radius: 8px !important;
  background: var(--pc-bg-card) !important;
  color: var(--pc-ink) !important;
  transition: border-color .15s, box-shadow .15s !important;
  font-family: inherit !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}
.vs-form-card input::placeholder { color: var(--pc-ink-faint) !important; }
.vs-form-card input:focus {
  border-color: var(--pc-indigo) !important;
  outline: 0 !important;
  box-shadow: 0 0 0 3px var(--pc-indigo-soft) !important;
}

/* Primary submit button looks like vs-btn-primary */
.vs-form-card button.btn-login,
.vs-form-card button.btn-primary,
.vs-form-card .btn-login,
.vs-form-card button[type="submit"],
.vs-form-card #reset-password button#update {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: 100% !important;
  padding: 13px 22px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  background: var(--pc-indigo) !important;
  color: #ffffff !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  transition: background .15s !important;
  margin-top: 18px !important;
  box-shadow: 0 8px 20px rgba(70, 72, 212, .22) !important;
  letter-spacing: -0.005em !important;
  font-family: inherit !important;
}
.vs-form-card button[type="submit"]:hover,
.vs-form-card #reset-password button#update:hover {
  background: var(--pc-indigo-hi) !important;
}
.vs-form-card button[type="submit"]:disabled,
.vs-form-card #reset-password button#update:disabled {
  background: var(--pc-line) !important;
  color: var(--pc-ink-faint) !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
}

/* Secondary buttons (LDAP, OAuth) */
.vs-form-card .btn-secondary,
.vs-form-card .login-with-email-link,
.vs-form-card .social-login-btn {
  background: var(--pc-bg-card) !important;
  color: var(--pc-ink) !important;
  border: 1px solid var(--pc-line) !important;
  font-weight: 600 !important;
  padding: 11px 16px !important;
  border-radius: 8px !important;
  width: 100% !important;
  margin-top: 8px !important;
}
.vs-form-card .btn-secondary:hover {
  background: var(--pc-bg);
  border-color: var(--pc-indigo);
  color: var(--pc-indigo) !important;
}

/* Forgot password link */
.vs-form-card a.forgot-password,
.vs-form-card a[href*="forgot"],
.vs-form-card a[href*="reset"] {
  font-size: 13px !important;
  color: var(--pc-indigo) !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  display: inline-block;
  margin-top: 10px;
}
.vs-form-card a.forgot-password:hover { text-decoration: underline !important; }

/* Password reset show/hide toggle */
.vs-form-card .password-field { position: relative; }
.vs-form-card .password-field input { padding-right: 60px !important; padding-left: 14px !important; }
.vs-form-card .password-field .field-icon { display: none !important; }
.vs-form-card .password-field .toggle-password {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  cursor: pointer; font-size: 12px; font-weight: 600;
  color: var(--pc-indigo) !important; z-index: 3;
}
.vs-form-card .password-strength-indicator { display: none !important; }
.vs-form-card .password-strength-message,
.vs-form-card .password-mismatch-message {
  font-size: 13px !important;
  color: var(--pc-ink-mute) !important;
  margin-top: 8px !important;
}
.vs-form-card .password-mismatch-message:not(.hidden) { color: #ba1a1a !important; }

/* Frappe error/info messages — use vs-alert styling */
.vs-form-card .invalid-feedback,
.vs-form-card .alert-danger {
  background: #ffdad6 !important;
  color: #93000a !important;
  border: 1px solid #ffb4ab !important;
  border-radius: 10px !important;
  padding: 12px 14px !important;
  font-size: 14px !important;
  margin-top: 12px !important;
}
.vs-form-card .alert-success {
  background: #d1fae5 !important;
  color: #065f46 !important;
  border: 1px solid #a7f3d0 !important;
  border-radius: 10px !important;
  padding: 12px 14px !important;
  font-size: 14px !important;
  margin-top: 12px !important;
}

/* Mobile: stack the vs-grid on small screens */
@media (max-width: 600px) {
  .vs-section { padding: 24px 16px 48px; }
  .vs-form-card { padding: 22px; border-radius: 14px; }
  .vs-plan-card { padding: 22px 20px; }
  .vs-form-head h1 { font-size: 24px; }
  #pcLoginHeader .pc-nav-links { display: none; }
}
