/* Sign-in system pages: auth/device.php (code only), auth/signin.php, recovery.php */

/* ── Device approval code: nothing but the code ─────────────────────────── */
body.auth-code-page {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f4f4;
  color: #222;
  font-family: "Courier New", Consolas, monospace;
}

.auth-code {
  font-size: clamp(40px, 12vw, 120px);
  font-weight: bold;
  letter-spacing: 0.08em;
  user-select: all;
}

.auth-code--wait {
  font-family: sans-serif;
  font-size: 20px;
  font-weight: normal;
  letter-spacing: 0;
}

@media (prefers-color-scheme: dark) {
  body.auth-code-page {
    background: #1b1b1b;
    color: #eee;
  }
}

/* ── Sign-in / recovery card ────────────────────────────────────────────── */
body.auth-page {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 16px 24px;
  box-sizing: border-box;
  background: var(--app-bg);
  color: var(--app-text);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 24px;
  background: var(--section-bg);
  border: 1px solid var(--section-border);
  border-radius: 10px;
  box-shadow: 0 6px 18px var(--shadow-elev-1);
}

.auth-card h1 {
  margin: 0 0 4px;
  font-size: 22px;
  text-align: center;
  color: var(--tabs-button-active-text);
}

.auth-card h2 {
  margin: 18px 0 8px;
  font-size: 17px;
}

.auth-device {
  margin: 0 0 16px;
  text-align: center;
  font-size: 13px;
}

.auth-error {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--bg-red);
  color: var(--color-red);
  font-weight: 600;
}

.auth-ok {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--color-green);
  color: var(--color-green);
}

.auth-signed-in {
  margin: 0 0 10px;
  text-align: center;
}

.auth-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 8px;
}

.auth-inline {
  margin: 0;
}

.auth-or {
  margin: 16px 0 8px;
  text-align: center;
  font-size: 13px;
}

/* Employee choice: big tap targets */
.auth-people {
  margin: 0 0 14px;
  padding: 0;
  border: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.auth-people legend {
  margin-bottom: 8px;
  font-weight: 600;
}

.auth-person {
  position: relative;
  cursor: pointer;
}

.auth-person input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.auth-person > span {
  display: block;
  padding: 14px 8px;
  border: 2px solid var(--section-border);
  border-radius: 8px;
  background: var(--input-bg);
  text-align: center;
  font-size: 17px;
  font-weight: 600;
}

.auth-person .auth-avatar {
  display: flex;
  margin: 0 auto 6px;
  font-size: 24px;
}

.auth-person input:checked + span {
  border-color: var(--button-blue);
  color: var(--color-blue);
  box-shadow: 0 0 0 2px var(--button-blue);
}

.auth-person input:focus-visible + span {
  outline: 2px solid var(--button-blue);
  outline-offset: 2px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

/* .auth-field's display:flex would otherwise beat the shared .hidden class */
.auth-field.hidden {
  display: none;
}

.auth-field label {
  font-weight: 600;
}

.auth-field input {
  font-size: 22px;
  padding: 10px 12px;
  letter-spacing: 0.3em;
  text-align: center;
}

/* PIN boxes are type="text" (for the phone number pad) — show dots, not digits.
   auth/pin-input.js falls back to type="password" where this isn't supported. */
.auth-field input.auth-pin {
  -webkit-text-security: disc;
  text-security: disc;
}

.auth-field input.auth-text {
  letter-spacing: normal;
  text-align: left;
  font-size: 16px;
}

/* The sign-in pages' big buttons: their own size, so the app-wide button height (core.css,
   --button-height, which .btn-blue picks up) must not squeeze them */
.auth-btn {
  display: inline-block;
  height: auto;
  padding: 10px 18px;
  font-size: 16px;
  line-height: 1.2;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
}

.auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px;
  font-size: 18px;
}
