/* ══════════════════════════════════════════════════
   JFW Login Page
   Standalone — uses design tokens from layout.css
══════════════════════════════════════════════════ */

html, body.jfw-login-body {
  height: 100%;
  margin: 0;
}

body.jfw-login-body {
  background: var(--surface-bg, #FAFAFA);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
  box-sizing: border-box;
}

.jfw-login-wrap {
  width: 100%;
  max-width: 420px;
}

.jfw-login-card {
  background: var(--surface-card, #fff);
  border-radius: 20px;
  padding: 40px 36px 44px;
  box-shadow: var(--shadow-soft, 0 4px 24px rgba(0,0,0,0.06));
}

/* ── Brand / wordmark ─────────────────────────────── */
.jfw-login-brand {
  text-align: center;
  margin-bottom: 28px;
}

.jfw-login-brand img,
.jfw-login-brand .custom-logo {
  max-height: 80px;
  width: auto;
}

.jfw-login-wordmark {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary, #1C1C1E);
  letter-spacing: -0.01em;
}

.jfw-login-logo {
  max-width: 220px;
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* ── Heading ──────────────────────────────────────── */
.jfw-login-heading {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--text-primary, #1C1C1E);
  margin: 0 0 28px;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-align: center;
}

/* ── Error ────────────────────────────────────────── */
.jfw-login-error {
  display: none;
  background: var(--accent-danger-08, rgba(201,75,75,0.08));
  color: var(--accent-danger, #C94B4B);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.875rem;
  margin-bottom: 18px;
  text-align: center;
}

.jfw-login-error--visible {
  display: block;
}

/* ── Form ─────────────────────────────────────────── */
.jfw-login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.jfw-login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.jfw-login-field label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary, rgba(28,28,30,0.55));
}

.jfw-login-field input {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface-elevated, #F5F5F5);
  border: 1.5px solid #e2ddd8;
  border-radius: 12px;
  font-size: 1rem;
  color: var(--text-primary, #1C1C1E);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  box-sizing: border-box;
  -webkit-appearance: none;
}

.jfw-login-field input:focus {
  border-color: var(--accent-primary, #6C4EDB);
  background: #fff;
}

/* ── Password toggle ──────────────────────────────── */
.jfw-login-pwd-wrap {
  position: relative;
}

.jfw-login-pwd-wrap input {
  padding-right: 44px;
}

.jfw-login-toggle-pwd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-secondary, rgba(28,28,30,0.45));
  transition: color 0.15s;
  display: flex;
  align-items: center;
}

.jfw-login-toggle-pwd:hover {
  color: var(--text-primary, #1C1C1E);
}

/* ── Submit ───────────────────────────────────────── */
.jfw-login-submit {
  margin-top: 6px;
  width: 100%;
  padding: 14px;
  background: var(--accent-primary, #6C4EDB);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
}

.jfw-login-submit:hover:not(:disabled) {
  background: var(--accent-primary-hover, #5a3bc7);
}

.jfw-login-submit:active:not(:disabled) {
  transform: scale(0.98);
}

.jfw-login-submit:disabled {
  opacity: 0.7;
  cursor: default;
}

/* ── Spinner ──────────────────────────────────────── */
.jfw-login-submit__spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: jfw-spin 0.7s linear infinite;
}

@keyframes jfw-spin {
  to { transform: rotate(360deg); }
}

/* ── Mobile ───────────────────────────────────────── */
@media (max-width: 460px) {
  .jfw-login-card {
    padding: 32px 22px 36px;
    border-radius: 16px;
  }
}
