/* ==========================================================
   AuthLab — login and account parts, on top of kit/pl.css
   ========================================================== */

/* ---------- auth layouts ---------- */
.au-page { min-height: 100dvh; background: var(--page); }
.au-logo { display: inline-flex; align-items: center; gap: .6rem; font-size: 22px; font-weight: 800; text-decoration: none; color: var(--ink); }
.au-logo .mk { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--brand); color: #fff; font-size: 1.15rem; }
.au-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 76px; }
.au-top .side-link { color: var(--muted); font-weight: 600; }
.au-top .side-link a { color: var(--brand-ink); font-weight: 800; text-decoration: none; }
.au-card { width: 100%; max-width: 480px; padding: clamp(24px, 3.4vw, 44px); border-radius: 30px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.au-card h1 { font-size: clamp(26px, 2.6vw, 34px); margin: 0 0 .4rem; }
.au-card .sub { color: var(--muted); margin: 0 0 1.6rem; }
.au-stack { display: grid; gap: 1rem; }
.au-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.au-foot { margin-top: 1.4rem; text-align: center; color: var(--muted); }
.au-foot a { color: var(--brand-ink); font-weight: 800; text-decoration: none; }
.au-legal { color: var(--muted); font-size: 15px; text-align: center; margin: 1.2rem 0 0; }
.au-legal a { color: inherit; }

/* social sign-in */
.social { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.social button { display: inline-flex; align-items: center; justify-content: center; gap: .6rem; min-height: 52px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); font: 700 16px var(--font); cursor: pointer; transition: border-color var(--ease), background var(--ease); }
.social button:hover { border-color: rgba(var(--brand-rgb), .4); background: var(--surface-2); }
.social svg { width: 20px; height: 20px; }
.or { display: flex; align-items: center; gap: 1rem; color: var(--muted); font-size: 15px; font-weight: 700; margin: 1.2rem 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* password field: show/hide + caps lock */
.pw { position: relative; }
.pw .fm-input { padding-inline-end: 52px; }
.pw .eye { position: absolute; top: 4px; inset-inline-end: 4px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; font-size: 1.15rem; }
.pw .eye:hover { color: var(--ink); background: var(--surface-2); }
.caps { display: none; align-items: center; gap: .4rem; color: var(--warn); font-size: 15px; font-weight: 700; }
.caps.is-on { display: flex; }

/* strength meter + rule list */
.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: .5rem; }
.meter i { height: 6px; border-radius: 6px; background: var(--line); transition: background var(--ease); }
.meter[data-s="1"] i:nth-child(-n+1) { background: var(--danger); }
.meter[data-s="2"] i:nth-child(-n+2) { background: #f59e0b; }
.meter[data-s="3"] i:nth-child(-n+3) { background: #84cc16; }
.meter[data-s="4"] i { background: var(--ok); }
.meter-txt { display: flex; justify-content: space-between; color: var(--muted); font-size: 15px; margin-top: .3rem; }
.meter-txt b { color: var(--ink); }
.rules { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem .8rem; font-size: 15px; color: var(--muted); }
.rules li { position: relative; padding-inline-start: 1.5rem; }
.rules li::before { content: "\F28A"; font-family: "bootstrap-icons"; position: absolute; inset-inline-start: 0; top: 0; color: var(--line); }
.rules li.ok { color: var(--ok); }
.rules li.ok::before { content: "\F26B"; color: var(--ok); }

/* code boxes (FormLab F03) */
.otp { display: flex; gap: 10px; direction: ltr; justify-content: center; }
.otp input { width: 56px; height: 64px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); text-align: center; font: 800 26px var(--font); caret-color: var(--brand); transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease); }
.otp input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .14); }
.otp input.filled { border-color: rgba(var(--brand-rgb), .5); background: rgba(var(--brand-rgb), .04); }
.otp.bad input { border-color: var(--danger); animation: shake 380ms ease; }
.otp.good input { border-color: var(--ok); background: var(--ok-bg); }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@media (max-width: 400px) { .otp { gap: 6px; } .otp input { width: 46px; height: 56px; font-size: 22px; } }

/* inline alert (OverlayLab .ov-alert, short) */
.au-alert { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .7rem; align-items: start; padding: 12px 14px; border-radius: 16px; font-size: 15px; line-height: 1.7; }
.au-alert i { font-size: 1.15rem; margin-top: .1rem; }
.au-alert b { display: block; font-size: 16px; }
.au-alert.err { background: var(--danger-bg); color: var(--danger); }
.au-alert.ok { background: var(--ok-bg); color: var(--ok); }
.au-alert.info { background: var(--info-bg); color: var(--info); }
.au-alert.warn { background: var(--warn-bg); color: var(--warn); }
.au-alert[hidden] { display: none; }

/* ---------- account shell ---------- */
.ac-top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.ac-top .wrap { display: flex; align-items: center; gap: 1rem; min-height: 72px; }
.ac-top .me { display: flex; align-items: center; gap: .6rem; margin-inline-start: auto; font-weight: 700; }
.ac-top .me img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.ac-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: clamp(20px, 3vw, 48px); align-items: start; padding-block: clamp(24px, 3vw, 44px) 64px; }
.ac-nav { position: sticky; top: 96px; display: grid; gap: 4px; }
.ac-nav .who { display: flex; align-items: center; gap: .8rem; padding: 14px; margin-bottom: 8px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.ac-nav .who img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.ac-nav .who b { display: block; }
.ac-nav .who span { color: var(--muted); font-size: 15px; }
.ac-nav a { display: flex; align-items: center; gap: .75rem; min-height: 50px; padding: 0 1rem; border-radius: 14px; color: var(--muted); font-weight: 700; text-decoration: none; transition: background var(--ease), color var(--ease); }
.ac-nav a i { font-size: 1.15rem; }
.ac-nav a:hover { background: var(--surface); color: var(--ink); }
.ac-nav a[aria-current="page"] { background: var(--surface); color: var(--brand-ink); box-shadow: var(--shadow); }
.ac-nav a .dot { margin-inline-start: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.ac-nav .out { color: var(--danger); margin-top: 8px; }
.ac-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 2px; } /* each .panel brings its own 18px top margin, wrappers included */
.ac-head h1 { font-size: clamp(26px, 2.6vw, 34px); margin: 0; }
.ac-head p { margin: .2rem 0 0; color: var(--muted); }
.panel { padding: clamp(18px, 2.2vw, 28px); border-radius: 24px; background: var(--surface); border: 1px solid var(--line); margin-top: 18px; }
.panel > h2 { font-size: 19px; margin: 0 0 .2rem; }
.panel > .desc { color: var(--muted); margin: 0 0 1.2rem; font-size: 16px; }
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem 1.5rem; align-items: center; padding: 16px 0; border-top: 1px solid var(--line); }
.set-row:first-of-type { border-top: 0; padding-top: 4px; }
.set-row b { display: block; }
.set-row .v { color: var(--muted); }
.set-row > .badge-s, .set-row > .seg2, .set-row > .sw-hit { justify-self: start; }
.set-row .acts { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.badge-s { display: inline-flex; align-items: center; gap: .3rem; padding: .05rem .7rem; border-radius: 999px; font-size: 15px; font-weight: 800; white-space: nowrap; }
.badge-s.ok { background: var(--ok-bg); color: var(--ok); }
.badge-s.warn { background: var(--warn-bg); color: var(--warn); }
.badge-s.off { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

/* switch */
.sw { appearance: none; -webkit-appearance: none; position: relative; width: 52px; height: 30px; margin: 0; flex: 0 0 auto; border-radius: 999px; background: var(--line); cursor: pointer; transition: background var(--ease); }
.sw::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: inset-inline-start var(--ease); }
.sw::before { content: ""; position: absolute; inset: -8px -4px; } /* 46px tall touch area around the 30px switch */
.sw:checked { background: var(--brand); }
.sw:checked::after { inset-inline-start: 25px; }
.sw:focus-visible { outline: 3px solid rgba(var(--brand-rgb), .55); outline-offset: 3px; }
.sw:disabled { opacity: .5; cursor: not-allowed; }
.sw-hit { display: inline-grid; place-items: center; min-width: 52px; min-height: 44px; }

/* save bar: appears when something changed */
.savebar { position: fixed; z-index: 60; inset-inline: 16px; bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; max-width: 760px; margin-inline: auto; padding: 12px 12px 12px 20px; padding-inline: 20px 12px; border-radius: 20px; background: var(--ink); color: var(--surface); box-shadow: 0 20px 50px rgba(0,0,0,.3); transform: translateY(140%); transition: transform 300ms cubic-bezier(.2,.7,.3,1); }
.savebar.is-on { transform: none; }
.savebar span { font-weight: 700; }
.savebar .acts { display: flex; gap: .5rem; }
.savebar .btx-ghost { color: var(--surface); border-color: color-mix(in srgb, var(--surface) 30%, transparent); }
.savebar .btx-ghost:hover { background: color-mix(in srgb, var(--surface) 10%, transparent); color: var(--surface); }

/* danger zone */
.danger { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.danger > h2 { color: var(--danger); }
.btx-danger { background: var(--danger); }
.btx-danger-soft { background: var(--danger-bg); color: var(--danger); }
.btx-danger-soft:hover { color: var(--danger); filter: brightness(.97); }

@media (max-width: 991.98px) {
  .ac-layout { grid-template-columns: minmax(0, 1fr); }
  .ac-nav { position: sticky; top: 72px; z-index: 20; display: flex; overflow-x: auto; scrollbar-width: none; gap: 6px; margin-inline: calc(-1 * clamp(16px, 4vw, 56px)); padding: 10px clamp(16px, 4vw, 56px); background: color-mix(in srgb, var(--page) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
  .ac-nav::-webkit-scrollbar { display: none; }
  .ac-nav .who { display: none; }
  .ac-nav a { flex: 0 0 auto; min-height: 44px; white-space: nowrap; border: 1px solid var(--line); background: var(--surface); }
  .ac-nav .out { margin-top: 0; }
}
@media (max-width: 575.98px) {
  .set-row { grid-template-columns: minmax(0, 1fr); }
  .set-row .acts { justify-content: flex-start; }
  .savebar { padding: 10px; padding-inline: 14px 10px; }
  .social { grid-template-columns: minmax(0, 1fr); }
  .rules { grid-template-columns: minmax(0, 1fr); }
}
