/* MTsN 1 Tana Toraja — RC36 UI refinement.
   Additive, shared presentation layer: no route, form, setting or database changes.
   Motion is intentionally inexpensive (opacity and transform only). */
:root{
  --mtsn-ui-ease:cubic-bezier(.22,.78,.24,1);
  --mtsn-ui-line:color-mix(in srgb,var(--line,#dce6e1) 86%,transparent);
}

/* Accessibility is a utility control, not a second institution logo.
   One anchored, fixed panel serves all layouts and is positioned from the
   clicked trigger in app.js; fallback coordinates also work before JS. */
.auth-body .auth-accessibility-head{
  position:fixed!important;
  z-index:1190;
  inset:calc(14px + env(safe-area-inset-top,0px)) 18px auto auto;
  display:flex!important;
  justify-content:flex-end;
  align-items:center;
  width:auto!important;
  height:auto!important;
  margin:0!important;
  padding:0!important;
  pointer-events:none;
}
.auth-body .auth-accessibility-head > button{pointer-events:auto}
.auth-body .auth-accessibility-head .accessibility-header-button{
  width:auto;min-width:44px;height:44px;min-height:44px;
  padding:0 12px;border:1px solid #d8e7e1;
  border-radius:999px;background:color-mix(in srgb,#fff 94%,transparent);
  color:#235b52;display:inline-flex;align-items:center;justify-content:center;gap:8px;
  box-shadow:0 3px 12px rgba(21,64,57,.08);
  font:650 .78rem/1.2 system-ui,sans-serif;
  transition:background-color .16s ease,box-shadow .16s ease,border-color .16s ease;
}
.auth-body .auth-accessibility-head .accessibility-header-button::after{content:'Aksesibilitas';white-space:nowrap}
.auth-body .auth-accessibility-head .accessibility-header-button:hover,
.auth-body .auth-accessibility-head .accessibility-header-button[aria-expanded="true"]{
  background:#eaf8f1;border-color:#8cc8b0;box-shadow:0 4px 16px rgba(22,81,68,.12)
}
/* Remove the obsolete bottom-corner placement inherited from older public CSS. */
body .accessibility-panel{
  position:fixed!important;
  left:auto!important;right:var(--a11y-panel-right,16px)!important;
  top:var(--a11y-panel-top,70px)!important;bottom:auto!important;
  width:min(348px,calc(100vw - 24px))!important;
  max-width:calc(100vw - 24px)!important;
  max-height:min(610px,calc(100dvh - var(--a11y-panel-top,70px) - 12px))!important;
  margin:0!important;padding:12px!important;
  display:block!important;overflow:auto!important;overscroll-behavior:contain;
  border:1px solid var(--mtsn-ui-line);border-radius:18px;
  background:var(--surface,#fff);box-shadow:0 18px 45px rgba(10,47,43,.18);
  opacity:0;visibility:hidden;pointer-events:none;
  transform:translate3d(0,-6px,0) scale(.985);
  transition:opacity .16s ease,transform .16s var(--mtsn-ui-ease),visibility .16s;
  z-index:1200;
}
body .accessibility-panel.is-open{
  opacity:1!important;visibility:visible!important;pointer-events:auto;
  transform:translate3d(0,0,0) scale(1)!important;
}
body .accessibility-panel .a11y-head{position:sticky;top:-12px;background:var(--surface,#fff);z-index:1;padding:8px 5px 10px;margin:0 0 5px}
body .accessibility-panel>button{
  display:flex;align-items:center;gap:12px;text-align:left;
  width:100%;min-height:40px;padding:8px 11px;
  border-radius:10px;font-size:.86rem;
}
body .accessibility-panel>button svg{flex:none}
body .accessibility-panel>button:hover{background:color-mix(in srgb,var(--brand,#137e6e) 9%,var(--surface,#fff))}
.accessibility-header-button:focus-visible,
body .accessibility-panel button:focus-visible{
  outline:3px solid #43a997!important;outline-offset:3px!important
}
/* Shared controls: consistent rhythm without modifying their behavior. */
.header-actions,.portal-header-actions,.admin-top-actions,.tinta-header-tools{min-width:0;align-items:center}
.header-actions .accessibility-header-button,
.portal-header-actions .accessibility-header-button,
.admin-top-actions .accessibility-header-button,
.tinta-header-tools .accessibility-header-button{flex:0 0 auto;min-width:42px;min-height:42px;border-radius:13px}
.admin-topbar>div:nth-child(2){min-width:0}
.admin-topbar h1{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.admin-content,.admin-main,.admin-card,.admin-page-head,.admin-grid-2,.admin-grid-3,
.portal-shell main,.portal-shell .container,.auth-form-wrap{min-width:0}
.admin-card,.portal-shell .portal-card,.auth-form-card{isolation:isolate}
.auth-body .auth-form-wrap{position:relative}
.auth-body .auth-mobile-brand{
  position:relative;flex:0 0 auto;max-width:100%;gap:12px;
  border:0!important;padding:0!important;
}
.auth-body .auth-mobile-brand img{flex:none;object-fit:contain;filter:none}
.auth-body .auth-mobile-brand span{min-width:0}
.auth-body .auth-mobile-brand strong{letter-spacing:-.015em;line-height:1.25}
.auth-body .auth-form-card{border-radius:19px;box-sizing:border-box}
.auth-body .auth-form-heading h1{font-weight:800;letter-spacing:-.038em;line-height:1.12}
.auth-body .auth-login-form{gap:12px}
.auth-body .auth-form-card label{line-height:1.35}
.auth-body .auth-login-form .input-icon{
  border-radius:13px;transition:border-color .16s ease,box-shadow .16s ease,background-color .16s ease;
}
.auth-body .auth-login-form .input-icon:focus-within{box-shadow:0 0 0 4px rgba(31,130,111,.11)}
.auth-body .auth-submit,.auth-body .account36-google{
  border-radius:13px;transition:background-color .16s ease,border-color .16s ease,box-shadow .16s ease,transform .16s ease;
}
.auth-body .auth-submit:hover,.auth-body .account36-google:hover{transform:translateY(-1px)}
.auth-body .auth-submit:active,.auth-body .account36-google:active{transform:none}
.auth-body .auth-help{line-height:1.4;row-gap:7px}
.auth-body .auth-help a{border-radius:6px;text-underline-offset:3px}
.auth-body .alert{border-radius:14px;line-height:1.45}
/* Keep login truly full-screen for normal phones/desktops, without clipping
   keyboard users or very short devices. Registration remains scrollable. */
.admin-login-page .auth-form-wrap{
  padding:64px 20px 14px!important;
  overflow-y:auto!important;overflow-x:hidden!important;
  overscroll-behavior-y:contain;
  scrollbar-width:thin;
}
.admin-login-page .auth-mobile-brand{margin-bottom:clamp(8px,1.9dvh,16px)!important}
.admin-login-page .auth-form-card{padding:clamp(12px,2.3dvh,20px) clamp(10px,3vw,24px)!important}
.admin-login-page .auth-help{margin-top:clamp(10px,1.8dvh,17px)}
.admin-login-page .auth-login-form{margin-top:clamp(10px,1.8dvh,16px)}
.auth-body:not(.admin-login-page) .auth-form-wrap{padding-top:max(70px,env(safe-area-inset-top,0px))!important}

/* Navigation feedback: thin top-edge progress, not a blocking full-screen overlay.
   A full-page mask made perceived navigation slower and caused flicker. */
body .site-page-loader{
  display:block!important;position:fixed!important;
  inset:0 0 auto 0!important;width:100%!important;height:3px!important;
  padding:0!important;margin:0!important;
  background:transparent!important;border:0!important;box-shadow:none!important;
  color:transparent!important;z-index:1500!important;
  opacity:0;visibility:hidden;pointer-events:none!important;
  transform:none!important;
  transition:opacity .16s ease,visibility .16s ease!important;
}
body .site-page-loader:before{
  content:'';position:absolute;inset:0 auto 0 0;width:34%;height:100%;
  border-radius:0 999px 999px 0;background:linear-gradient(90deg,#178f7b,#68cbaa,#d4f5ca);
  box-shadow:0 0 11px rgba(39,159,132,.32);
  animation:mtsnPageProgress 1.45s cubic-bezier(.22,.7,.33,1) infinite!important;
}
body .site-page-loader>*{display:none!important}
html.page-loading-enabled body .site-page-loader,
html.admin-navigation-pending body.admin-body .site-page-loader{
  opacity:1!important;visibility:visible!important;
}
html.admin-route-transition body .site-page-loader{pointer-events:none!important}
@keyframes mtsnPageProgress{
  0%{transform:translate3d(-120%,0,0)}
  55%{transform:translate3d(110%,0,0)}
  100%{transform:translate3d(320%,0,0)}
}
/* Avoid rendering expensive effects on low-power touch devices. */
@media(pointer:coarse){
  .auth-body .auth-submit:hover,.auth-body .account36-google:hover{transform:none}
  .admin-card,.auth-form-card{backdrop-filter:none}
}
@media(max-width:700px){
  .auth-body .auth-accessibility-head{top:calc(10px + env(safe-area-inset-top,0px));right:12px}
  .auth-body .auth-accessibility-head .accessibility-header-button{width:42px;min-width:42px;height:42px;min-height:42px;padding:0}
  .auth-body .auth-accessibility-head .accessibility-header-button::after{content:none}
  body .accessibility-panel{width:min(330px,calc(100vw - 24px))!important;grid-template-columns:none!important}
  .admin-topbar h1{max-width:calc(100vw - 165px)}
  .admin-top-actions{gap:4px}
  .admin-top-actions .accessibility-header-button{min-width:40px;min-height:40px;width:40px;height:40px}
  .auth-body .auth-mobile-brand{margin-left:auto!important;margin-right:auto!important}
  .auth-body .auth-mobile-brand strong{font-size:clamp(.88rem,3.8vw,1.06rem)}
  .auth-body .auth-form-card{width:min(100%,440px)}
}
@media(max-width:380px){
  body .accessibility-panel{width:calc(100vw - 20px)!important;max-width:calc(100vw - 20px)!important}
  .admin-login-page .auth-form-wrap{padding:56px 12px 8px!important}
  .admin-login-page .auth-form-card{padding:10px 4px!important}
  .auth-body .auth-help{gap:8px 12px}
}
@media(max-height:720px){
  .admin-login-page .auth-form-wrap{padding-top:52px!important;padding-bottom:6px!important}
  .admin-login-page .auth-form-card{padding:7px 12px!important}
  .admin-login-page .auth-form-heading h1{font-size:1.65rem}
  .admin-login-page .auth-login-form{gap:8px;margin-top:9px}
  .admin-login-page .auth-login-form input{height:40px;min-height:40px}
  .admin-login-page .auth-submit{min-height:42px}
  .admin-login-page .auth-mobile-brand{margin-bottom:6px!important}
  .admin-login-page .auth-help{margin-top:9px!important}
  .admin-login-page .account36-divider{margin:8px 0}
}
@media(prefers-reduced-motion:reduce){
  body .site-page-loader:before{animation:none!important;transform:none!important;width:100%}
  body .accessibility-panel,.auth-body .auth-submit,.auth-body .account36-google,
  .auth-body .auth-login-form .input-icon{animation:none!important;transition:none!important;transform:none!important}
}
html.reduce-motion body .site-page-loader:before{animation:none!important;transform:none!important;width:100%}
html.reduce-motion body .accessibility-panel{transition:none!important}
