@import url("./login-theme-base.css");

/* KasirPro Login V.2 — fullscreen layout override */
html,body{
  width:100%;
  height:100%;
  min-height:100%;
  margin:0;
  overflow:hidden;
}

.login-page{
  display:block;
  width:100vw;
  height:100dvh;
  min-height:0;
  margin:0;
  padding:0;
  overflow:hidden;
  background-position:center;
  background-size:cover;
  color:var(--kp-ink);
}

.login-container{
  display:grid;
  width:100vw;
  max-width:none;
  height:100dvh;
  min-height:0;
  margin:0;
  grid-template-columns:minmax(0,1.12fr) minmax(420px,.88fr);
  overflow:hidden;
  background:transparent;
}

.brand-stage,
.auth-stage{
  min-width:0;
  min-height:0;
  display:grid;
  place-items:center;
}

.brand-stage{
  padding:clamp(28px,4vw,64px) clamp(30px,5vw,78px);
}

.login-header{
  align-self:center;
}

.login-logo{
  width:clamp(200px,18vw,265px);
  height:clamp(200px,18vw,265px);
  margin:0 0 18px;
}

.login-brand h1{
  font-size:clamp(40px,4.25vw,62px);
  line-height:1;
}

/* Visually extend the existing KasirPro label to KasirPro V.2 without touching login logic/HTML. */
.login-brand p{
  padding-right:43px;
  background:linear-gradient(var(--kp-red),var(--kp-red)) right center/33px 3px no-repeat;
}

.login-brand p::after{
  position:static;
  top:auto;
  right:auto;
  bottom:auto;
  left:auto;
  display:inline;
  width:auto;
  height:auto;
  content:" V.2";
  background:none;
  border-radius:0;
}

.auth-stage{
  padding:clamp(28px,4vw,58px) clamp(30px,5vw,78px);
}

.login-card-shell{
  width:min(100%,500px);
  margin:0;
  padding:clamp(28px,3.2vh,38px) clamp(26px,2.4vw,34px) clamp(26px,3vh,34px);
  border-radius:22px;
  box-shadow:0 24px 60px rgba(11,57,126,.16);
}

.role-selection .section-heading h2{
  margin-bottom:24px;
  font-size:clamp(34px,2.8vw,46px);
}

.role-grid{
  margin-bottom:24px;
  border-radius:11px;
}

.role-card{
  min-height:52px!important;
}

.login-submit{
  min-height:54px;
  border-radius:11px;
}

@media (max-width:900px){
  html,body{
    width:100%;
    height:100%;
    overflow:hidden;
  }

  .login-page{
    display:block;
    width:100vw;
    height:100dvh;
    min-height:0;
    margin:0;
    padding:0;
    overflow:hidden;
    background-attachment:scroll;
    background-position:center;
    background-size:cover;
  }

  .login-container{
    width:100vw;
    max-width:none;
    height:100dvh;
    min-height:0;
    margin:0;
    grid-template-columns:1fr;
    grid-template-rows:minmax(170px,28dvh) minmax(0,1fr);
    overflow:hidden;
  }

  .brand-stage{
    min-height:0;
    padding:14px 18px 4px;
  }

  .login-header{
    align-self:center;
  }

  .login-logo{
    width:96px;
    height:96px;
    margin:0 0 5px;
  }

  .login-brand h1{
    font-size:clamp(25px,7.4vw,34px);
  }

  .login-brand p{
    margin-top:6px;
    padding-right:34px;
    font-size:17px;
    background-size:24px 3px;
  }

  .login-brand p::before{
    width:24px;
  }

  .auth-stage{
    min-height:0;
    padding:2px 14px calc(64px + env(safe-area-inset-bottom));
    place-items:start center;
    overflow:hidden;
  }

  .login-card-shell{
    width:min(100%,430px);
    margin:0;
    padding:16px 16px 15px;
    border-radius:15px;
    box-shadow:0 12px 28px rgba(11,57,126,.13);
  }

  .role-selection .section-heading h2{
    margin-bottom:11px;
    font-size:25px;
  }

  .role-grid{
    margin-bottom:12px;
  }

  .role-card{
    min-height:39px!important;
  }

  .login-submit{
    min-height:44px;
  }
}

@media (max-width:900px) and (max-height:700px){
  .login-container{
    grid-template-rows:145px minmax(0,1fr);
  }

  .brand-stage{
    padding-top:8px;
  }

  .login-logo{
    width:72px;
    height:72px;
    margin-bottom:2px;
  }

  .login-brand h1{
    font-size:24px;
  }

  .login-brand p{
    margin-top:3px;
    font-size:15px;
  }

  .auth-stage{
    padding-top:0;
  }

  .login-card-shell{
    padding-top:12px;
    padding-bottom:11px;
  }

  .role-selection .section-heading h2{
    margin-bottom:8px;
    font-size:22px;
  }

  .role-grid{
    margin-bottom:9px;
  }
}

@media (min-width:901px) and (max-height:700px){
  .login-page{
    width:100vw;
    height:100dvh;
    padding:0;
  }

  .login-container{
    width:100vw;
    height:100dvh;
    min-height:0;
  }

  .brand-stage{
    padding:20px 36px;
  }

  .login-logo{
    width:170px;
    height:170px;
    margin-bottom:8px;
  }

  .login-brand h1{
    font-size:clamp(36px,4vw,52px);
  }

  .auth-stage{
    padding:20px 34px;
  }

  .login-card-shell{
    width:min(100%,470px);
    padding-top:22px;
    padding-bottom:21px;
  }

  .role-selection .section-heading h2{
    font-size:32px;
    margin-bottom:16px;
  }

  .role-grid{
    margin-bottom:16px;
  }
}

/* Role color system — Administrator = navy, Kasir = pharmacy green */
.role-grid{
  border-color:#cbd6e4;
  background:#fff;
}

.role-card:first-child{
  color:#0B397E!important;
  background:#F2F6FC!important;
}

.role-card:last-child{
  color:#137A55!important;
  background:#F0FAF6!important;
}

.role-card:first-child + .role-card{
  border-left:1px solid #cbd6e4!important;
}

.role-card:first-child.active,
.role-card:first-child[aria-pressed="true"]{
  color:#fff!important;
  background:#0B397E!important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.08),0 6px 16px rgba(11,57,126,.18)!important;
}

.role-card:last-child.active,
.role-card:last-child[aria-pressed="true"]{
  color:#fff!important;
  background:#159A68!important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.08),0 6px 16px rgba(21,154,104,.18)!important;
}

@media (hover:hover){
  .role-card:first-child:not(.active):not([aria-pressed="true"]):hover{
    color:#082F69!important;
    background:#E7EEF8!important;
  }

  .role-card:last-child:not(.active):not([aria-pressed="true"]):hover{
    color:#0F6C49!important;
    background:#E3F6EE!important;
  }
}
