:root{
  --card-max-w: 1200px;
  --card-min-h: 560px;
  --card-max-h: 860px;
  --radius: 2.4vh;
  --shadow: 0 2.5vh 6vh rgba(16,24,40,.12);
  --blue: #147bd1;
  --text: #2b2f36;
  --line: #e5e7eb;
  --bg: #eceff3;
  --btn: #3b3f44;
  --btn-h: #2f3337;
  --pad-v: 3vh;
  --pad-h: 3vw;
  --footer-h: 32px;
}

html, body{
  height: 100%;
  min-height: 100dvh;
  width: 100%;
  overflow: hidden;
}

body{
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji",
        "Segoe UI Emoji", "Noto Color Emoji";
}

#kc-header, #kc-page-title, #kc-container-wrapper, #kc-content, #kc-content-wrapper,
.login-pf-page, .card-pf, .pf-c-page, .pf-c-login, .pf-c-page__header { display: contents; }

.c-root{
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2vh;
  padding: var(--pad-v) var(--pad-h);
  padding-bottom: var(--pad-v);
}

.c-card{
  width: min(92vw, var(--card-max-w));
  height: clamp(
    var(--card-min-h),
    calc(100dvh - var(--pad-v)*2 - var(--footer-h)),
    var(--card-max-h)
  );
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 52% 48%;
  align-items: stretch;
  overflow: hidden;
}

.c-left{ position: relative; min-width: 0; min-height: 0; }
.c-left-img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.c-right{
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  padding: 0;
  display: grid;
  align-content: start;
  gap: 2.2vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}

.c-right::before,
.c-right::after{
  content: "";
  display: block;
  height: var(--pad-v);
  flex: 0 0 auto;
}

.c-right > *{
  padding-left: var(--pad-h);
  padding-right: var(--pad-h);
}

.c-right > *{ max-width: 48vw; }
@media (min-width: 1200px){
  .c-right > *{ max-width: 560px; }
}

.c-brand{ display:flex; justify-content:flex-start; }
.c-logo-link{ display:inline-flex; }
.c-brand img{ height: clamp(44px, 6vh, 60px); width:auto; }

.c-title{
  margin: 0;
  font-size: clamp(26px, 5vh, 40px);
  line-height: 1.12;
  font-weight: 800;
  color: #2a2f35;
}
.c-intro p{ margin: 0; }
.c-subtitle{
  color: var(--text);
  font-size: clamp(14px, 2.2vh, 18px);
  font-weight: 600;
}

.c-terms{
  color: #7a8696;
  font-size: clamp(12px, 1.8vh, 14px);
}
.c-terms a{ color: var(--blue); text-decoration: underline; font-weight: 600; }
.c-terms--inline{
  margin-top: 0.2em;
  padding-top: 0;
  border-top: none;
  text-align: left;
}

.c-msg{
  padding: 1.2vh 1.4vh;
  border-radius: 1.2vh;
  font-size: clamp(12px, 1.8vh, 14px);
  border: 1px solid #fecaca; background:#fee2e2; color:#991b1b;
  text-align: center;
  justify-self: center;
  width: 100%;
  max-width: 90%;
  box-sizing: border-box;
}
.c-msg.success{ border-color:#a7f3d0; background:#ecfdf5; color:#065f46; }

* { box-sizing: border-box; }

.c-field{ display:grid; gap: 0.8vh; margin: 0.6vh 0; }
.c-field span{
  font-size: clamp(12px, 1.9vh, 14px);
  font-weight: 600; color: #475569;
}
.c-field input{
  width: 100%;
  padding: 1.2vh 1.4vh;
  border-radius: 1.2vh;
  border: 1px solid #d1d5db;
  background:#fff;
  transition: border-color .2s, box-shadow .2s, transform .12s;
  font-size: clamp(14px, 2vh, 16px);
}
.c-field input:focus{
  outline: none; border-color: #9ac2f5;
  box-shadow: 0 0 0 0.6vh rgba(20,123,209,.15);
  transform: translateY(-0.2vh);
}

.c-field--password{ position: relative; }
.c-field--password input{ padding-right: 48px; }
.c-eye{
  position: absolute; right: 10px; top: 50%; transform: translateY(-10%);
  width: 40px; height: 40px; display:grid; place-items:center;
  border: 0; background: transparent; color: #64748b; cursor: pointer;
}
.c-eye .ico-on{ display: none; }
.c-eye[aria-pressed="true"] .ico-off{ display: none; }
.c-eye[aria-pressed="true"] .ico-on{ display: block; }

.c-row{ display:flex; align-items:center; justify-content:space-between; gap: 1.2vh; }
.c-link{ color: var(--blue); text-decoration:none; font-weight: 600; }
.c-link:hover{ text-decoration: underline; }

.c-submit{
  width: 100%;
  border: 0; border-radius: 1.2vh; cursor: pointer;
  background: var(--btn); color:#fff;
  padding: 1.4vh 1.6vh; margin-top: 1vh;
  font-weight: 800; font-size: clamp(14px, 2vh, 16px);
  box-shadow: 0 1.2vh 2.6vh rgba(59,63,68,.25);
  transition: transform .1s ease, background .2s ease, box-shadow .2s ease;
}
.c-submit:hover{ background: var(--btn-h); transform: translateY(-0.2vh); }

.c-help-bottom{
  margin-top: 2.2vh;
  padding-top: 1.4vh;
  border-top: 1px solid var(--line);
  text-align: center;
  color: #2a2f35;
  font-size: clamp(12px, 1.8vh, 14px);
  line-height: 1.4;
}

.c-page-footer{ display:none !important; }

@media (max-width: 900px){
  .c-card{
    width: 94vw;
    grid-template-columns: 1fr;
    height: calc(100dvh - var(--pad-v)*2 - var(--footer-h));
  }

  .c-left{ display: none; }

  .c-root{
    background: url('../img/left-visual.jpg') center/cover no-repeat fixed;
  }

  .c-right{
    min-height: 0;
    height: 100%;
    max-height: 100%;
  }

  .c-right > *{
    max-width: 100%;
    padding-left: 4vw;
    padding-right: 4vw;
  }
}

@media (max-height: 700px){
  .c-title{ font-size: clamp(22px, 4.2vh, 28px); }
  .c-subtitle{ font-size: clamp(12px, 1.8vh, 14px); }
  .c-right{ gap: 1.6vh; }
}

.c-right--compact{ gap: 1.4vh; }
.c-right--compact .c-title{ font-size: clamp(22px, 3.6vh, 32px); }
.c-right--compact .c-subtitle{ font-size: clamp(12px, 1.8vh, 16px); }

.c-right--compact .c-qr-box{
  border:1px solid var(--line); border-radius:1.2vh; padding:1.6vh;
  background:#fff;
}
.c-right--compact .c-qr-img{ max-width: 180px; height: auto; display:block; }
.c-right--compact .c-manual{ font-size: clamp(12px, 1.7vh, 14px); line-height:1.5; }

.c-right--compact .c-field input{ padding: 1vh 1.2vh; }
.c-right--compact .c-submit{ padding: 1.2vh 1.4vh; }

.c-sep{ margin-top: 2vh; padding-top: 1.4vh; border-top: 1px solid var(--line); }

@media (max-height: 900px){
  .c-right{ gap: 1.4vh; }
  .c-title{ font-size: clamp(22px, 3.6vh, 32px); }
  .c-subtitle{ font-size: clamp(12px, 1.8vh, 16px); }
}
