/* ══════════════════════════════════════════════════════
   LOGIN · CREDENTIAL CARD · LOADING · PASSWORD CHANGE
══════════════════════════════════════════════════════ */

/* ── LOGIN SCREEN ─────────────────────────────────── */
#emb-login {
  position: fixed; inset: 4px; z-index: 100;
  background: #050505;
  display: flex; align-items: center; justify-content: center;
  padding: var(--s8) var(--s4) calc(var(--s8) + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  border-radius: var(--r-sm);
}
#emb-login.out { animation: loginOut .6s forwards; }

#emb-silk-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border-radius: inherit; z-index: 0;
}

.emb-login-panel {
  position: relative; z-index: 1;
  width: 100%; max-width: 400px;
  background: rgba(6,6,6,.76);
  border: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(24px);
  box-shadow: 0 40px 100px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.05);
  padding: var(--s8) var(--s6);
  border-radius: var(--r-xl);
  display: flex; flex-direction: column; align-items: center; gap: var(--s5);
  animation: blurFadeUp 1.2s var(--ease-out) both;
}

.emb-login-seal img {
  width: 88px; height: auto;
  filter: var(--logo-filter);
  opacity: .9;
}

.emb-login-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 400; color: var(--text);
  text-align: center; line-height: 1.1;
}
.emb-login-brand {
  font-family: var(--font-mono); font-size: .78rem;
  letter-spacing: .22em; text-transform: uppercase;
  color: rgba(255,255,255,.4); text-align: center; margin-top: -.4rem;
}
.emb-login-sub {
  font-size: .9rem; color: var(--text-dim);
  text-align: center; line-height: 1.5; margin-top: -.2rem;
}

.emb-login-form { display: flex; flex-direction: column; gap: var(--s4); width: 100%; }

.emb-f-group { display: flex; flex-direction: column; gap: var(--s1); }
.emb-f-label {
  font-family: var(--font-mono); font-size: .62rem;
  font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-muted);
}
.emb-f-group input {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--text); font-size: .9rem;
  padding: var(--s3) var(--s4);
  width: 100%; height: 50px;
  border-radius: var(--r-sm);
  caret-color: var(--accent);
  transition: border-color var(--dur-base), background var(--dur-base);
}
.emb-f-group input:focus {
  border-color: var(--accent);
  background: rgba(216,250,46,.04);
}
.emb-f-group input::placeholder { color: var(--text-faint); }

.emb-login-err {
  font-family: var(--font-mono); font-size: .75rem;
  color: var(--danger); min-height: 1rem;
  text-align: center; letter-spacing: .04em; line-height: 1.5;
}

.emb-btn-auth {
  width: 100%; height: 54px;
  background: var(--text); color: var(--bg);
  font-size: .9rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  border-radius: var(--r-md);
  transition: background var(--dur-base), color var(--dur-base), transform var(--dur-fast);
}
.emb-btn-auth:hover  { background: var(--accent); }
.emb-btn-auth:active { transform: scale(.98); }
.emb-btn-auth.flash  { animation: btnFlash .45s ease-out forwards; }
.emb-btn-auth:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.emb-login-help {
  font-family: var(--font-mono); font-size: .62rem;
  letter-spacing: .1em; color: var(--text-muted);
  text-align: center;
}
.emb-login-help a { color: var(--text-dim); text-decoration: underline; transition: color var(--dur-base); }
.emb-login-help a:hover { color: var(--accent); }

/* ── CREDENTIAL CARD ──────────────────────────────── */
#emb-credential {
  position: fixed; inset: 4px; z-index: 200;
  background: var(--bg); display: none;
  align-items: center; justify-content: center; padding: var(--s4);
}
#emb-credential.show { display: flex; animation: fadeIn .4s both; }
#emb-credential.out  { animation: credOut 2.2s forwards; }

.emb-cred-card {
  width: 100%; max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  overflow: hidden; position: relative;
  transform-style: preserve-3d;
  transition: transform .5s var(--ease-out);
  will-change: transform;
  animation: blurFadeUp .6s .1s both;
  cursor: default; user-select: none;
  box-shadow: var(--shadow-xl);
}
.emb-cred-wm {
  position: absolute; right: -8px; top: 28px;
  width: 130px; opacity: .06; pointer-events: none;
  transform: rotate(6deg); filter: var(--logo-filter);
}
.emb-cred-header {
  background: var(--accent); padding: var(--s3) var(--s4);
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-mono); font-size: .6rem;
  letter-spacing: .15em; text-transform: uppercase; color: rgba(0,0,0,.55);
}
.emb-cred-body {
  padding: var(--s5) var(--s4);
  display: flex; flex-direction: column; gap: var(--s4);
  min-height: 170px; justify-content: space-between;
}
.emb-cred-row { display: flex; gap: var(--s4); align-items: flex-start; }
.emb-cred-photo {
  width: 80px; height: 86px; background: var(--bg-card-2);
  flex-shrink: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
}
.emb-cred-photo img { width: 100%; height: 100%; object-fit: cover; }
.emb-cred-init { font-family: var(--font-mono); font-size: 1.3rem; font-weight: 700; color: var(--accent); }
.emb-cred-info { flex: 1; display: flex; flex-direction: column; gap: var(--s3); }
.emb-cred-lbl  { font-family: var(--font-mono); font-size: .56rem; letter-spacing: .15em; text-transform: uppercase; color: var(--text-muted); margin-bottom: .1rem; }
.emb-cred-name { font-family: var(--font); font-size: 1.2rem; color: var(--text); line-height: 1.2; }
.emb-cred-code { font-family: var(--font-display); font-size: 1rem; color: var(--accent); letter-spacing: .3em; }
.emb-cred-badge { display: flex; align-items: center; gap: .4rem; font-family: var(--font); font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; color: var(--success); }
.emb-cred-badge-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--success); flex-shrink: 0; }
.emb-cred-footer {
  background: var(--bg-card-2); padding: var(--s2) var(--s4);
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-mono); font-size: .56rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted);
}

/* ── LOADING SCREEN ───────────────────────────────── */
#emb-load {
  position: fixed; inset: 4px; z-index: 300;
  background: var(--bg); display: none;
  flex-direction: column; align-items: center;
  justify-content: center; gap: var(--s5);
}
.emb-ld-mark { font-family: var(--font-mono); font-size: .9rem; font-weight: 700; letter-spacing: .5em; color: var(--accent); }
.emb-ld-txt  { font-family: var(--font-mono); font-size: .8rem; letter-spacing: .18em; color: var(--accent); opacity: .85; min-height: 1.2em; }
.emb-ld-track {
  width: min(380px, 85vw); height: 6px;
  background: var(--accent-dim);
  border: 1px solid rgba(216,250,46,.2);
  border-radius: 1px;
}
.emb-ld-fill {
  height: 100%; width: 0%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  transition: width .18s linear;
  border-radius: 1px;
}
.emb-ld-pct { font-family: var(--font-mono); font-size: .9rem; font-weight: 700; letter-spacing: .15em; color: var(--accent); }

/* ── PASSWORD CHANGE MODAL (first login) ──────────── */
#emb-pw-modal {
  position: fixed; inset: 4px; z-index: 800;
  background: rgba(0,0,0,.95); backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center; padding: var(--s4);
}
#emb-pw-modal.show { display: flex; animation: fadeIn .3s both; }

.emb-pw-card {
  width: 100%; max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xl);
  padding: var(--s8) var(--s6);
  animation: fadeUp .4s both;
  box-shadow: var(--shadow-xl);
}
.emb-pw-icon {
  width: 48px; height: 48px; margin: 0 auto var(--s5);
  background: var(--accent-dim); border: 1px solid var(--accent-mid);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.emb-pw-title {
  font-family: var(--font-display); font-size: 1.5rem;
  font-weight: 400; color: var(--text);
  text-align: center; margin-bottom: var(--s2);
}
.emb-pw-sub {
  font-size: .875rem; color: var(--text-dim);
  text-align: center; line-height: 1.6; margin-bottom: var(--s6);
}
.emb-pw-form { display: flex; flex-direction: column; gap: var(--s4); }
.emb-pw-hint {
  font-family: var(--font-mono); font-size: .65rem; letter-spacing: .08em;
  color: var(--text-muted); line-height: 1.6;
  background: var(--bg-card-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: var(--s3) var(--s4);
}
.emb-pw-hint strong { color: var(--accent); }
.emb-pw-err {
  font-family: var(--font-mono); font-size: .72rem;
  color: var(--danger); min-height: 1rem; letter-spacing: .04em;
}
.emb-btn-pw-save {
  width: 100%; height: 52px;
  background: var(--accent); color: var(--bg);
  font-size: .875rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  border-radius: var(--r-md);
  transition: filter var(--dur-base), transform var(--dur-fast);
}
.emb-btn-pw-save:hover  { filter: brightness(1.1); }
.emb-btn-pw-save:active { transform: scale(.98); }
.emb-btn-pw-save:disabled { opacity: .5; cursor: not-allowed; }
