/* ==========================================================================
   The account's state in the app (js/components/access-banner.js; redesign
   v12 "Stany w górnym pasku" and "koniec sesji"): a quiet pill in the top
   bar, windows that open over the app, screens that cover the page.
   Flat: the page's own surfaces and colours, no shadow of its own beyond
   the window's edge.
   ========================================================================== */

/* ---- The pill ---- */
.access-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 14px;
  max-width: 360px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--tile);
  color: var(--text-2);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-standard);
}

.access-pill[hidden] {
  display: none;
}

.access-pill:hover {
  background: var(--color-surface-hover);
}

.access-pill.is-static {
  cursor: default;
}

.access-pill:focus-visible {
  outline: 2px solid var(--lead);
  outline-offset: 2px;
}

.access-pill__dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-3);
}

.access-pill[data-tone="warn"] .access-pill__dot { background: var(--warn); }
.access-pill[data-tone="loss"] .access-pill__dot { background: var(--loss); }

.access-pill__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.access-pill__short {
  display: none;
}

.access-pill__action {
  flex: none;
  color: var(--text-1);
  font-weight: 500;
}

/* The top menu is tight below 1380px, and a phone's bar is tighter still: the short wording, the whole sentence in the tooltip. */
@media (max-width: 1380px) {
  .topnav__tools .access-pill__full { display: none; }
  .topnav__tools .access-pill__short { display: inline; }
}

@media (max-width: 880px) {
  .topbar__actions .access-pill { height: 28px; padding: 0 12px; }
  .topbar__actions .access-pill__full { display: none; }
  .topbar__actions .access-pill__short { display: inline; }
}

@media (max-width: 420px) {
  .topbar__actions .access-pill__action { display: none; }
}

/* ---- Windows and screens ---- */
.acc-screen {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--text-1);
  font-family: var(--font-family);
  overflow-y: auto;
}

.acc-screen--cover {
  background: var(--page);
}

.acc-screen__window {
  width: 100%;
  max-width: 420px;
  margin: auto;
  padding: 26px 22px 20px;
  border-radius: var(--r-window);
  background: var(--desk);
  box-shadow: 0 0 0 1px var(--line), 0 40px 80px -20px rgba(0, 0, 0, 0.7);
  outline: none;
}

.acc-screen--cover .acc-screen__window {
  box-shadow: none;
}

.acc-screen--offlineGate .acc-screen__window,
.acc-screen--storage .acc-screen__window,
.acc-screen--newer .acc-screen__window {
  text-align: center;
}

.acc-screen__title {
  margin: 0;
  font-family: var(--font-family-display);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-1);
}

.acc-screen__text {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-2);
}

.acc-screen__body {
  margin-top: 16px;
}

.acc-screen__body:empty {
  display: none;
}

.acc-screen__form {
  display: grid;
  gap: 12px;
}

.acc-screen__form .field[hidden] {
  display: none;
}

.acc-screen__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0;
  font-size: 14px;
}

.acc-screen__links a {
  color: var(--text-1);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.acc-screen__fine {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-3);
}

.acc-screen__without {
  margin-top: 12px;
}

.acc-screen__error {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--loss);
}

.acc-screen__error[hidden] {
  display: none;
}

.acc-screen__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}

.acc-screen__btn {
  width: 100%;
  min-height: 44px;
  justify-content: center;
}

.acc-screen__link {
  padding: 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}

.acc-screen__link:hover {
  color: var(--text-1);
}

/* A quiet action that is a button (it does something here, it opens no page): the link's look. */
button.acc-screen__link {
  width: 100%;
  min-height: 44px;
  border: 0;
  background: none;
  font-family: inherit;
  cursor: pointer;
}

button.acc-screen__link:disabled {
  opacity: 0.5;
  cursor: default;
}

button.acc-screen__link:focus-visible {
  outline: 2px solid var(--text-2);
  outline-offset: -2px;
  border-radius: var(--r-window);
}

/* A quiet action that opens a page ("Claim your month", "Use the sign-in page"): it reads as a link - underlined, in the
   text colour - and is a full 44 px target for a finger (audit 2026-10-20, C-03). */
a.acc-screen__link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  color: var(--text-1);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a.acc-screen__link:focus-visible {
  outline: 2px solid var(--text-2);
  outline-offset: -2px;
  border-radius: var(--r-window);
}

@media (min-width: 560px) {
  .acc-screen__actions .acc-screen__btn + .acc-screen__btn {
    margin-top: 0;
  }
}

/* ---- The Account section of Settings: dialogs and the one-time lists ---- */
.acct-dialog {
  display: grid;
  gap: 14px;
}

.acct-dialog .field[hidden],
.acct-dialog [hidden] {
  display: none;
}

.acct-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-2);
}

.acct-note--warn {
  color: var(--text-1);
}

.acct-error {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--loss);
}

.acct-error[hidden] {
  display: none;
}

.acct-qr {
  justify-self: center;
  width: min(220px, 100%);
  padding: 8px;
  border-radius: var(--radius-md);
  background: #ffffff;
}

.acct-qr .qr {
  display: block;
  width: 100%;
  height: auto;
}

.acct-secret {
  font-family: var(--font-family-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  word-break: break-all;
  user-select: all;
  color: var(--text-1);
}

/* Two-step sign-in set up on the phone itself (audit 2026-10-20, A1-05): open the authenticator app, or copy the code. */
.acct-otp-ways {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.acct-otp-ways .btn {
  min-height: 44px;
}

.acct-codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 14px;
  margin: 0;
  padding: 14px;
  list-style: none;
  border-radius: var(--radius-md);
  background: var(--tile);
  font-family: var(--font-family-mono);
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--text-1);
  user-select: all;
}

.acct-list {
  margin: 0;
  padding: 0 0 0 1.2em;
  list-style: disc;
  display: grid;
  gap: 4px;
  font-size: 14px;
  color: var(--text-1);
}

.acct-progress {
  height: 6px;
  border-radius: 3px;
  background: var(--tile);
  overflow: hidden;
}

.acct-progress > i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--lead);
  transition: width var(--dur-base) var(--ease-standard);
}

/* The space on the server (stage J): its own block of rows above Your data's actions. */
.acct-storage {
  margin-bottom: 12px;
}

/* Signed-in devices (stage J): settings rows inside the dialog; a phone's Sign out keeps the 44 px touch target. */
.acct-devices .acct-device .btn {
  white-space: nowrap;
}

@media (max-width: 480px) {
  .acct-devices .acct-device .btn {
    min-height: 44px;
  }

  .modal__footer--wrap {
    flex-wrap: wrap;
  }

  .modal__footer--wrap > .btn {
    flex: 1 1 auto;
  }
}

.acct-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-2);
}

.acct-check input {
  flex: none;
  margin-top: 3px;
}

.acct-days {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.acct-dialog [data-acct-preview],
.acct-dialog [data-acct-plan],
.acct-dialog [data-acct-days],
.acct-dialog [data-acct-run] {
  display: grid;
  gap: 10px;
}

.acct-dialog [data-acct-run][hidden] {
  display: none;
}
