:root {
  --login-green: #084421;
  --login-dark: #062e19;
  --login-ink: #193126;
  --login-muted: #738078;
  --login-line: #dce6df;
}

* { box-sizing: border-box; }
body {
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  margin: 0;
  padding: clamp(16px, 4vw, 48px);
  display: grid;
  place-items: center;
  color: var(--login-ink);
  font-family: Inter, "Segoe UI", sans-serif;
  background-color: #07391e;
  background-image: linear-gradient(135deg, rgba(4, 41, 20, .76), rgba(8, 68, 33, .68)), url("../img/book.jpg");
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(250px, .82fr) minmax(360px, 1.18fr);
  width: min(920px, 100%);
  min-height: 560px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(0,0,0,.24);
  animation: login-enter .45s ease both;
}

.welcome-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px, 4vw, 46px);
  color: #fff;
  background: linear-gradient(155deg, rgba(5,44,23,.93), rgba(8,81,42,.88)), url("../img/book.jpg") center / cover;
}
.welcome-brand { display: flex; align-items: center; gap: 12px; font-size: .9rem; font-weight: 700; line-height: 1.3; }
.welcome-logo { width: 48px; height: 48px; object-fit: contain; padding: 4px; border-radius: 13px; background: rgba(255,255,255,.12); }
.welcome-copy { padding: 38px 0; }
.welcome-kicker, .form-eyebrow { color: #28794b; font-size: .69rem; font-weight: 800; letter-spacing: .15em; }
.welcome-kicker { color: #b8e6c7; }
.welcome-copy h1 { margin: 18px 0 12px; font-size: clamp(2.2rem, 4vw, 3rem); font-weight: 750; letter-spacing: -.055em; }
.welcome-copy p { max-width: 300px; margin: 0; color: rgba(255,255,255,.78); line-height: 1.7; }
.welcome-footer { padding-top: 18px; border-top: 1px solid rgba(255,255,255,.2); color: rgba(255,255,255,.76); font-size: .78rem; }

.login-form { display: flex; flex-direction: column; justify-content: center; padding: clamp(30px, 6vw, 68px); background: #fff; }
.brand-header { margin-bottom: 30px; }
.login-logo { display: none; }
.brand-header h2 { margin: 10px 0 6px; color: var(--login-ink); font-size: clamp(1.45rem, 3vw, 1.8rem); font-weight: 750; letter-spacing: -.04em; }
.brand-header p { margin: 0; color: var(--login-muted); font-size: .91rem; }
.login-form .alert { margin: 0 0 20px; border: 0; border-left: 4px solid #c53932; border-radius: 10px; }
.login-form .form-label { margin-bottom: 7px; color: #34483c; font-size: .86rem; font-weight: 650; }
.login-form .input-group { overflow: hidden; border: 1px solid var(--login-line); border-radius: 11px; background: #fbfdfb; transition: border-color .15s ease, box-shadow .15s ease; }
.login-form .input-group:focus-within { border-color: #6aa983; box-shadow: 0 0 0 4px rgba(8,68,33,.1); }
.login-form .input-group-text { border: 0; background: transparent; color: #718078; }
.login-form .form-control { min-height: 50px; border: 0; background: transparent; box-shadow: none; font-size: .92rem; }
.login-form .form-control::placeholder { color: #9aa69f; }
.login-form .otp-input { font-size: 1.15rem; font-weight: 700; letter-spacing: .35em; }
.form-hint { display: block; margin: 8px 2px 0; color: var(--login-muted); font-size: .76rem; }
.form-hint strong { color: var(--login-green); font-variant-numeric: tabular-nums; }
.form-hint.is-expired { color: #a12d25; }
.form-hint.is-expired strong { color: inherit; }
.toggle-password { min-width: 48px; justify-content: center; color: #5d6f63 !important; }
.toggle-password:hover { color: var(--login-green) !important; }
.toggle-password:focus-visible { outline: 2px solid var(--login-green); outline-offset: -4px; }
.login-submit { min-height: 50px; border: 0; border-radius: 11px; background: linear-gradient(100deg, #07391c, #0b7040); font-weight: 700; box-shadow: 0 8px 20px rgba(8,68,33,.17); transition: transform .15s ease, box-shadow .15s ease; }
.login-submit:hover { background: linear-gradient(100deg, #052b15, #095c34); transform: translateY(-1px); box-shadow: 0 11px 24px rgba(8,68,33,.23); }
.login-submit:disabled { cursor: wait; opacity: .86; transform: none; }
.login-help { margin: 24px 0 0; color: var(--login-muted); font-size: .76rem; line-height: 1.5; }
.login-help i { color: #5d8d6e; }
.back-home-link { display: inline-flex; align-items: center; align-self: flex-start; margin-top: 22px; color: var(--login-green); font-size: .86rem; font-weight: 650; text-decoration: none; }
.back-home-link:hover { color: var(--login-dark); text-decoration: underline; }
.back-home-link:focus-visible { border-radius: 4px; outline: 2px solid var(--login-green); outline-offset: 4px; }
.restart-login-link { margin-top: 16px; }
.login-form :focus-visible { outline-color: var(--login-green); }

@keyframes login-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 760px) {
  body { padding: 16px; }
  .login-shell { display: block; width: min(460px, 100%); min-height: 0; border-radius: 20px; }
  .welcome-panel { display: none; }
  .login-form { padding: 30px clamp(22px, 7vw, 36px); }
  .brand-header { margin-bottom: 26px; text-align: center; }
  .login-logo { display: block; width: 64px; height: 64px; margin: 0 auto 16px; object-fit: contain; }
}
@media (max-width: 360px) {
  body { padding: 10px; }
  .login-shell { border-radius: 16px; }
  .login-form { padding: 26px 18px; }
  .brand-header h2 { font-size: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
