/* =============================================================================
   VERSION 5 · SUNRISE — sign in / sign up / forgot / activate.
   Layered on the existing auth markup (every field, check and script is
   unchanged). Loaded after pz1-auth.css and the Sunrise kit.
   Phones: logo row + one big card. Computers (≥1024px): gradient brand
   panel on the left, card on the right.
   ============================================================================= */
:root[data-uiv="sunrise5"]:not(#sr5){
  --pz-heading: var(--heading); --pz-text: var(--text); --pz-muted: var(--muted); --pz-line: var(--line-strong);
  --pz-card: var(--surface); --pz-input: var(--surface-2); --pz-bg: var(--paper); --pz-page: var(--paper);
  --pz-auth-grad: var(--grad-sunrise);
  --text-primary: var(--heading); --text-secondary: var(--text); --text-muted: var(--muted);
  --accent-primary: var(--brand-fg); --bg-input: var(--surface-2); --border-card: var(--line);
  --success: #047857; --danger: #be123c;
  --sr5-grad-safe: linear-gradient(140deg, var(--sr-g1, var(--brand)) 0%, var(--sr-g2, var(--brand)) 52%, var(--sr-g3, var(--brand-3)) 100%);
  background: var(--paper) !important;
}
:root.dark[data-uiv="sunrise5"]:not(#sr5){ --success: #4ade80; --danger: #fb7185; }
:root[data-uiv="sunrise5"]:not(#sr5) body{ font-family: var(--font-sans) !important; color: var(--text); background: transparent !important; }

/* Top row: Sunrise logo + theme button */
.sr5-auth-top .sr-logo__word{ font-size: 1.05rem; }
:root[data-uiv="sunrise5"]:not(#sr5) .pz-auth-theme{ background: var(--surface); border: 1px solid var(--line); color: var(--heading); box-shadow: var(--sh-xs); border-radius: var(--r-md); }
html.dark .sr5-when-light, html:not(.dark) .sr5-when-dark{ display: none !important; }

/* Card */
:root[data-uiv="sunrise5"]:not(#sr5)[data-theme] .auth-form-inner{
  background: var(--surface) !important; border: 1px solid var(--line) !important; border-radius: calc(2rem * var(--radius-scale)) !important;
  box-shadow: var(--hl), var(--sh-float) !important;
}
:root[data-uiv="sunrise5"]:not(#sr5) .pz-auth-hero{ background: var(--sr5-grad-safe); }
:root[data-uiv="sunrise5"]:not(#sr5) .pz-auth-hero::before{
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: radial-gradient(circle, #ffffff40 1.2px, transparent 1.6px) 0 0 / 12px 12px;
  -webkit-mask: linear-gradient(120deg, transparent 40%, #000); mask: linear-gradient(120deg, transparent 40%, #000);
}
:root[data-uiv="sunrise5"]:not(#sr5) .pz-auth-hero h1{ font-family: var(--font-display); font-weight: 800; letter-spacing: -.03em; color: #fff; position: relative; }
:root[data-uiv="sunrise5"]:not(#sr5) .pz-auth-hero p{ position: relative; color: #fff; opacity: 1; }
:root[data-uiv="sunrise5"]:not(#sr5) .pz-auth-hero__icon{ background: #ffffff2e; box-shadow: inset 0 0 0 1px #ffffff40; border-radius: 1rem; position: relative; }

/* Fields */
:root[data-uiv="sunrise5"]:not(#sr5)[data-theme] .auth-form-inner :is(.form-input, .form-select){
  height: 3rem !important; background: var(--surface-2) !important; border: 1px solid var(--line-strong) !important;
  border-radius: var(--r-md) !important; color: var(--heading) !important; font-family: var(--font-sans) !important; font-size: .9375rem !important;
}
:root[data-uiv="sunrise5"]:not(#sr5)[data-theme] .auth-form-inner :is(.form-input, .form-select):focus{ border-color: var(--brand) !important; box-shadow: 0 0 0 4px var(--brand-soft-2) !important; background: var(--surface) !important; }
:root[data-uiv="sunrise5"]:not(#sr5)[data-theme] .auth-form-inner .form-label{ color: var(--heading) !important; font-family: var(--font-sans); }
:root[data-uiv="sunrise5"]:not(#sr5) .forgot-link, :root[data-uiv="sunrise5"]:not(#sr5) .pz-auth-foot a{ color: var(--brand-fg) !important; font-weight: 700; }
:root[data-uiv="sunrise5"]:not(#sr5) .pz-auth-foot{ color: var(--muted); }
:root[data-uiv="sunrise5"]:not(#sr5) .form-input.error{ border-color: var(--danger) !important; }
:root[data-uiv="sunrise5"]:not(#sr5) .form-error{ color: var(--danger) !important; }

/* Primary button = Sunrise gradient (white text is kept AA by the theme engine) */
:root[data-uiv="sunrise5"]:not(#sr5) .auth-form-inner .btn-primary{
  height: 3.25rem; border: 0 !important; border-radius: var(--r-md) !important; color: #fff !important; font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em;
  background: linear-gradient(135deg, var(--sr-g1, var(--brand)), var(--sr-g2, var(--brand)) 55%, var(--sr-g3, var(--brand-3))) !important;
  box-shadow: var(--hl), var(--sh-brand) !important;
}
:root[data-uiv="sunrise5"]:not(#sr5) .auth-form-inner .btn-primary:active{ transform: scale(.98); }

/* Computers: gradient brand panel on the left */
.sr5-auth-aside{ display: none; }
@media (min-width: 64rem){
  .sr5-auth-aside{
    display: flex; position: fixed; inset: 1rem auto 1rem 1rem; width: calc(46vw - 2rem); max-width: 40rem; z-index: 0;
    border-radius: calc(2rem * var(--radius-scale)); overflow: hidden; color: #fff; isolation: isolate;
    background: radial-gradient(70% 60% at 100% 0%, #ffffff1a, transparent 60%), var(--sr5-grad-safe); box-shadow: var(--sh-float);
  }
  .sr5-auth-aside::before{ content: ""; position: absolute; inset: 0; z-index: -1; opacity: .35;
    background: radial-gradient(circle, #ffffff59 1.3px, transparent 1.7px) 0 0 / 14px 14px;
    -webkit-mask: linear-gradient(160deg, #000, transparent 55%); mask: linear-gradient(160deg, #000, transparent 55%); }
  .sr5-auth-aside__in{ display: flex; flex-direction: column; justify-content: center; gap: 1rem; padding: clamp(2rem, 4vw, 3.5rem); width: 100%; }
  .sr5-auth-aside__logo .sr-logo__word, .sr5-auth-aside__logo .sr-logo__word > span{ color: #fff; }
  .sr5-auth-aside__logo .sr-logo__mark{ background: #ffffff30; box-shadow: inset 0 0 0 1px #ffffff4d; }
  .sr5-auth-aside__k{ margin-top: 1.5rem; font-size: .75rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #ffffffd9; }
  .sr5-auth-aside__t{ font-family: var(--font-display); font-weight: 800; letter-spacing: -.035em; font-size: clamp(2rem, 1.2rem + 1.8vw, 3rem); line-height: 1.08; color: #fff; text-wrap: balance; }
  .sr5-auth-aside__s{ font-size: 1rem; line-height: 1.6; color: #fffffff0; max-width: 28rem; }
  .sr5-auth-aside__list{ list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .75rem; }
  .sr5-auth-aside__list li{ display: flex; align-items: center; gap: .875rem; padding: .75rem .875rem; border-radius: 1rem; background: #ffffff1f; box-shadow: inset 0 0 0 1px #ffffff2e; }
  .sr5-auth-aside__list b{ display: block; font-weight: 700; color: #fff; }
  .sr5-auth-aside__list small{ display: block; font-size: .8125rem; color: #ffffffe0; }
  .sr5-auth-aside__ic{ width: 2.5rem; height: 2.5rem; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: .875rem; background: #fff; font-size: 1.35rem; color: var(--brand); }
  :root[data-uiv="sunrise5"]:not(#sr5)[data-theme] .auth-form-panel{ padding-left: calc(46vw + 1rem) !important; padding-right: 2rem !important; justify-content: center; }
}

/* Brand mark (Higgsfield SVG) */
.sr-logo__mark{ align-items: center; justify-content: center; }
.sr-logo__mark .sr5-mark{ width: 72%; height: 72%; filter: drop-shadow(0 1px 1px #0000002e); }

.sr-logo__word > span{ color: var(--brand-fg); }
:root[data-uiv="sunrise5"]:not(#sr5) .pz-auth-foot{ color: var(--text); }
/* placeholders: readable but still lighter than typed text */
:root[data-uiv="sunrise5"]:not(#sr5) :is(input, textarea)::placeholder{ color: color-mix(in srgb, var(--muted) 65%, var(--heading)) !important; opacity: 1 !important; }
