﻿/* =============================================================
   SMAN 1 PURWOKERTO – Custom WP Login Page
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Montserrat:wght@600;700;800&display=swap');

:root {
  --lg-primary:      #9E1B1E;
  --lg-primary-lt:   #D9252B;
  --lg-primary-dk:   #661012;
  --lg-accent:       #D4AF37;
  --lg-white:        #ffffff;
  --lg-bg:           #0e0203;
  --lg-card-bg:      rgba(18, 5, 6, 0.72);
  --lg-card-border:  rgba(255,255,255,.09);
  --lg-input-bg:     rgba(255,255,255,.055);
  --lg-input-border: rgba(255,255,255,.13);
  --lg-muted:        rgba(255,255,255,.40);
  --lg-font-head:    'Montserrat', sans-serif;
  --lg-font-body:    'Inter', sans-serif;
}

html { height: 100%; }
body.login {
  margin: 0; padding: 0; min-height: 100vh;
  font-family: var(--lg-font-body);
  background: var(--lg-bg);
  color: var(--lg-white);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; /* FIX: Center horizontally even if there are multiple children like language switcher */
}

/* Background Effects */
body.login::before {
  content: ''; position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 70% 55% at 8% 18%, rgba(158,27,30,.60) 0%, transparent 60%),
    radial-gradient(ellipse 60% 45% at 92% 82%, rgba(102,16,18,.55) 0%, transparent 60%),
    linear-gradient(155deg, #1f0305 0%, #0e0203 45%, #1a0f03 100%);
}

body.login #login {
  position: relative; z-index: 10;
  width: 420px; max-width: calc(100vw - 32px);
  padding: 0; margin: 0 auto !important;
}

/* Logo */
body.login #login h1 a {
  background-image: url('../images/logo.png') !important;
  background-size: contain !important;
  width: 90px !important; height: 90px !important;
  margin: 0 auto 10px !important;
  filter: drop-shadow(0 4px 18px rgba(212,175,55,.32));
}

/* Custom Titles */
body.login .lg-school-name {
  display: block; text-align: center;
  font-family: var(--lg-font-head); font-size: 1.1rem; font-weight: 800;
  color: var(--lg-accent); margin-bottom: 4px;
}
body.login .lg-school-sub {
  display: block; text-align: center;
  font-size: 0.75rem; font-weight: 500; color: var(--lg-muted);
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 24px;
}

/* Form Card */
body.login #loginform,
body.login #lostpasswordform {
  background: var(--lg-card-bg) !important;
  backdrop-filter: blur(32px) !important;
  -webkit-backdrop-filter: blur(32px) !important;
  border: 1px solid var(--lg-card-border) !important;
  border-radius: 22px !important;
  padding: 36px 38px 32px !important;
  box-shadow: 0 40px 90px rgba(0,0,0,.60) !important;
}

/* Labels */
body.login #loginform label,
body.login #lostpasswordform label {
  font-family: var(--lg-font-body) !important;
  font-size: 0.75rem !important; font-weight: 600 !important;
  color: rgba(255,255,255,.7) !important;
  text-transform: uppercase !important; letter-spacing: 0.05em !important;
  margin-bottom: 8px !important; display: block;
}

/* Inputs */
body.login form p { margin-bottom: 20px !important; position: relative; }
body.login .user-pass-wrap { margin-bottom: 20px !important; position: relative; }

body.login #loginform input[type="text"],
body.login #loginform input[type="password"],
body.login #lostpasswordform input[type="text"],
body.login #lostpasswordform input[type="email"] {
  width: 100% !important; height: 50px !important;
  background-color: var(--lg-input-bg) !important;
  border: 1.5px solid var(--lg-input-border) !important;
  border-radius: 11px !important;
  color: var(--lg-white) !important;
  font-size: 0.95rem !important;
  padding: 0 44px !important;
  box-shadow: none !important;
  margin-bottom: 0 !important;
}

body.login #loginform input[type="text"]:focus,
body.login #loginform input[type="password"]:focus,
body.login #lostpasswordform input[type="text"]:focus,
body.login #lostpasswordform input[type="email"]:focus {
  border-color: var(--lg-accent) !important;
  background-color: rgba(212,175,55,.06) !important;
  box-shadow: 0 0 0 3px rgba(212,175,55,.18) !important;
}

/* FIX: Autofill Background Hack using Transition */
body.login input:-webkit-autofill,
body.login input:-webkit-autofill:hover,
body.login input:-webkit-autofill:focus,
body.login input:-webkit-autofill:active {
  transition: background-color 5000s ease-in-out 0s, color 5000s ease-in-out 0s !important;
  -webkit-text-fill-color: #ffffff !important;
  caret-color: #ffffff !important;
  border-color: rgba(212,175,55,.35) !important;
}

/* Icons: injected as real <span class="lg-field-icon"> via JS in login_footer
   so browser autofill cannot override them */

/* Wrapper div injected around username input to isolate positioning from label */
body.login .lg-input-wrap {
  position: relative;
  display: block;
}

body.login .lg-field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
  color: rgba(255,255,255,.40);
  transition: color .22s ease;
}

body.login .wp-pwd:focus-within .lg-field-icon,
body.login .lg-input-wrap:focus-within .lg-field-icon,
body.login p:focus-within > .lg-field-icon {
  color: var(--lg-accent);
}

body.login .lg-field-icon svg {
  display: block;
  fill: none;
  stroke: currentColor;
}

/* Show/Hide Password Button */
body.login .wp-pwd { position: relative; }
body.login .wp-hide-pw {
  position: absolute !important; right: 10px !important; top: 50% !important;
  transform: translateY(-50%) !important; color: var(--lg-muted) !important;
  background: transparent !important; border: none !important; box-shadow: none !important;
}
body.login .wp-hide-pw:hover { color: var(--lg-accent) !important; }

/* Remember Me Toggle */
body.login .forgetmenot {
  margin: 0 0 24px !important; position: relative;
}
body.login .forgetmenot input[type="checkbox"] {
  position: absolute; opacity: 0; pointer-events: none;
}
body.login .forgetmenot label {
  display: flex !important; align-items: center;
  font-size: 0.8rem !important; color: rgba(255,255,255,.6) !important;
  cursor: pointer; padding-left: 46px !important; position: relative;
  text-transform: none !important; letter-spacing: 0 !important;
  min-height: 24px; margin-bottom: 0 !important;
}
body.login .forgetmenot label::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 36px; height: 20px; background: rgba(255,255,255,.15);
  border-radius: 20px; transition: 0.3s ease;
}
body.login .forgetmenot label::after {
  content: ''; position: absolute; left: 3px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; background: #fff;
  border-radius: 50%; transition: 0.3s ease; box-shadow: 0 2px 4px rgba(0,0,0,.3);
}
body.login .forgetmenot input[type="checkbox"]:checked + label::before {
  background: var(--lg-accent);
}
body.login .forgetmenot input[type="checkbox"]:checked + label::after {
  left: 19px;
}

/* Submit Button */
body.login .submit { margin: 0 !important; padding: 0 !important; }
body.login #wp-submit,
body.login #lostpasswordform input[type="submit"] {
  width: 100% !important; height: 50px !important;
  background: linear-gradient(135deg, var(--lg-primary-dk), var(--lg-primary), var(--lg-primary-lt)) !important;
  border: none !important; border-radius: 13px !important;
  color: #fff !important; font-family: var(--lg-font-head) !important;
  font-size: 0.9rem !important; font-weight: 700 !important;
  text-transform: uppercase !important; letter-spacing: 0.08em !important;
  box-shadow: 0 6px 20px rgba(158,27,30,.4) !important;
  transition: 0.3s ease !important; text-shadow: none !important;
}
body.login #wp-submit:hover,
body.login #lostpasswordform input[type="submit"]:hover {
  transform: translateY(-2px); box-shadow: 0 8px 25px rgba(158,27,30,.6) !important;
}

/* ── Notices & error messages (global — WP renders them OUTSIDE the form) ── */
body.login .message,
body.login p.message,
body.login #login_error,
body.login .notice {
  background: rgba(212,175,55,.08) !important;
  border: 1px solid rgba(212,175,55,.22) !important;
  border-left: 3px solid var(--lg-accent) !important;
  border-radius: 10px !important;
  color: rgba(255,255,255,.75) !important;
  font-family: var(--lg-font-body) !important;
  font-size: 0.82rem !important;
  padding: 12px 16px !important;
  margin-bottom: 16px !important;
  line-height: 1.6 !important;
  box-shadow: none !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

body.login #login_error {
  background: rgba(239, 68, 68, .10) !important;
  border-color: rgba(239,68,68,.30) !important;
  border-left-color: #ef4444 !important;
  color: #fca5a5 !important;
}

/* The notice paragraph WP outputs directly inside the form (description text) */
body.login #lostpasswordform > p:not(.submit) {
  color: rgba(255,255,255,.60) !important;
  font-size: 0.82rem !important;
  line-height: 1.6 !important;
  margin-bottom: 20px !important;
}

/* Bottom Links */
body.login #nav, body.login #backtoblog {
  text-align: center !important; margin-top: 16px !important; padding: 0 !important;
}
body.login #nav a, body.login #backtoblog a {
  color: var(--lg-accent) !important; text-decoration: none !important;
  font-size: 0.8rem !important; transition: 0.3s !important;
  font-weight: 600 !important;
}
body.login #nav a:hover, body.login #backtoblog a:hover {
  color: var(--lg-white) !important;
  text-shadow: 0 0 8px rgba(212,175,55,.5);
}

/* Footer Copyright */
body.login .login-footer-copy {
  text-align: center; margin-top: 20px; font-size: 0.7rem;
  color: rgba(255,255,255,.2); font-family: var(--lg-font-body);
}
body.login .privacy-policy-page-link { display: none !important; }
