/* ============================================================
   LMS Primary — Login & Registration Page
   Matches nicolaebogdan.school design system
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Rowdies:wght@300;400;700&family=Inter:wght@400;500;600;700&family=Dancing+Script:wght@600;700&display=swap');

/* ---------- Page ---------- */
body.login {
  background: #FCF7EE;
  font-family: 'Inter', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

body.login::before {
  content: '';
  position: fixed;
  top: -120px;
  right: -120px;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(252,128,10,.12) 0%, transparent 70%);
  pointer-events: none;
}

body.login::after {
  content: '';
  position: fixed;
  bottom: -80px;
  left: -80px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(252,128,10,.08) 0%, transparent 70%);
  pointer-events: none;
}

/* ---------- Logo / School Header (PHP-rendered, WP h1 is hidden) ---------- */
.lms-login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 20px;
  text-align: center;
}

.lms-login-logo__img {
  height: 120px;
  width: auto;
  display: block;
  margin: 0 auto 6px;
}

.lms-login-logo__icon {
  font-size: 2.6rem;
  line-height: 1;
  display: block;
  margin-bottom: 4px;
}

.lms-login-logo__name {
  font-family: 'Rowdies', sans-serif;
  font-size: 1.9rem;
  font-weight: 400;
  color: #020202;
  letter-spacing: -.01em;
  line-height: 1.1;
}

.lms-login-logo__motto {
  font-family: 'Dancing Script', cursive;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fc800a;
}

/* ---------- Wrapper ---------- */
#login {
  width: 100%;
  max-width: 420px;
  padding: 0 20px;
  box-sizing: border-box;
}

/* ---------- Form Card ---------- */
#loginform,
#registerform,
#lostpasswordform {
  background: #ffffff;
  border: none;
  border-radius: 12px;
  box-shadow: 6px 6px 9px rgba(0,0,0,.18);
  padding: 32px 28px;
  margin-top: 16px;
}

/* ---------- Labels ---------- */
.login label {
  font-family: 'Inter', sans-serif;
  font-size: .875rem;
  font-weight: 600;
  color: #28231c;
  margin-bottom: 4px;
  display: block;
}

/* ---------- Inputs ---------- */
.login input[type="text"],
.login input[type="password"],
.login input[type="email"],
.login input[type="number"] {
  font-family: 'Inter', sans-serif;
  font-size: .95rem;
  color: #020202;
  background: #fbf1e3;
  border: 2px solid #e5ddd3;
  border-radius: 9999px;
  padding: 10px 18px;
  width: 100%;
  box-sizing: border-box;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  box-shadow: none;
}

.login input[type="text"]:focus,
.login input[type="password"]:focus,
.login input[type="email"]:focus {
  border-color: #fc800a;
  box-shadow: 0 0 0 3px rgba(252,128,10,.15);
  background: #ffffff;
}

/* Neutralise WP's .button base styles on the toggle */
.login .button.wp-hide-pw,
.login .button.wp-hide-pw:hover,
.login .button.wp-hide-pw:focus,
.login .button.wp-hide-pw:focus-visible,
.login .button.wp-hide-pw:active {
  display: block;
  height: auto;
  line-height: 1;
  vertical-align: middle;
  border-radius: 50%;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

/* ---------- Submit Button ---------- */
.login .button-primary,
#wp-submit {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  background: #fc800a;
  color: #ffffff;
  border: 2px solid transparent;
  border-radius: 9999px;
  padding: 11px 32px;
  cursor: pointer;
  text-shadow: none;
  box-shadow: none;
  width: 100%;
  transition: background .2s, transform .15s;
}

.login .button-primary:hover,
#wp-submit:hover {
  background: #F26522;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(252,128,10,.35);
}

.login .button-primary:active,
#wp-submit:active {
  transform: translateY(0);
}

/* ---------- Show Password Toggle ---------- */
/* Grid overlay: input and button share the same cell; button floats right */
.login .wp-pwd {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto;
  align-items: center;
}

.login .wp-pwd input[type="password"],
.login .wp-pwd input[type="text"] {
  grid-area: 1 / 1;
  padding-right: 46px; /* room for the eye icon */
}

.login .wp-hide-pw {
  grid-area: 1 / 1;   /* same cell as input */
  justify-self: end;  /* push to the right */
  align-self: center; /* vertically centered without any top/transform math */
  position: relative;
  z-index: 1;
  background: none;
  border: none;
  padding: 4px 10px;
  margin: 0;
  cursor: pointer;
  color: #6b6b6b;
  line-height: 0;
  border-radius: 50%;
  transition: color .2s, background .2s;
  box-shadow: none;
  text-shadow: none;
  min-height: 0;
  min-width: 0;
  height: auto;
}

.login .wp-hide-pw:hover {
  color: #fc800a;
  background: rgba(252,128,10,.1);
}

.login .wp-hide-pw:focus,
.login .wp-hide-pw:focus-visible,
.login .wp-hide-pw:active {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}

.login .wp-hide-pw .dashicons {
  font-size: 20px;
  width: 20px;
  height: 20px;
  line-height: 1;
  display: block;
}

/* ---------- "Remember Me" checkbox ---------- */
.login .forgetmenot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px; /* more breathing room before the Log In button */
}

.login .forgetmenot label {
  font-weight: 400;
  font-size: .875rem;
  color: #6b6b6b;
  margin: 0;
  cursor: pointer;
  user-select: none;
}

/* Custom checkbox — fully suppress native rendering */
.login .forgetmenot input[type="checkbox"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 2px solid #e5ddd3;
  border-radius: 5px;
  background: #fbf1e3;
  cursor: pointer;
  position: relative;
  transition: background .2s, border-color .2s;
  flex-shrink: 0;
  /* block any native check drawing */
  color: transparent;
  display: inline-block;
  vertical-align: middle;
}

.login .forgetmenot input[type="checkbox"]:checked {
  background: #fc800a;
  border-color: #fc800a;
}

/* White tick drawn entirely with CSS — no native glyph */
.login .forgetmenot input[type="checkbox"]:checked::before {
  content: '';
  display: block;
  position: absolute;
  left: 7px;
  top: 1px;
  width: 6px;
  height: 10px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.login .forgetmenot input[type="checkbox"]:focus,
.login .forgetmenot input[type="checkbox"]:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(252,128,10,.2);
  border-color: #fc800a;
}

/* Space between forgetmenot and the submit paragraph */
#loginform .forgetmenot {
  margin-bottom: 22px;
  /* padding-left: 2px; */
}

#loginform p.submit {
  /* margin-top: 28px; */
  padding-top: 0;
}

/* ---------- Links ---------- */
#nav,
#backtoblog {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 14px 0 0;
  text-align: center;
}

#nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

#nav a {
  font-size: .82rem;
  font-family: 'Inter', sans-serif;
  color: #888;
  text-decoration: none;
  padding: 4px 12px;
  border-radius: 20px;
  transition: color .2s, background .2s;
  letter-spacing: .01em;
}

#nav a:hover {
  color: #fc800a;
  background: rgba(252,128,10,.08);
}

/* Separator between Register and Lost password */
#nav .nav-separator {
  color: #ccc;
  font-size: .75rem;
  line-height: 1;
}

#backtoblog {
  padding: 10px 0 4px;
}

#backtoblog a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  font-family: 'Inter', sans-serif;
  color: #aaa;
  text-decoration: none;
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid #e8ddd0;
  transition: color .2s, border-color .2s, background .2s;
  letter-spacing: .01em;
}

#backtoblog a:hover {
  color: #fc800a;
  border-color: #fc800a;
  background: rgba(252,128,10,.05);
}

/* ---------- Error / Message ---------- */
#login_error,
.login .message,
.login .success {
  border-radius: 8px;
  border-left: 4px solid;
  font-size: .875rem;
  font-family: 'Inter', sans-serif;
  margin-bottom: 16px;
  padding: 12px 16px;
}

#login_error {
  background: #fff0ec;
  color: #b83000;
  border-color: #F26522;
}

.login .message {
  background: linear-gradient(135deg, #fff4e0 0%, #fff9f0 100%);
  color: #5a3500;
  border-left: 4px solid #fc800a;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 500;
  padding: 14px 18px;
  box-shadow: 0 2px 12px rgba(252,128,10,.12);
  position: relative;
  overflow: hidden;
}

.login .message::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 60px; height: 60px;
  background: radial-gradient(circle, rgba(252,128,10,.15) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(20px, -20px);
}

.login .success {
  background: #f0f9e8;
  color: #2d6a00;
  border-color: #88B520;
}

/* ---------- Privacy policy link ---------- */
.login #login_privacy_policy {
  font-size: .8rem;
  color: #6b6b6b;
  text-align: center;
  padding: 8px 0;
}

/* ---------- Interim login (session-expired modal iframe) ---------- */
body.interim-login {
  background: #FCF7EE;
  min-height: auto;
  padding: 16px 0 12px;
  overflow: hidden;
}

body.interim-login::before,
body.interim-login::after {
  display: none;
}

body.interim-login #login {
  max-width: 100%;
  padding: 0 20px;
}

body.interim-login #loginform {
  box-shadow: none;
  border: 1px solid rgba(230,90,30,.15);
  margin-top: 10px;
  padding: 20px 22px;
}

/* Logo suppressed in the modal — the modal header carries the branding */
body.interim-login .lms-login-logo {
  display: none;
}

/* Compact form fields */
body.interim-login .login label {
  font-size: .8rem;
  margin-bottom: 2px;
}

body.interim-login .login input[type="text"],
body.interim-login .login input[type="password"],
body.interim-login .login input[type="email"] {
  padding: 8px 16px;
  font-size: .88rem;
}

body.interim-login .login .forgetmenot {
  margin-bottom: 14px;
}

body.interim-login #login_error,
body.interim-login .login .message {
  padding: 10px 14px;
  font-size: .82rem;
  margin-bottom: 10px;
}

body.interim-login #nav,
body.interim-login #backtoblog {
  display: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 460px) {
  #login { padding: 0 12px; }
  #loginform,
  #registerform,
  #lostpasswordform { padding: 24px 18px; }
}
