/* ── Role buttons ── */
.role-list { width: 100%; display: flex; flex-direction: column; gap: 7px; margin-bottom: 24px; }

.role-btn {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow);
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.role-btn.active {
  border-color: var(--gold);
  background: var(--gold-pale);
}
.role-icon { font-size: 17px; }
.role-name { font-size: 14px; font-weight: 500; color: var(--text); }
.role-btn.active .role-name { color: var(--oak); font-weight: 600; }

/* ── Field label ── */
.field-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  align-self: flex-start;
  margin-bottom: 8px;
}

/* ── PIN dots ── */
.pin-row {
  display: flex; gap: 10px;
  margin-bottom: 18px;
  transition: transform 0.08s;
}
.pin-row.shake { animation: shake 0.4s; }
.pin-dot {
  width: 13px; height: 13px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  transition: background 0.1s, border-color 0.1s;
}
.pin-dot.filled { background: var(--gold); border-color: var(--gold); }
.pin-row.error .pin-dot { border-color: var(--red); }
.pin-row.error .pin-dot.filled { background: var(--red); }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  40%      { transform: translateX(7px); }
  60%      { transform: translateX(-5px); }
  80%      { transform: translateX(3px); }
}

/* ── Keypad ── */
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  width: 100%;
}
.key {
  aspect-ratio: 1.6;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.08s, background 0.1s;
  user-select: none;
}
.key:active { transform: scale(0.96); background: var(--surface-warm); }
.key.del { background: var(--surface-warm); font-size: 14px; color: var(--muted); }
.key.go {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
  font-size: 16px;
}
.key.go:disabled,
.key[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

/* ── Buttons (general) ── */
.btn {
  display: inline-flex;
  align-items: center; justify-content: center;
  gap: 7px;
  padding: 12px 18px;
  border: none;
  border-radius: 13px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.btn-primary {
  background: var(--gold);
  color: #fff;
  box-shadow: 0 4px 16px rgba(201,168,76,0.35);
}
.btn-ghost {
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-weight: 600;
  font-family: var(--font-body);
}

/* ── Bottom navigation ── */
.bottom-nav {
  margin-top: auto;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 8px 4px calc(12px + var(--safe-bottom));
  display: flex;
  justify-content: space-around;
  position: sticky;
  bottom: 0;
  z-index: 10;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px 6px;
  background: none;
  border: none;
  flex: 1;
  position: relative;
}
.nav-icon { font-size: 17px; }
.nav-lbl {
  font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted);
}
.nav-item.active .nav-lbl { color: var(--gold); }
.nav-badge {
  position: absolute;
  top: 0; right: 18%;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 14px;
  height: 14px;
  padding: 0 4px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
}

/* ── App bar (inner screens) ── */
.app-bar {
  background: var(--oak);
  padding: calc(14px + var(--safe-top)) 18px 16px;
}
.app-bar-row {
  display: flex; align-items: center; justify-content: space-between;
}
.app-bar-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  color: var(--gold);
  display: flex; align-items: center; gap: 7px;
}
.app-bar-title .icon { font-size: 16px; }
.app-bar-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  margin-top: 5px;
}
.app-bar-sub strong { color: rgba(255,255,255,0.9); font-weight: 500; }
.app-bar-action {
  background: none; border: none;
  color: var(--gold);
  font-size: 22px;
}

/* ── Loading shim ── */
.loading {
  display: flex;
  align-items: center; justify-content: center;
  flex: 1;
  color: var(--muted);
  font-size: 13px;
}
.spinner {
  width: 22px; height: 22px;
  border: 2.5px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }
