/* ==========================================================================
   A'Erth · Crimson Twilight
   wp-login.php skin. Loaded through login_enqueue_scripts.

   Copy is WordPress default per the ship decision: Username or Email
   Address, Password, Remember Me, Log In, stock error text. No gettext
   filters. The only string the theme supplies is the wordmark itself via
   login_headertext.

   Everything below is CSS on markup WordPress already prints. The single
   script (aerth-login-seal.js) is optional polish; with JS off the form
   posts normally and nothing looks broken.
   ========================================================================== */

body.login {
  --bg: #0b0b0c;
  --ash: #1a1512;
  --ash-2: #221b17;
  --ash-line: #3f2f26;
  --border: #2d2f33;
  --text: #e4e4e7;
  --muted: #8b8d92;
  --red: #c53131;
  --red-hi: #e84545;
  --gold: #dda15e;
  --vellum-2: #f0e6d2;
  --vellum-3: #a0876a;
  --tarnish: #6b5a3e;
  --font-mark: 'IM Fell English SC', Georgia, serif;
  --font-body: 'Cardo', Georgia, serif;
  --font-label: 'Alegreya Sans SC', system-ui, -apple-system, sans-serif;

  position: relative;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* vignette + crimson bloom + grain. Two fixed layers, no images. */
body.login::before,
body.login::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
body.login::before {
  background:
    radial-gradient(70% 55% at 50% 8%, rgba(197,49,49,0.16) 0%, rgba(197,49,49,0.03) 42%, rgba(0,0,0,0) 72%),
    radial-gradient(120% 100% at 50% 50%, rgba(0,0,0,0) 40%, rgba(0,0,0,0.75) 100%);
}
body.login::after {
  opacity: 0.6;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.014) 0 1px, rgba(0,0,0,0) 1px 3px),
    repeating-linear-gradient(90deg, rgba(0,0,0,0.16) 0 1px, rgba(0,0,0,0) 1px 4px);
}

#login {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  padding: 60px 24px;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Wax seal medallion + wordmark
   The medallion is a background data URI on #login, sitting above the h1.
   No markup change, no image request.
   -------------------------------------------------------------------------- */
#login {
  background-repeat: no-repeat;
  background-position: center 60px;
  background-size: 86px 86px;
  padding-top: 166px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 86 86'%3E%3Ccircle cx='43' cy='43' r='41' fill='none' stroke='%236b5a3e' stroke-opacity='0.7'/%3E%3Ccircle cx='43' cy='43' r='36' fill='none' stroke='%23dda15e' stroke-opacity='0.28' stroke-dasharray='1 7'/%3E%3Ccircle cx='43' cy='43' r='27' fill='%237d1f1f' fill-opacity='0.42' stroke='%23c53131' stroke-opacity='0.7'/%3E%3Cpath d='M43 22v42M25 32l36 22M61 32l-36 22' stroke='%23dda15e' stroke-opacity='0.45'/%3E%3Ccircle cx='43' cy='43' r='7' fill='%23c53131' fill-opacity='0.8' stroke='%23e84545' stroke-opacity='0.6'/%3E%3C/svg%3E");
}

/* #login h1 a: drop the WP logo sprite, show the text instead */
#login h1 { margin: 0; text-align: center; }
#login h1 a {
  display: block;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  background: none;
  background-image: none;
  text-indent: 0;
  overflow: visible;
  font-family: var(--font-mark);
  font-size: clamp(46px, 10vw, 60px);
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1;
  color: var(--red-hi);
  text-shadow: 0 0 46px rgba(197,49,49,0.36), 0 2px 0 rgba(0,0,0,0.7);
}
#login h1 a:hover,
#login h1 a:focus { color: var(--red-hi); box-shadow: none; }

/* subtitle, printed by login_headertext as a second line inside the h1 a,
   or as .aerth-login-sub if you prefer the login_header action */
#login h1 a .sub,
.aerth-login-sub {
  display: block;
  font-family: var(--font-label);
  font-style: italic;
  font-size: 15px;
  letter-spacing: 0.28em;
  color: var(--gold);
  margin-top: 14px;
  text-shadow: none;
}
#login h1 a .sub::before,
.aerth-login-sub::before,
#login h1 a .sub::after,
.aerth-login-sub::after { content: '·'; font-style: normal; opacity: 0.6; margin: 0 0.7em; }

/* --------------------------------------------------------------------------
   The form card
   -------------------------------------------------------------------------- */
#loginform,
#lostpasswordform,
#registerform {
  position: relative;
  background: linear-gradient(180deg, var(--ash) 0%, #141315 100%);
  border: 1px solid var(--ash-line);
  border-radius: 3px;
  padding: 30px 28px 26px;
  margin-top: 26px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  transition: opacity .4s ease, filter .4s ease;
}
/* ecclesiastical rule across the top */
#loginform::before,
#lostpasswordform::before,
#registerform::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, rgba(197,49,49,0) 0%, var(--red) 30%, var(--gold) 50%, var(--red) 70%, rgba(197,49,49,0) 100%);
}
/* one corner flourish pair, enough at this scale */
#loginform::after {
  content: "";
  position: absolute; bottom: 0; right: 0; width: 16px; height: 16px;
  border: solid var(--tarnish); border-width: 0 1px 1px 0;
}

#loginform p { margin: 0; }
#loginform label,
#lostpasswordform label {
  display: block;
  font-family: var(--font-label);
  font-size: 14px;
  letter-spacing: 0.2em;
  color: var(--vellum-3);
  margin-bottom: 8px;
  text-transform: none;
}

/* ledger fields: ash ground, tarnish baseline, no WP box */
body.login input[type="text"],
body.login input[type="email"],
body.login input[type="password"] {
  background: var(--ash-2);
  border: 1px solid var(--ash-line);
  border-bottom: 1px solid var(--tarnish);
  border-radius: 2px;
  box-shadow: none;
  color: var(--vellum-2);
  font-family: var(--font-body);
  font-size: 18px;
  padding: 12px 14px;
  margin: 0 0 20px;
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
body.login input[type="password"] { letter-spacing: 0.32em; }
body.login input[type="text"]:focus,
body.login input[type="email"]:focus,
body.login input[type="password"]:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(221,161,94,0.25);
  outline: none;
}
body.login .wp-pwd { position: relative; }
body.login .wp-pwd .button.wp-hide-pw {
  color: var(--vellum-3);
  top: 4px;
  right: 4px;
}
body.login .wp-pwd .button.wp-hide-pw:hover { color: var(--gold); }

/* remember me */
body.login .forgetmenot {
  display: flex; align-items: center; gap: 9px;
  margin: 0 0 22px;
  float: none;
  font-family: var(--font-body);
  font-size: 17px;
  color: var(--vellum-3);
}
body.login .forgetmenot input[type="checkbox"] {
  appearance: none;
  width: 15px; height: 15px;
  border: 1px solid var(--tarnish);
  border-radius: 2px;
  background: var(--ash-2);
  display: inline-flex; align-items: center; justify-content: center;
  margin: 0;
}
body.login .forgetmenot input[type="checkbox"]:checked::before {
  content: "";
  width: 7px; height: 7px;
  background: var(--gold);
  display: block;
}
body.login .forgetmenot label { display: inline; margin: 0; font-family: var(--font-body); font-size: 17px; letter-spacing: 0; color: var(--vellum-3); text-transform: none; }

/* submit: crimson pressed plate */
body.login .submit { margin: 0; }
body.login #wp-submit,
body.login .button-primary {
  display: block;
  width: 100%;
  float: none;
  font-family: var(--font-label);
  font-size: 17px;
  letter-spacing: 0.24em;
  text-transform: none;
  text-shadow: none;
  color: #f4e4c8;
  background: linear-gradient(180deg, var(--red) 0%, #8f2323 100%);
  border: 1px solid #e07070;
  border-radius: 2px;
  padding: 14px 16px;
  height: auto;
  line-height: 1.2;
  box-shadow: 0 0 26px rgba(197,49,49,0.28), inset 0 1px 0 rgba(255,255,255,0.14);
  transition: background .18s, box-shadow .18s;
}
body.login #wp-submit:hover,
body.login #wp-submit:focus {
  background: linear-gradient(180deg, var(--red-hi) 0%, #a52a2a 100%);
  box-shadow: 0 0 34px rgba(232,69,69,0.34), inset 0 1px 0 rgba(255,255,255,0.18);
}
body.login #wp-submit:active { box-shadow: inset 0 2px 6px rgba(0,0,0,0.5); }

/* --------------------------------------------------------------------------
   Nav, back link, error slip
   -------------------------------------------------------------------------- */
#nav, #backtoblog {
  text-align: center;
  padding: 0;
  margin: 0;
  font-family: var(--font-label);
  font-size: 15px;
  letter-spacing: 0.16em;
}
#nav { margin-top: 20px; }
#backtoblog { margin-top: 6px; }
#nav a, #backtoblog a { color: var(--gold); }
#nav a:hover, #backtoblog a:hover { color: var(--red-hi); }

/* torn crimson slip replaces the WP notice box */
body.login #login_error,
body.login .message,
body.login .notice {
  position: relative;
  background: #241417;
  border: 1px solid #5a2226;
  border-left: 3px solid var(--red);
  border-radius: 0 2px 2px 0;
  box-shadow: none;
  color: #f0d6d2;
  font-family: var(--font-body);
  font-size: 17px;
  padding: 14px 18px;
  margin: 0 0 20px;
  overflow: hidden;
}
body.login #login_error::before {
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 140% at 0% 50%, rgba(197,49,49,0.22) 0%, rgba(0,0,0,0) 70%);
}
body.login #login_error strong { color: #ffd9d4; }
body.login .message {
  background: #1a1512;
  border-color: var(--ash-line);
  border-left-color: var(--gold);
  color: var(--vellum-2);
}
body.login #login_error a,
body.login .message a { color: var(--gold); }

body.login .privacy-policy-page-link { display: none; }
body.login .language-switcher { display: none; }

/* --------------------------------------------------------------------------
   Seal close on submit (progressive enhancement, aerth-login-seal.js)
   Without the script this class is never added and nothing changes.
   -------------------------------------------------------------------------- */
body.login.is-sealing #loginform {
  opacity: 0.35;
  filter: saturate(0.6);
  pointer-events: none;
}
body.login.is-sealing #login::after {
  content: "";
  position: absolute;
  top: 60px; left: 50%;
  width: 86px; height: 86px;
  margin-left: -43px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  animation: aerth-seal-close .4s ease-in forwards;
}
@keyframes aerth-seal-close {
  from { transform: scale(1.6); opacity: 0; }
  to   { transform: scale(1);   opacity: 0.9; }
}
@media (prefers-reduced-motion: reduce) {
  body.login *, body.login *::before, body.login *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 480px) {
  #login { padding: 40px 18px; padding-top: 138px; background-position: center 40px; background-size: 68px 68px; }
  #login h1 a { font-size: 40px; }
}
