/* =========================================================
   CKD Hub — Sign-in, verification and legal pages
   Layout follows the approved screen: Dark Green stage, activity on
   the left, a white rounded card floating on the right. Depends on
   brand.css for the Boehringer Forward faces, the palette tokens and
   the top bar.
   ========================================================= */

:root {
  --ink:        #08312A;
  --ink-2:      #0B342A;
  --ink-3:      #12463A;
  --paper:      #F6F5F3;
  --warm:       #E5E3DE;
  --surface:    #FFFFFF;
  --green:      #00E47C;
  --green-soft: #5FE3A4;
  --green-deep: #00A85C;
  --green-ink:  #00663A;
  --slate:      #5A6B64;
  --slate-2:    #84968D;
  --line:       #DDE4DD;
  --line-2:     #EDF1EC;
  --red:        #D4553C;
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --r-card: 24px;
  --sans: var(--font-text);
  --head: var(--font-head);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Gutter of Dark Green left visible around the floating card. */
  --card-gutter-x: clamp(14px, 4vw, 76px);
  --card-gutter-y: clamp(14px, 2.4vh, 28px);
}

/* The UA stylesheet's [hidden] { display: none } loses to any author rule that
   sets display. Declare it once, at author level, for everything. */
[hidden] { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { min-height: 100%; }
body.ckd-signin-page {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -.01em; font-weight: 700; font-family: var(--head); }
p { margin: 0; }
button { font: inherit; cursor: pointer; border: 0; }
a { color: var(--green-ink); text-decoration: underline; }
input, select { font: inherit; }
img { max-width: 100%; }

/* ---- Layout ---- */
.login {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: stretch;
  min-height: calc(100dvh - var(--topbar-h));
  background: var(--ink);
}
/* dvh is not everywhere yet; vh is the fallback that ships first. */
@supports not (height: 100dvh) {
  .login { min-height: calc(100vh - var(--topbar-h)); }
}

/* =========================================================
   Left: activity
   ========================================================= */
.login-art {
  background: var(--ink);
  color: #fff;
  padding: clamp(22px, 3vh, 40px) clamp(22px, 3vw, 48px) clamp(18px, 2.4vh, 30px) clamp(22px, 4.6vw, 84px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-width: 0;
}
.art-stack { margin: auto 0; padding: clamp(8px, 1.6vh, 20px) 0 clamp(12px, 2vh, 24px); }
.lockup-img {
  width: 100%;
  max-width: clamp(180px, 17vw, 285px);
  height: auto;
  display: block;
  margin-bottom: clamp(18px, 3.6vh, 40px);
}
.login-art h1 {
  font-size: clamp(30px, 3.3vw, 52px);
  font-weight: 700;
  max-width: 15ch;
  line-height: 1.06;
  color: var(--green);
  overflow-wrap: break-word;
}
.lede {
  color: #fff;
  max-width: 46ch;
  margin-top: clamp(12px, 2vh, 20px);
  font-size: clamp(14.5px, 1.02vw, 17.5px);
  line-height: 1.5;
}
.facts {
  display: flex;
  gap: clamp(18px, 2vw, 34px);
  margin-top: clamp(16px, 2.8vh, 28px);
  flex-wrap: wrap;
}
.fact { display: flex; flex-direction: column; gap: 3px; }
.fact b {
  font-family: var(--head);
  font-size: clamp(20px, 1.6vw, 27px);
  font-weight: 700;
  line-height: 1;
  color: var(--green);
}
.fact span {
  font-size: 12.5px;
  color: rgba(255,255,255,.6);
  letter-spacing: .04em;
}
.art-foot { margin-top: auto; padding-top: clamp(14px, 2.4vh, 26px); max-width: 620px; }
.art-foot .sponsor-foot { font-size: 11px; }

/* =========================================================
   Right: floating white card
   ========================================================= */
.login-form {
  display: flex;
  align-items: stretch;
  padding: var(--card-gutter-y) var(--card-gutter-x) calc(var(--card-gutter-y) + 8px) 0;
  min-width: 0;
}
.login-card {
  background: var(--surface);
  border-radius: var(--r-card);
  padding: clamp(24px, 2.6vw, 42px) clamp(22px, 2.8vw, 46px) clamp(22px, 2.2vw, 34px);
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.eyebrow {
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--green-deep);
}
.login-card h2 {
  font-size: clamp(24px, 1.9vw, 33px);
  margin: 8px 0 8px;
}
.sub {
  color: var(--slate);
  margin-bottom: clamp(16px, 2vh, 22px);
  font-size: clamp(14.5px, .95vw, 15.5px);
  line-height: 1.5;
}
.note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--paper);
  border: 1px solid var(--warm);
  border-radius: var(--r-sm);
  padding: 13px 16px;
  font-size: 14px;
  color: var(--slate);
  margin-bottom: clamp(16px, 2.2vh, 24px);
  line-height: 1.5;
}
.note-icon {
  flex: none;
  width: 20px; height: 20px;
  border: 1.5px solid var(--slate);
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; line-height: 1;
  color: var(--slate);
  margin-top: 2px;
}
.field { margin-bottom: 14px; }
.field label, .otp-label {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--ink);
}
.inp {
  width: 100%;
  padding: 13px 17px;
  border: 1.5px solid var(--paper);
  border-radius: var(--r-sm);
  font-size: 15.5px;
  background: var(--paper);
  color: var(--ink);
  transition: border-color .15s, background .15s;
  outline: none;
}
.inp::placeholder { color: var(--slate-2); }
.inp:focus {
  border-color: var(--green-deep);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(0,168,92,.12);
}

/* ---- Buttons (5 px corners — brand kit) ---- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 18px;
  border-radius: var(--r-btn);
  font-size: 15.5px;
  font-weight: 700;
  transition: background .15s, color .15s, opacity .15s;
  background: var(--ink);
  color: var(--green);
}
.btn:hover { background: var(--ink-3); }
.btn:focus-visible { outline: 3px solid rgba(0,228,124,.45); outline-offset: 2px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-green {
  background: var(--green);
  color: var(--ink);
}
.btn-green:hover { background: var(--green-deep); color: #fff; }

/* ---- OTP inputs ---- */
.otp {
  display: flex;
  gap: 8px;
  margin: 0 0 18px;
}
.otp-input {
  flex: 1 1 0;
  min-width: 0;
  max-width: 56px;
  height: 54px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  border: 1.5px solid var(--paper);
  border-radius: var(--r-sm);
  background: var(--paper);
  outline: none;
  transition: border-color .15s, background .15s;
}
.otp-input:focus {
  border-color: var(--green-deep);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(0,168,92,.12);
}

/* ---- Hints, errors, success ---- */
.hint {
  margin-top: 14px;
  font-size: 14px;
  color: var(--slate);
  line-height: 1.55;
}
.hint a { color: var(--green-deep); }
.error-msg {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: rgba(212,85,60,.1);
  color: var(--red);
  font-size: 14px;
  font-weight: 500;
}
.success-msg {
  padding: 18px;
  border-radius: var(--r);
  background: rgba(0,228,124,.12);
  color: var(--green-ink);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}
.success-msg span { font-size: 22px; }

/* ---- Legal footer ---- */
.rule { border: 0; border-top: 1px solid var(--line); margin: clamp(18px, 2.4vh, 30px) 0 16px; }
.legal {
  font-size: 12.5px;
  color: var(--slate);
  line-height: 1.6;
}
.legal + .legal { margin-top: 10px; }
.legal.mono { font-family: var(--mono); font-size: 11px; color: var(--slate-2); letter-spacing: .04em; }
.link-green { color: var(--green-deep); font-weight: 500; }
.link-green:hover { color: var(--green-ink); }

/* ---- Spinner ---- */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(0,228,124,.3);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn-green .spinner {
  border-color: rgba(8,49,42,.2);
  border-top-color: var(--ink);
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 1.6s; } }

/* =========================================================
   Responsive
   ========================================================= */

/* Narrow desktop / small laptop: even out the split. */
@media (max-width: 1280px) {
  .login { grid-template-columns: 1fr 1fr; }
  .art-stack { padding: 12px 0 20px; }
}

/* Tablet landscape: the two columns stop earning their keep. */
@media (max-width: 1024px) {
  .login {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    min-height: 0;
  }

  /* Sign-in first. Stacked, the activity panel pushed the form most of a
     screen down and the reader had to scroll past copy to reach the one
     thing the page exists for. Source order stays desktop-correct; only
     the visual order flips. */
  .login-form { order: 1; }
  .login-art  { order: 2; }

  .login-form {
    padding: clamp(14px, 3vw, 24px) clamp(12px, 3vw, 28px) clamp(18px, 4vw, 30px);
  }
  .login-card { max-width: none; }

  .login-art {
    padding: clamp(22px, 5vw, 34px) clamp(20px, 5vw, 44px) 28px;
    justify-content: flex-start;
  }
  .art-stack { margin: 0; padding: 0 0 20px; }
  .login-art h1 { font-size: clamp(30px, 5.2vw, 44px); max-width: 20ch; }
  .lede { max-width: 60ch; }
  .art-foot { margin-top: 24px; }
}

/* Phones. */
@media (max-width: 640px) {
  :root { --r-card: 18px; }
  .login-art { padding: 24px 18px 22px; }

  /* The top bar already carries the lockup; repeating it at 210px right
     underneath cost a third of the first screen. Delete this rule to
     bring it back. */
  .lockup-img { display: none; }
  .login-art h1 { font-size: 30px; line-height: 1.08; max-width: none; }
  .lede { font-size: 15px; margin-top: 14px; }
  .facts { gap: 20px; margin-top: 20px; }
  .fact b { font-size: 22px; }
  .fact span { font-size: 11.5px; }
  .art-foot { margin-top: 22px; }
  .art-foot .sponsor-foot { font-size: 10.5px; }

  .login-form { padding: 12px 12px 18px; }
  .login-card { padding: 28px 20px 26px; }
  .login-card h2 { font-size: 25px; }
  .sub { margin-bottom: 20px; }
  .note { padding: 13px 14px; font-size: 14px; margin-bottom: 22px; }
  .inp { padding: 14px 16px; }
  .otp { gap: 6px; }
  .otp-input { height: 54px; font-size: 20px; max-width: none; }
  .rule { margin: 26px 0 18px; }
  .legal { font-size: 12.5px; }
}

/* Very small phones: the 6 OTP boxes are the first thing to overflow. */
@media (max-width: 360px) {
  .otp { gap: 5px; }
  .otp-input { height: 48px; font-size: 18px; }
  .login-card { padding: 24px 16px 22px; }
}

/* =========================================================
   Height-aware scaling.
   Everything above sizes on vw. A wide-but-short window — the normal
   shape of a maximised browser on a laptop — has plenty of width and
   very little height, so the vw sizes alone push the page into a
   scroll. These steps trade type and spacing back for vertical room.
   ========================================================= */
@media (min-width: 1025px) and (max-height: 900px) {
  .lockup-img { max-width: clamp(170px, 15vw, 240px); margin-bottom: 26px; }
  .login-art h1 { font-size: clamp(28px, 2.9vw, 44px); }
  .lede { font-size: 15.5px; margin-top: 14px; max-width: 48ch; }
  .facts { margin-top: 20px; gap: 26px; }
  .fact b { font-size: 23px; }
  .art-foot { padding-top: 16px; }
  .art-foot .sponsor-foot { font-size: 10px; }
  .login-card { padding: 30px 36px 26px; }
  .login-card h2 { font-size: 28px; }
}

@media (min-width: 1025px) and (max-height: 760px) {
  .login-art { padding: 20px 28px 16px clamp(22px, 4vw, 64px); }
  .lockup-img { max-width: 195px; margin-bottom: 20px; }
  .login-art h1 { font-size: clamp(26px, 2.5vw, 37px); }
  .lede { font-size: 14.5px; margin-top: 12px; }
  .facts { margin-top: 16px; gap: 22px; }
  .fact b { font-size: 21px; }
  .fact span { font-size: 11.5px; }
  .art-foot .sponsor-foot { font-size: 10px; }
  .login-card { padding: 24px 32px 22px; }
  .login-card h2 { font-size: 26px; }
  .sub { margin-bottom: 16px; }
  .note { margin-bottom: 16px; padding: 11px 14px; }
  .rule { margin: 18px 0 14px; }
}

/* Short landscape phones: never trap the form in a centred, unscrollable box. */
@media (max-height: 560px) and (min-width: 1025px) {
  .login { min-height: 0; }
  .login-card { justify-content: flex-start; }
}

/* ---- Two-column form rows (also used on the account page) ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.label-optional { font-weight: 400; color: var(--slate-2, #84968D); }
.note-ok { background: #E8FBF1; color: #00663A; border-color: #BFEFD6; }
.note-ok .note-icon { background: #00A85C; border-color: #00A85C; color: #fff; }
select.inp { appearance: none; background-image: none; }

@media (max-width: 620px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* ---- Certificate verification (CRT-07) ---- */
body.ckd-verify-page { background: var(--paper); }
.ckd-verify-page .lockup-img { max-width: 260px; margin: 0 auto 22px; }
.vfy-body .rule { margin: 20px 0 14px; }
.vfy-sponsor { margin-top: 14px; }
.vfy-sponsor .sponsor-foot { font-size: 11.5px; }
.verify-stage {
  min-height: 100vh; display: grid; place-items: center; padding: 30px 20px;
}
.verify-wrap { width: 100%; max-width: 540px; }

.vfy-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 2px 6px rgba(8,49,42,.06), 0 14px 34px -20px rgba(8,49,42,.4);
}
.vfy-head {
  background: var(--ink); color: #fff; padding: 24px 26px;
}
.vfy-head .eyebrow { color: var(--green); margin-bottom: 5px; }
.vfy-head h1 { font-size: 24px; margin: 0; }
.vfy-body { padding: 24px 26px 22px; }

.kv { margin: 0; display: grid; grid-template-columns: 130px 1fr; gap: 10px 14px; }
.kv dt { font-size: 12.5px; color: var(--slate); }
.kv dd { margin: 0; font-size: 14px; font-weight: 600; }

.vfy-label { font-size: 14px; font-weight: 700; margin-bottom: 5px; }
.vfy-note { font-size: 12.5px; color: var(--slate); line-height: 1.55; margin-bottom: 12px; }
.vfy-check { display: flex; gap: 9px; align-items: stretch; }
.vfy-check .inp { flex: 1; }
/* signin.css sets .btn { width:100% } for the stacked sign-in form; inside this
   row that basis squeezes the input to nothing. Pin the button to its content. */
.vfy-check .btn { flex: 0 0 auto; width: auto; padding: 12px 24px; }
.vfy-msg { font-size: 14px; color: var(--slate); line-height: 1.6; }

/* ---- Privacy Policy (LGL-04) — reuses the verification card ---- */
.ckd-legal-page .verify-wrap { max-width: 720px; }
.legal-copy { font-size: 14.5px; color: var(--ink); line-height: 1.7; }
.legal-copy p { margin: 0 0 14px; }
.legal-copy p:last-child { margin-bottom: 0; }
.legal-copy h2 { font-size: 15.5px; font-weight: 700; color: var(--ink); margin: 22px 0 6px; }
.legal-copy a { color: var(--green-deep); font-weight: 500; overflow-wrap: anywhere; }
.vfy-foot {
  font-size: 11.5px; color: var(--slate-2);
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-2);
}
/* Pharmacovigilance page: no policy text above, so no divider to separate. */
.vfy-body > .vfy-foot:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.pill { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 99px; }
.pill-ok { background: #E8FBF1; color: var(--green-ink); }
.pill-bad { background: #FDEEEA; color: #8A2E19; }
.msg-error, .msg-success {
  font-size: 13.5px; padding: 10px 13px; border-radius: 8px; margin-top: 12px;
}
.msg-error { background: #FDEEEA; color: #8A2E19; }
.msg-success { background: #E8FBF1; color: var(--green-ink); }
.mono { font-family: var(--mono); }

@media (max-width: 520px) {
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .vfy-check { flex-direction: column; }
}
.loading-placeholder { text-align: center; color: var(--slate); padding: 24px 0; font-size: 14px; }
