/* Agent 6 scoped authentication, setup and public error experience. */
[data-agent6-auth-shell] { background: radial-gradient(circle at 12% 12%, rgb(37 99 235 / 8%), transparent 28rem), radial-gradient(circle at 92% 82%, rgb(15 118 110 / 8%), transparent 30rem), #f5f7fa; }
[data-agent6-auth-shell] .nv-auth-header { width: min(calc(100% - 32px), 1200px); min-height: 76px; margin: 0 auto; padding: 14px 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.nv-auth-nav { display: flex; align-items: center; gap: 5px; }
.nv-auth-nav a { min-height: 44px; padding: 10px 13px; display: inline-flex; align-items: center; border-radius: 11px; color: var(--color-text-secondary); font-size: .9rem; font-weight: 750; text-decoration: none; }
.nv-auth-nav a:hover { background: var(--color-surface); color: var(--color-text); }
[data-agent6-auth-shell] .nv-auth-main { width: min(calc(100% - 32px), 1200px); padding: 42px 0 70px; }
.nv-login-layout { min-height: min(650px, calc(100dvh - 150px)); display: grid; grid-template-columns: minmax(0,1.04fr) minmax(390px,.76fr); align-items: stretch; gap: 22px; }
.nv-login-story { min-width: 0; padding: clamp(34px,5vw,64px); display: grid; align-content: center; border: 1px solid #1f3148; border-radius: 28px; background: radial-gradient(circle at 84% 8%, rgb(20 184 166 / 22%), transparent 25rem), radial-gradient(circle at 4% 100%, rgb(37 99 235 / 28%), transparent 26rem), #111d2e; color: white; box-shadow: 0 28px 70px rgb(15 23 42 / 14%); }
.nv-login-story .nv-kicker { color: #7dd3fc; }
.nv-login-story h1 { max-width: 13ch; margin: 14px 0 0; color: white; font-size: clamp(2.5rem,5vw,5rem); line-height: .98; letter-spacing: -.055em; text-wrap: balance; }
.nv-login-story > p { max-width: 58ch; margin: 20px 0 0; color: #c5d2e1; font-size: 1.05rem; line-height: 1.7; }
.nv-login-story ul { margin: 30px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; list-style: none; }
.nv-login-story li { min-width: 0; padding: 16px; border: 1px solid rgb(255 255 255 / 11%); border-radius: 15px; background: rgb(255 255 255 / 6%); }
.nv-login-story li strong, .nv-login-story li span { display: block; }
.nv-login-story li strong { color: white; font-size: .9rem; }
.nv-login-story li span { margin-top: 5px; color: #aebdce; font-size: .8rem; line-height: 1.45; }
.nv-auth-card { min-width: 0; padding: clamp(24px,3vw,38px); align-self: center; border: 1px solid var(--color-border); border-radius: 24px; background: var(--color-surface); box-shadow: var(--shadow-md); }
.nv-auth-card__head { margin-bottom: 22px; }
.nv-auth-card__head h2 { margin: 8px 0 6px; color: var(--color-text); font-size: clamp(1.8rem,3vw,2.45rem); letter-spacing: -.04em; }
.nv-auth-card__head p { margin: 0; color: var(--color-text-muted); line-height: 1.6; }
.nv-auth-form { display: grid; gap: 17px; }
.nv-field { min-width: 0; display: grid; gap: 7px; }
.nv-field label { color: var(--color-text); font-size: .9rem; font-weight: 780; }
.nv-field label span { color: var(--color-text-muted); font-size: .76rem; font-weight: 550; }
.nv-field :where(input,textarea,select) { width: 100%; min-height: 50px; padding: 12px 13px; border: 1px solid var(--color-border-strong); border-radius: 13px; background: var(--color-surface); color: var(--color-text); font: inherit; box-shadow: inset 0 1px 2px rgb(16 24 40 / 4%); }
.nv-field textarea { min-height: 110px; resize: vertical; }
.nv-field small, .nv-help { color: var(--color-text-muted); font-size: .82rem; line-height: 1.5; }
.nv-field :where(input,textarea,select):focus { border-color: var(--color-primary); outline: 3px solid color-mix(in srgb,var(--color-focus) 18%,transparent); outline-offset: 1px; }
.nv-field :where(input,textarea,select):user-invalid { border-color: var(--color-danger); }
.nv-secret-field { position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.nv-secret-toggle { min-width: 86px; min-height: 50px; padding: 0 14px; border: 1px solid var(--color-border-strong); border-radius: 13px; background: var(--color-surface-subtle); color: var(--color-text); font-weight: 750; }
.nv-secret-toggle:hover { border-color: var(--color-primary); background: color-mix(in srgb,var(--color-primary) 7%,white); }
.nv-capslock { padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb,var(--color-warning) 10%,white); color: #7a4807 !important; }
.nv-submit { width: 100%; min-height: 50px; justify-content: center; }
.nv-auth-links { margin-top: 19px; padding-top: 18px; display: flex; flex-wrap: wrap; gap: 11px 16px; border-top: 1px solid var(--color-border); }
.nv-auth-links a, .nv-secondary-link { color: var(--color-primary-strong); font-size: .9rem; font-weight: 750; text-underline-offset: 3px; }
.nv-security-note { margin: 18px 0 0; padding: 12px 13px; border-radius: 12px; background: var(--color-surface-subtle); color: var(--color-text-muted); font-size: .78rem; line-height: 1.55; }
.nv-alert { padding: 13px 15px; display: grid; gap: 3px; border: 1px solid; border-radius: 13px; line-height: 1.5; }
.nv-alert strong { color: currentColor; }
.nv-alert--success { border-color: color-mix(in srgb,var(--color-success) 35%,white); background: color-mix(in srgb,var(--color-success) 9%,white); color: #075d3a; }
.nv-alert--danger { border-color: color-mix(in srgb,var(--color-danger) 32%,white); background: color-mix(in srgb,var(--color-danger) 8%,white); color: #8f2018; }
.nv-alert--warning { border-color: color-mix(in srgb,var(--color-warning) 36%,white); background: color-mix(in srgb,var(--color-warning) 10%,white); color: #754708; }
.nv-alert--info { border-color: color-mix(in srgb,var(--color-info) 30%,white); background: color-mix(in srgb,var(--color-info) 8%,white); color: #174f9d; }
.nv-onboarding-surface { padding: 6px 0; }
.nv-onboarding-layout { min-height: min(650px, calc(100dvh - 150px)); display: grid; grid-template-columns: minmax(0,.9fr) minmax(430px,1.1fr); align-items: center; gap: 22px; }
.nv-onboarding-intro { min-width: 0; padding: clamp(32px,5vw,58px); border: 1px solid #1d3047; border-radius: 27px; background: radial-gradient(circle at 90% 0%, rgb(20 184 166 / 20%), transparent 25rem), #142238; color: white; }
.nv-onboarding-intro .nv-kicker { color: #7dd3fc; }
.nv-onboarding-intro h1 { margin: 13px 0 0; color: white; font-size: clamp(2.2rem,4.5vw,4.35rem); line-height: 1; letter-spacing: -.05em; text-wrap: balance; }
.nv-onboarding-intro > p { margin: 20px 0 0; color: #c4d1df; font-size: 1.02rem; line-height: 1.7; }
.nv-onboarding-intro :where(ul,ol) { margin: 25px 0 0; padding-inline-start: 20px; display: grid; gap: 11px; color: #d7e2ed; }
.nv-onboarding-form { align-self: center; }
.nv-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.nv-field--full { grid-column: 1 / -1; }
.nv-onboarding-summary-card { padding: clamp(30px,5vw,58px); border: 1px solid var(--color-border); border-radius: 27px; background: var(--color-surface); box-shadow: var(--shadow-md); }
.nv-onboarding-summary-card > h1 { max-width: 18ch; margin: 12px 0 0; font-size: clamp(2.2rem,4.6vw,4.4rem); line-height: 1; letter-spacing: -.05em; text-wrap: balance; }
.nv-onboarding-summary-card > p { max-width: 70ch; margin: 18px 0 0; color: var(--color-text-muted); font-size: 1.02rem; line-height: 1.7; }
.nv-summary-grid { margin: 28px 0 0; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.nv-summary-grid div { padding: 16px; border: 1px solid var(--color-border); border-radius: 14px; background: var(--color-surface-subtle); }
.nv-summary-grid dt { color: var(--color-text-muted); font-size: .75rem; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; }
.nv-summary-grid dd { margin: 5px 0 0; color: var(--color-text); font-weight: 780; }
.nv-plan-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.nv-plan-grid article { padding: 22px; border: 1px solid var(--color-border); border-radius: 17px; background: var(--color-surface-subtle); }
.nv-plan-grid article > span { color: var(--color-primary); font-size: .74rem; font-weight: 850; }
.nv-plan-grid h2 { margin: 18px 0 0; font-size: 1.15rem; }
.nv-plan-grid p { margin: 8px 0 0; color: var(--color-text-muted); line-height: 1.6; }
.nv-completion-actions, .nv-actions { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 10px; }
.nv-result-state { display: grid; justify-items: start; gap: 12px; }
.nv-result-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb,var(--color-success) 13%,white); color: var(--color-success); font-size: 1.4rem; font-weight: 900; }
.nv-result-state--warning .nv-result-icon { background: color-mix(in srgb,var(--color-warning) 13%,white); color: var(--color-warning); }
.nv-result-state h2 { margin: 0; font-size: clamp(1.65rem,3vw,2.3rem); }
.nv-result-state p { margin: 0; color: var(--color-text-muted); line-height: 1.65; }
.nv-error-page { min-height: 100dvh; padding: 24px; display: grid; place-items: center; background: radial-gradient(circle at 10% 10%, rgb(37 99 235 / 9%), transparent 25rem), #f3f6f9; }
.nv-error-page main { width: min(100%, 980px); }
.nv-error-card { padding: clamp(28px,5vw,58px); display: grid; grid-template-columns: auto minmax(0,1fr); align-items: start; gap: clamp(22px,4vw,42px); border: 1px solid var(--color-border); border-radius: 27px; background: var(--color-surface); box-shadow: var(--shadow-md); }
.nv-error-code { min-width: 120px; color: color-mix(in srgb,var(--color-primary) 14%,white); font-size: clamp(4.4rem,12vw,8rem); font-weight: 900; line-height: .8; letter-spacing: -.08em; }
.nv-error-card h1 { margin: 10px 0 0; font-size: clamp(2rem,4vw,3.8rem); line-height: 1; letter-spacing: -.045em; }
.nv-error-card > div > p { margin: 16px 0 20px; color: var(--color-text-muted); font-size: 1.02rem; line-height: 1.65; }
/* Existing ZIP4 demo template receives the same scoped surface without preserving the old dark theme. */
.zip4-public-surface { color: var(--color-text); }
.zip4-shell { width: 100%; }
.zip4-form-layout { display: grid; grid-template-columns: minmax(0,.9fr) minmax(420px,1.1fr); align-items: center; gap: 22px; }
.zip4-panel, .zip4-form-card, .zip4-confirmation-card { min-width: 0; padding: clamp(24px,3vw,38px); border: 1px solid var(--color-border); border-radius: 23px; background: var(--color-surface); box-shadow: var(--shadow-md); }
.zip4-panel { background: #142238; color: white; }
.zip4-panel :where(h1,h2,h3) { color: white; }
.zip4-panel :where(p,li) { color: #c4d1df; }
.zip4-kicker { color: #7dd3fc; font-size: .73rem; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.zip4-panel h1 { margin-top: 12px; font-size: clamp(2.2rem,4.5vw,4.4rem); line-height: 1; letter-spacing: -.05em; }
.zip4-lead { line-height: 1.67; }
.zip4-step-grid, .zip4-onboarding-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.zip4-step-card, .zip4-onboarding-summary > div { padding: 14px; border: 1px solid color-mix(in srgb,var(--color-border) 70%,transparent); border-radius: 14px; background: color-mix(in srgb,var(--color-surface-subtle) 75%,transparent); }
.zip4-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.zip4-field { min-width: 0; display: grid; gap: 7px; }
.zip4-field.full { grid-column: 1 / -1; }
.zip4-field label { color: var(--color-text); font-size: .9rem; font-weight: 780; }
.zip4-field :where(input,textarea,select) { width: 100%; min-height: 50px; padding: 12px 13px; border: 1px solid var(--color-border-strong); border-radius: 13px; background: var(--color-surface); color: var(--color-text); font: inherit; }
.zip4-field textarea { min-height: 110px; resize: vertical; }
.zip4-btn { min-height: 46px; margin-top: 14px; padding: 10px 15px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--color-border); border-radius: 12px; font-weight: 780; text-decoration: none; }
.zip4-btn.primary { border-color: var(--color-primary); background: var(--color-primary); color: white; }
.zip4-btn.secondary, .zip4-btn.ghost { background: var(--color-surface); color: var(--color-primary-strong); }
@media (max-width: 900px) {
  [data-agent6-auth-shell] .nv-auth-header, [data-agent6-auth-shell] .nv-auth-main { width: min(calc(100% - 24px), 1200px); }
  .nv-login-layout, .nv-onboarding-layout, .zip4-form-layout { grid-template-columns: 1fr; min-height: auto; }
  .nv-login-story { min-height: 430px; }
  .nv-login-story ul { grid-template-columns: 1fr; }
  .nv-onboarding-intro { min-height: auto; }
  .nv-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .nv-plan-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  [data-agent6-auth-shell] .nv-auth-header { align-items: flex-start; }
  .nv-auth-nav { display: none; }
  [data-agent6-auth-shell] .nv-auth-main { padding-top: 18px; }
  .nv-login-story, .nv-auth-card, .nv-onboarding-intro, .nv-onboarding-summary-card, .zip4-panel, .zip4-form-card, .zip4-confirmation-card { padding: 24px 20px; border-radius: 20px; }
  .nv-login-story { min-height: 360px; }
  .nv-login-story h1, .nv-onboarding-intro h1 { font-size: clamp(2.25rem,11vw,3.45rem); }
  .nv-form-grid, .nv-summary-grid, .zip4-form-grid, .zip4-step-grid, .zip4-onboarding-summary { grid-template-columns: 1fr; }
  .nv-field--full, .zip4-field.full { grid-column: auto; }
  .nv-secret-field { grid-template-columns: 1fr; }
  .nv-secret-toggle { width: 100%; }
  .nv-actions > :where(.btn,.zip4-btn), .nv-completion-actions > .btn { width: 100%; justify-content: center; }
  .nv-error-page { padding: 12px; }
  .nv-error-card { grid-template-columns: 1fr; padding: 26px 20px; }
  .nv-error-code { min-width: 0; font-size: 4.5rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
@media (forced-colors: active) { .nv-login-story, .nv-onboarding-intro { border: 2px solid CanvasText; } .nv-auth-card, .nv-error-card { border: 2px solid CanvasText; } }
/* Agent 6 second browser correction: complete auth forms before supporting story on small screens. */
[data-agent6-auth-shell] .nv-brand { min-width: 0; display: inline-flex; align-items: center; gap: 10px; color: var(--color-text); text-decoration: none; }
[data-agent6-auth-shell] .nv-brand__mark { flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--color-border); border-radius: 13px; background: var(--color-surface); box-shadow: var(--shadow-sm); }
[data-agent6-auth-shell] .nv-brand__mark img { width: 100%; height: 100%; object-fit: contain; }
[data-agent6-auth-shell] .nv-brand__copy { min-width: 0; display: grid; line-height: 1.12; }
[data-agent6-auth-shell] .nv-brand__copy strong { color: var(--color-text); font-size: 1rem; letter-spacing: -.015em; }
[data-agent6-auth-shell] .nv-brand__copy small { margin-top: 3px; max-width: 34ch; overflow: hidden; color: var(--color-text-muted); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 620px) {
  [data-agent6-auth-shell] .nv-auth-header { align-items: center; }
  [data-agent6-auth-shell] .nv-brand__copy { max-width: calc(100vw - 92px); }
  .nv-login-layout { display: flex; flex-direction: column; }
  .nv-auth-card { order: 1; align-self: stretch; }
  .nv-login-story { order: 2; min-height: auto; }
  .nv-login-story h1 { font-size: clamp(2.05rem, 9.8vw, 2.9rem); }
  .nv-login-story ul { margin-top: 20px; }
}
[data-agent6-auth] .nv-auth-card__head h2,
[data-agent6-auth] .nv-result-state h2,
[data-agent6-auth] .nv-onboarding-summary-card h1 { color: var(--ui-text, #17202a) !important; }
