/* ==========================================================================
   Login screen
   Left: brand panel. Right: three steps that replace each other
   (1) choose role  →  (2) credentials  →  (3) welcome guide + data agreement
   ========================================================================== */

.auth { display: grid; grid-template-columns: 1fr 1fr; min-height: 100%; background: #fff; }


/* ---------- Brand panel ---------- */

.auth-brand {
  display: flex; flex-direction: column; justify-content: space-between; gap: 28px;
  padding: 40px 56px; background: var(--pink); color: #fff;
}
.auth-brand .logo { align-self: flex-start; height: 52px; width: auto; }
.auth-brand h1 { font-size: clamp(30px, 3.4vw, 44px); font-weight: 700; line-height: 1.08; letter-spacing: -.02em; }
.auth-brand h1 em {
  padding: 0 .12em; border-radius: 5px;
  background: #fff; color: var(--pink); font-style: normal;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.auth-brand .foot { display: grid; gap: 4px; font-size: 12px; color: rgba(255, 255, 255, .85); }
.auth-brand .foot p { max-width: 46ch; }
.auth-brand .headline { font-size: 15px; font-weight: 700; color: #fff; }   /* headline penjelas (BR-03), its own line */


/* ---------- Form panel ---------- */

.auth-form { display: flex; flex-direction: column; justify-content: center; padding: 40px 56px; }
.auth-form .inner { width: 100%; max-width: 400px; margin: 0 auto; }
.auth-form h2 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.auth-form .sub { margin-top: 4px; font-size: 13.5px; color: var(--text-2); }

.cobrand { display: flex; align-items: center; gap: 16px; margin-bottom: 36px; }
.cobrand img { height: 34px; width: auto; }
.cobrand .divider { width: 1px; height: 34px; background: var(--border-s); }

.auth-note { margin-top: 22px; font-size: 12px; line-height: 1.5; color: var(--text-3); }
.proto-note { margin-top: 6px; font-size: 11px; color: var(--text-4); }


/* ---------- Step 1: choose role ---------- */

.role-pick { display: grid; gap: 10px; margin-top: 22px; }
.role-opt {
  display: grid; grid-template-columns: 44px 1fr 16px; align-items: center; gap: 14px;
  padding: 16px; text-align: left; cursor: pointer;
  background: #fff; border: 1px solid var(--border-s); border-radius: 12px;
  font: inherit; color: var(--text);
  transition: border-color .12s, background .12s;
}
.role-opt:hover { border-color: var(--pink); background: var(--pink-l); }
.role-opt .ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; }
.role-opt .ic.field  { background: var(--km-green-l); color: var(--km-green); }
.role-opt .ic.policy { background: var(--km-teal-l);  color: var(--km-teal); }
.role-opt b { display: block; font-size: 15px; }
.role-opt span { font-size: 12.5px; color: var(--text-2); }
.role-opt .chev { color: var(--text-4); }


/* ---------- Step 2: credentials ---------- */

/* Chosen role (status, plain text) + "Ganti peran" (separate text action) */
.cred-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 18px 0 20px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.cred-lbl { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.cred-head b { font-size: 15px; font-weight: 700; color: var(--text); }
.cred-head .linkbtn { margin-left: auto; }

/* Email / WhatsApp switch */
.seg-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 22px 0 18px; padding: 3px; background: var(--bg-3); border-radius: 8px; }
.seg-tabs button { padding: 8px; background: none; border: 0; border-radius: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.seg-tabs button.on { background: #fff; color: var(--text); box-shadow: var(--shadow); }

.fstack { display: grid; gap: 14px; }
.phone { display: grid; grid-template-columns: 64px 1fr; gap: 8px; }
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp input { padding: 10px 0; text-align: center; font-size: 18px; font-weight: 600; }


/* ---------- Step 3: welcome guide + data agreement ---------- */

.wl-role { margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--text-2); }   /* role, Puskesmas: right after the name */
.wl-block { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border-s); }
.wl-block h3 { margin-bottom: 10px; font-size: 13px; font-weight: 700; }

.wl-rules { display: grid; gap: 4px; margin: 0 0 12px; padding-left: 18px; font-size: 13px; line-height: 1.5; color: var(--text-2); }

/* Agreement + start button: one group, sticky at the bottom on phones */
.wl-actions { display: grid; gap: 12px; margin-top: 16px; }
.wl-guide { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; color: var(--text-2); }
.wl-guide .linkbtn { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.wl-actions .chk { padding: 10px 12px; background: var(--pink-l); border: 1px solid var(--pink-line); font-size: 13px; color: var(--text); }
.linkbtn.wl-out { display: block; margin: 12px auto 0; color: var(--text-3); }


/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }   /* brand strip keeps its own height */
  .auth-brand { gap: 16px; padding: 28px 20px; }
  .auth-brand h1 { font-size: 28px; }
  .auth-brand .foot { display: none; }
  .auth-form { justify-content: flex-start; padding: 28px 20px 40px; }
}
@media (max-width: 700px) {
  /* compact brand strip so the role cards are on the first screen */
  .auth-brand { gap: 10px; padding: 16px 20px; }
  .auth-brand .logo { height: 30px; }
  .auth-brand h1 { font-size: 19px; line-height: 1.25; }
  .cobrand { margin-bottom: 24px; }
  .wl-actions {
    position: sticky; bottom: 0; z-index: 5; margin: 16px -20px 0; padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
    background: #fff; border-top: 1px solid var(--border); box-shadow: 0 -6px 16px rgba(0, 0, 0, .06);
  }
}
