/* HWF Custom Login
 * Brand-aligned login screen. Companion to functions.php's custom_login_styles
 * (which enqueues PJS + this CSS) and login_headerurl filter.
 *
 * Sections:
 *   1. Tokens
 *   2. Body + container (subtle vertical brand-blue-tint gradient)
 *   3. Logo
 *   4. Form card
 *   5. Inputs (matches form polish — 38px controls, brand focus halo)
 *   6. Submit button (brand classic — uppercase, dark border, brand link)
 *   7. Remember Me checkbox
 *   8. Footer links (Lost password / Back to site)
 *   9. Validation messages
 */

/* ─── 1. Tokens ─────────────────────────────────────────────────────── */

:root {
  --hwf-blue:        #1E94D2;
  --hwf-blue-dark:   #156A99;
  --hwf-blue-tint:   #DCEEF8;
  --hwf-ink:         #0F172A;
  --hwf-ink-muted:   #475569;
  --hwf-rule-strong: #9CA3AF;
  --hwf-border-dark: #092C3E;

  --hwf-fast:        140ms;
  --hwf-ease:        cubic-bezier(0.22, 1, 0.36, 1);
}

/* ─── 2. Body + container ───────────────────────────────────────────── */

body.login {
  background: linear-gradient(180deg, var(--hwf-blue-tint) 0%, #ffffff 60%);
  background-attachment: fixed;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--hwf-ink);
}

#login {
  width: 360px;
  padding: 8% 0 0;
}

/* ─── 3. Logo ───────────────────────────────────────────────────────── */

.login h1 a {
  background-image: url('Hopeworks-Logo.png');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  width: 100%;
  height: 120px;
  margin-bottom: 28px;
  text-indent: -9999px;
  outline: 0;
  overflow: hidden;
  display: block;
  /* subtle anchor — radial accent behind the logo, very faint */
  filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.06));
}

/* ─── 4. Form card ──────────────────────────────────────────────────── */

.login form {
  max-width: 360px;
  margin: 0 auto;
  background: #ffffff;
  padding: 28px 28px 22px;
  border-radius: 10px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 8px 24px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(15, 23, 42, 0.04);
}

.login form .input,
.login form input[type="text"],
.login form input[type="password"],
.login form input[type="email"] {
  /* defer to section 5; this is a spec anchor */
}

.login label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--hwf-ink);
  letter-spacing: -0.005em;
  margin-bottom: 6px;
  display: inline-block;
}

/* ─── 5. Inputs ─────────────────────────────────────────────────────── */

.login form .input,
.login form input[type="text"],
.login form input[type="password"],
.login form input[type="email"] {
  width: 100%;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--hwf-ink);
  background-color: #ffffff;
  border: 1px solid var(--hwf-rule-strong);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  margin: 0 0 16px;
  box-shadow: none;
  box-sizing: border-box;
  transition:
    border-color var(--hwf-fast) var(--hwf-ease),
    box-shadow var(--hwf-fast) var(--hwf-ease);
  font-family: inherit;
}

.login form .input:focus,
.login form input[type="text"]:focus,
.login form input[type="password"]:focus,
.login form input[type="email"]:focus {
  outline: 0;
  border-color: var(--hwf-blue) !important;
  box-shadow: 0 0 0 3px var(--hwf-blue-tint) !important;
}

/* ─── 6. Submit button — brand classic ──────────────────────────────── */

.login .button-primary,
.login input[type="submit"].button-primary,
.login #wp-submit {
  background: var(--hwf-blue) !important;
  color: #ffffff !important;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.55rem 1.75rem !important;
  height: auto !important;
  line-height: 1.3 !important;
  border: 1px solid var(--hwf-border-dark) !important;
  border-radius: 6px;
  text-shadow: none !important;
  box-shadow: none !important;
  cursor: pointer;
  transition:
    background-color var(--hwf-fast) var(--hwf-ease),
    box-shadow var(--hwf-fast) var(--hwf-ease);
  width: 100%;
}

.login .button-primary:hover,
.login #wp-submit:hover {
  background: var(--hwf-blue-dark) !important;
}

.login .button-primary:focus,
.login #wp-submit:focus {
  outline: 0 !important;
  box-shadow: 0 0 0 3px var(--hwf-blue-tint) !important;
}

.login .submit {
  margin-top: 4px;
}

/* ─── 7. Remember Me checkbox ──────────────────────────────────────── */

.login .forgetmenot {
  font-size: 0.875rem;
  color: var(--hwf-ink-muted);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.login .forgetmenot input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--hwf-blue);
}

.login .forgetmenot label {
  margin: 0;
  font-weight: 400;
  cursor: pointer;
}

/* ─── 8. Footer links ──────────────────────────────────────────────── */

#login #nav,
#login #backtoblog {
  text-align: center;
  font-size: 0.8125rem;
  margin: 14px 0 0;
  padding: 0 24px;
  text-shadow: none;
}

#login #nav a,
#login #backtoblog a {
  color: var(--hwf-ink-muted);
  text-decoration: none;
  transition: color var(--hwf-fast) var(--hwf-ease);
}

#login #nav a:hover,
#login #backtoblog a:hover,
#login #nav a:focus,
#login #backtoblog a:focus {
  color: var(--hwf-blue-dark);
  text-decoration: underline;
  box-shadow: none;
  outline: 0;
}

/* ─── 9. Validation messages ───────────────────────────────────────── */

.login .message,
.login #login_error,
.login .notice {
  border-radius: 8px;
  border-left-width: 4px;
  padding: 12px 14px;
  font-size: 0.875rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  margin: 0 0 18px;
  font-family: inherit;
}

.login #login_error {
  border-left-color: #DC2626;
  background: #fef2f2;
  color: #991b1b;
}

/* ─── 10. Mobile sanity ────────────────────────────────────────────── */

@media (max-width: 480px) {
  #login {
    width: 92%;
    padding-top: 6%;
  }
  .login form {
    padding: 22px 20px 18px;
  }
  .login h1 a {
    height: 100px;
    margin-bottom: 22px;
  }
}
