:root{
  --ksauth-ink:#211e1b;
  --ksauth-muted:#786f68;
  --ksauth-line:#e2dad3;
  --ksauth-soft:#f7f3ef;
  --ksauth-accent:#b65f76;
}
html.ksauth-lock{overflow:hidden}

.ksauth-dialog{
  width:min(760px,calc(100% - 24px));
  max-height:calc(100dvh - 24px);
  padding:0;
  border:0;
  border-radius:20px;
  background:transparent;
  color:var(--ksauth-ink);
  box-shadow:0 30px 90px rgba(31,26,23,.24);
}
.ksauth-dialog::backdrop{
  background:rgba(28,24,22,.48);
  backdrop-filter:blur(6px);
}
.ksauth-card{
  position:relative;
  display:grid;
  grid-template-columns:250px minmax(0,1fr);
  max-height:calc(100dvh - 24px);
  overflow:auto;
  border:1px solid var(--ksauth-line);
  border-radius:20px;
  background:#fff;
}
.ksauth-side{
  position:relative;
  min-height:520px;
  padding:24px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  background:
    radial-gradient(circle at 20% 8%,rgba(255,255,255,.1),transparent 28%),
    linear-gradient(160deg,#28231f,#211e1b);
  color:#fff;
}
.ksauth-side:after{
  content:"";
  position:absolute;
  right:-72px;
  bottom:-78px;
  width:220px;
  height:220px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:50%;
}
.ksauth-kicker{
  font-size:11px;
  font-weight:800;
  letter-spacing:.13em;
  text-transform:uppercase;
  color:#8a7f77;
}
.ksauth-side .ksauth-kicker{color:rgba(255,255,255,.46)}
.ksauth-side h2{
  margin:16px 0 8px;
  font-family:Georgia,serif;
  font-size:31px;
  font-weight:400;
  line-height:.98;
  letter-spacing:-.045em;
}
.ksauth-side p{
  margin:0;
  color:rgba(255,255,255,.61);
  font-size:12px;
  line-height:1.55;
}
.ksauth-benefits{
  display:grid;
  gap:8px;
  margin-top:auto;
  padding-top:28px;
}
.ksauth-benefits span{
  min-height:38px;
  padding:7px 9px;
  border:1px solid rgba(255,255,255,.09);
  border-radius:9px;
  display:flex;
  align-items:center;
  gap:8px;
  background:rgba(255,255,255,.04);
  color:rgba(255,255,255,.75);
  font-size:11px;
}
.ksauth-benefits svg{
  width:16px;
  height:16px;
  flex:0 0 auto;
  stroke-width:1.5;
}
.ksauth-main{
  min-width:0;
  padding:24px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.ksauth-close{
  position:absolute;
  z-index:4;
  top:10px;
  right:10px;
  width:44px;
  height:44px;
  border:1px solid #e0d8d1;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:#fff;
  color:#514943;
  font-size:20px;
  cursor:pointer;
}
.ksauth-head{padding-right:48px}
.ksauth-head h2{
  margin:6px 0 5px;
  font-family:Georgia,serif;
  font-size:29px;
  font-weight:400;
  line-height:1;
  letter-spacing:-.04em;
}
.ksauth-head p{
  margin:0;
  color:var(--ksauth-muted);
  font-size:11px;
  line-height:1.45;
}
.ksauth-tabs{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:4px;
  margin:16px 0 12px;
  padding:4px;
  border-radius:11px;
  background:#f1ede9;
}
.ksauth-tabs button{
  min-height:44px;
  border:0;
  border-radius:8px;
  background:transparent;
  color:#786f68;
  font:inherit;
  font-size:12px;
  font-weight:800;
  cursor:pointer;
}
.ksauth-tabs button.is-active{
  background:#fff;
  color:#211e1b;
  box-shadow:0 3px 10px rgba(43,36,31,.06);
}
.ksauth-status{
  min-height:0;
  margin:0 0 9px;
  padding:0;
  border:0;
  border-radius:9px;
  font-size:11px;
  line-height:1.4;
}
.ksauth-status:empty{display:none}
.ksauth-status.is-error{
  padding:9px 10px;
  border:1px solid #edcbd4;
  background:#fff1f3;
  color:#8d3d52;
}
.ksauth-status.is-success{
  padding:9px 10px;
  border:1px solid #d6e4d2;
  background:#f0f6ee;
  color:#4f6851;
}
.ksauth-form{display:grid;gap:10px}
.ksauth-form[hidden]{display:none!important}
.ksauth-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.ksauth-field{display:grid;gap:5px;min-width:0}
.ksauth-field label{
  font-size:11px;
  font-weight:700;
  color:#4f4843;
}
.ksauth-field input{
  width:100%;
  min-width:0;
  min-height:46px;
  padding:10px 11px;
  border:1px solid #ddd5ce;
  border-radius:9px;
  background:#fcfbfa;
  color:#211e1b;
  font:inherit;
  font-size:14px;
  outline:none;
}
.ksauth-field input:hover{border-color:#c8beb6}
.ksauth-field input:focus{
  border-color:#93877f;
  box-shadow:0 0 0 3px rgba(76,64,56,.07);
}
.ksauth-field input[aria-invalid="true"]{border-color:#c96b7f;background:#fffafb}
.ksauth-password{position:relative}
.ksauth-password input{padding-right:49px}
.ksauth-pass-toggle{
  position:absolute;
  top:50%;
  right:2px;
  transform:translateY(-50%);
  width:44px;
  height:44px;
  border:0;
  border-radius:8px;
  display:grid;
  place-items:center;
  background:transparent;
  color:#746a63;
  cursor:pointer;
}
.ksauth-pass-toggle:hover{background:#f3efeb}
.ksauth-pass-toggle svg{width:18px;height:18px;stroke-width:1.5}
.ksauth-field-error{
  min-height:0;
  color:#a6475c;
  font-size:10px;
  line-height:1.35;
}
.ksauth-field-error:empty{display:none}
.ksauth-actions{
  display:grid;
  grid-template-columns:1fr;
  gap:7px;
  margin-top:2px;
}
.ksauth-submit,
.ksauth-secondary,
.ksauth-link{
  min-height:44px;
  border-radius:9px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font:inherit;
  font-size:12px;
  font-weight:800;
  cursor:pointer;
}
.ksauth-submit{
  border:1px solid #211e1b;
  background:#211e1b;
  color:#fff;
}
.ksauth-submit:disabled{opacity:.55;cursor:wait}
.ksauth-secondary{
  border:1px solid #ddd5ce;
  background:#fff;
  color:#211e1b;
}
.ksauth-link{
  min-height:36px;
  padding:0;
  border:0;
  background:transparent;
  color:#8f5665;
  text-decoration:underline;
  text-underline-offset:3px;
}
.ksauth-note{
  margin-top:12px;
  padding-top:10px;
  border-top:1px solid #eee8e3;
  display:flex;
  align-items:flex-start;
  gap:8px;
  color:#81776f;
  font-size:10px;
  line-height:1.4;
}
.ksauth-note svg{
  width:17px;
  height:17px;
  flex:0 0 auto;
  stroke-width:1.5;
}
.ksauth-back{
  width:max-content;
  min-height:38px;
  margin-bottom:7px;
  padding:0;
  border:0;
  background:transparent;
  color:#766d66;
  font:inherit;
  font-size:11px;
  font-weight:800;
  cursor:pointer;
}
.ksauth-close:focus-visible,
.ksauth-tabs button:focus-visible,
.ksauth-pass-toggle:focus-visible,
.ksauth-submit:focus-visible,
.ksauth-secondary:focus-visible,
.ksauth-link:focus-visible,
.ksauth-back:focus-visible{
  outline:2px solid #211e1b;
  outline-offset:2px;
}

.ksauth-steps{
  display:grid;
  grid-template-columns:28px 1fr 28px 1fr 28px;
  align-items:center;
  gap:6px;
  margin:15px 0 12px;
}
.ksauth-steps[hidden]{display:none!important}
.ksauth-steps span{
  width:28px;
  height:28px;
  border:1px solid #d9d1ca;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:#fff;
  color:#91877f;
  font-size:11px;
  font-weight:800;
}
.ksauth-steps span.is-active{
  border-color:#211e1b;
  background:#211e1b;
  color:#fff;
}
.ksauth-steps span.is-done{
  border-color:#cfdcca;
  background:#eef5eb;
  color:#58705a;
}
.ksauth-steps i{height:1px;background:#dfd8d2}
.ksauth-code{
  text-align:center;
  font-size:22px!important;
  font-weight:800!important;
  letter-spacing:.28em;
  font-variant-numeric:tabular-nums;
}
.ksauth-success{
  padding:9px 0 2px;
  text-align:center;
}
.ksauth-success[hidden]{display:none!important}
.ksauth-success__icon{
  width:58px;
  height:58px;
  margin:2px auto 10px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:#edf5e9;
  color:#557054;
  font-size:26px;
  font-weight:800;
}
.ksauth-success h3{
  margin:0;
  font-family:Georgia,serif;
  font-size:28px;
  font-weight:400;
}
.ksauth-success p{
  margin:6px 0 16px;
  color:#7a716a;
  font-size:12px;
}
.ksauth-success__actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:7px;
}
.ksauth-success__actions a{text-decoration:none}

@media(max-width:700px){
  .ksauth-dialog{
    width:100%;
    max-height:92dvh;
    margin:auto 0 0;
    border-radius:20px 20px 0 0;
  }
  .ksauth-card{
    grid-template-columns:1fr;
    max-height:92dvh;
    border-radius:20px 20px 0 0;
  }
  .ksauth-side{
    min-height:118px;
    padding:17px 64px 16px 16px;
  }
  .ksauth-side h2{margin:7px 0 5px;font-size:25px}
  .ksauth-side p{font-size:11px}
  .ksauth-benefits{display:none}
  .ksauth-main{padding:16px 14px max(18px,env(safe-area-inset-bottom))}
  .ksauth-head h2{font-size:26px}
  .ksauth-field input{font-size:16px}
  .ksauth-code{font-size:22px!important}
  .ksauth-grid{grid-template-columns:1fr}
  .ksauth-close{top:9px;right:9px}
}
@media(max-width:390px){
  .ksauth-main{padding-inline:12px}
  .ksauth-side{padding-left:14px}
  .ksauth-success__actions{grid-template-columns:1fr}
}
@media(prefers-reduced-motion:reduce){
  .ksauth-dialog::backdrop{backdrop-filter:none}
}


/* Stage 24: registration confirmation and clear disclosure in the sitewide auth dialog */
.ksauth-register-note{margin:4px 0 10px;color:#70665d;font-size:12px;line-height:1.6}
.ksauth-register-note a{color:#46362b;font-weight:750;text-underline-offset:2px}
.ksauth-form .ksauth-field input[aria-invalid="true"]{border-color:#b87373;background:#fff9f9}
@media(max-width:700px){.ksauth-register-note{font-size:13px}}

/* Telegram Login: optional verified identity, phone/password remains primary. */
.ksa-telegram-login{
  margin-top:14px;
  padding-top:13px;
  border-top:1px solid #e8dcd3;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:9px;
  min-width:0;
}
.ksa-telegram-login[hidden]{display:none!important}
.ksa-telegram-login>span{
  color:#625d59;
  font-size:13px;
  font-weight:700;
}
.ksa-telegram-login>small{
  max-width:320px;
  text-align:center;
  font-size:11px;
  line-height:1.5;
  color:#857f79;
}
.ksa-telegram-login [data-account-telegram-widget]{
  display:flex;
  justify-content:center;
  min-height:40px;
  max-width:100%;
}
