﻿/* Strony poza powłoką aplikacji z kartą na środku: konto (logowanie, hasło, zakładanie firmy, oczekiwanie,
   brak dostępu, aktywacja, zawieszenie) i strona błędu. Wygląd Prototypu A. Jedyne źródło tych reguł — strony
   ładują ten plik przez wspólną głowę Pages/Shared/_AuthHead.cshtml i nie mają własnych bloków <style>.

   Dwa układy karty:
     .auth-card             — formularz (logo z lewej, pola, przycisk na całą szerokość);
     .auth-card--message    — komunikat (wszystko wyśrodkowane, ikona nad tytułem, szersza karta). */

body {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: var(--ds-bg); font-size: 14.5px; line-height: 1.45;
}

/* ── Karta ─────────────────────────────────────────────────── */
.auth-card {
  background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: 12px;
  padding: 36px; width: 100%; max-width: 380px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 12px 32px rgba(0,0,0,.06);
}
.auth-card-wide { max-width: 460px; }
.auth-card--message { max-width: 420px; text-align: center; }

.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.auth-card--message .auth-logo { justify-content: center; margin-bottom: 32px; }
.auth-logo-icon { width: 30px; height: 30px; display: block; }
.auth-logo-name { font-weight: 700; font-size: 17.5px; color: var(--ds-ink); }

/* Ikona komunikatu nad tytułem (✅, 🔒, ⏳). */
.auth-icon { font-size: 44px; margin-bottom: 16px; }

.auth-title { font-size: 21px; font-weight: 600; letter-spacing: -.01em; color: var(--ds-ink); margin-bottom: 4px; }
.auth-card--message .auth-title { margin-bottom: 10px; }

.auth-sub { font-size: 14px; color: var(--ds-muted); margin-bottom: 24px; }
.auth-card--message .auth-sub { line-height: 1.6; margin-bottom: 28px; }
.auth-sub--flush { margin-bottom: 0; }

/* ── Pola i przyciski ──────────────────────────────────────── */
.auth-field { margin-bottom: 14px; }
.auth-field label { display: block; font-size: 13px; font-weight: 500; color: var(--ds-ink2); margin-bottom: 5px; }
.auth-field input {
  width: 100%; box-sizing: border-box;
}
.auth-field input, .auth-field select {
  min-height: 36px; padding: 0 10px; font-size: 14.5px; border: 1px solid var(--ds-control-line);
  border-radius: 6px; background: var(--ds-surface); color: var(--ds-ink);
}
.auth-field input:focus, .auth-field select:focus { border-color: var(--ds-todo); box-shadow: 0 0 0 3px var(--ds-todo-bg2); outline: none; }
/* Dopisek przy etykiecie pola, np. wymagania hasła. */
.auth-label-note { color: var(--ds-muted); font-weight: 400; }
.auth-hint { font-size: 12.5px; color: var(--ds-muted); margin-top: 4px; }
.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.auth-check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ds-ink2); margin: 6px 0 14px; line-height: 1.45; }
.auth-check input { margin-top: 3px; }
.auth-check a, .auth-info a { color: var(--ds-accent); }

.auth-btn-primary {
  width: 100%; min-height: 40px; padding: 9px; margin-top: 4px;
  background: var(--ds-ink); color: var(--ds-surface); border: none; border-radius: 6px;
  font-size: 14.5px; font-weight: 500; cursor: pointer;
}
.auth-btn-primary:hover { background: var(--ds-ink2); }

.auth-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0; color: var(--ds-muted); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--ds-line); }

.auth-btn-google {
  width: 100%; min-height: 40px; padding: 9px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--ds-surface); border: 1px solid var(--ds-control-line); border-radius: 6px;
  font-size: 14.5px; font-weight: 500; color: var(--ds-ink); cursor: pointer;
}
.auth-btn-google:hover { background: var(--ds-hover); }

/* Kafelek One Tap Google rysuje się w prawym górnym rogu okna, nad wszystkim innym. !important celowo (CSS-13):
   kontener wstawia i stylizuje skrypt Google (styl w atrybucie elementu), a z takim stylem wygrywa tylko !important. */
#credential_picker_container, #credential_picker_iframe { z-index: 2000 !important; }

/* ── Komunikaty ────────────────────────────────────────────── */
.auth-error {
  background: var(--ds-late-bg); border: 1px solid var(--ds-late); border-radius: 8px;
  padding: 10px 12px; font-size: 13.5px; color: var(--ds-late); margin-bottom: 14px;
}
.auth-error ul { margin: 4px 0 0 16px; padding: 0; }
.auth-success {
  background: var(--ds-done-bg2); border: 1px solid var(--ds-done-line2); border-radius: 6px;
  padding: 10px 12px; font-size: 14px; color: var(--ds-done-ink2); margin-bottom: 14px;
}
/* Sukces, który zastępuje cały formularz (hasło ustawione). */
.auth-success--final { padding: 14px; font-size: 14.5px; text-align: center; }
.auth-info { background: var(--ds-bg); border: 1px solid var(--ds-line); border-radius: 6px; padding: 10px 12px; font-size: 13px; color: var(--ds-muted); margin-bottom: 20px; }
/* Numer zgłoszenia na stronie błędu — po nim błąd da się znaleźć w telemetrii. */
.auth-ref { font-size: 12px; color: var(--ds-muted); margin-bottom: 24px; word-break: break-all; }

/* Dane konta czekającego na zatwierdzenie (Aktywacja). */
.auth-account { text-align: left; font-size: 14px; color: var(--ds-ink); border: 1px solid var(--ds-line); border-radius: 8px; padding: 12px 16px; margin-bottom: 24px; }
.auth-account div + div { margin-top: 6px; }
.auth-account span { color: var(--ds-muted); display: inline-block; width: 110px; }

/* ── Weryfikacja dwuetapowa (LoginTwoFactor, LoginTwoFactorSetup) ── */
/* Jedno duże pole na 6 cyfr — czytelne na telefonie, odstęp między cyframi jak w aplikacji. */
.auth-otp {
  display: block; width: 100%; box-sizing: border-box; min-height: 52px; margin-bottom: 12px; padding: 0 12px;
  font: 600 26px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .35em; text-align: center;
  border: 1px solid var(--ds-control-line); border-radius: 8px; background: var(--ds-surface); color: var(--ds-ink);
}
.auth-otp::placeholder { color: var(--ds-line); }
.auth-otp:focus { border-color: var(--ds-todo); box-shadow: 0 0 0 3px var(--ds-todo-bg2); outline: none; }
.auth-btn-primary:disabled { opacity: .6; cursor: default; }
.auth-footer-note { font-size: 13px; line-height: 1.5; }

/* Trzy kroki konfiguracji: numer w kółku, treść obok. */
.auth-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.auth-step { display: flex; gap: 12px; align-items: flex-start; }
.auth-step-no {
  flex: 0 0 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--ds-todo-bg2); color: var(--ds-todo); font-size: 13px; font-weight: 600;
}
.auth-step-body { flex: 1; min-width: 0; }
.auth-step-title { font-weight: 600; color: var(--ds-ink); margin: 3px 0 4px; }
.auth-step-body form { margin-top: 8px; }
.auth-qr { display: block; margin: 8px 0 4px; border: 1px solid var(--ds-line); border-radius: 8px; padding: 6px; background: var(--ds-surface); }
.auth-key { margin-top: 6px; font-size: 13px; color: var(--ds-muted); }
.auth-key summary { cursor: pointer; color: var(--ds-todo); }
.auth-key-value {
  display: block; margin: 8px 0 4px; padding: 8px 10px; border-radius: 6px; background: var(--ds-bg); border: 1px solid var(--ds-line);
  font-size: 14px; letter-spacing: .04em; color: var(--ds-ink); word-break: break-all; user-select: all;
}
.auth-btn-secondary {
  display: none; margin: 8px 0 4px; padding: 9px; min-height: 40px; box-sizing: border-box; width: 100%; text-align: center;
  border: 1px solid var(--ds-control-line); border-radius: 6px; background: var(--ds-surface); color: var(--ds-ink);
  font-weight: 500; text-decoration: none;
}
/* Na telefonie kodu QR z własnego ekranu nie zeskanujesz — pierwszy jest przycisk otwierający aplikację. */
@media (pointer: coarse) {
  .auth-btn-secondary.auth-otp-open { display: block; }
}

/* ── Stopka karty ──────────────────────────────────────────── */
.auth-footer { text-align: center; margin-top: 20px; font-size: 14px; color: var(--ds-muted); }
.auth-footer--near { margin-top: 8px; }
.auth-card--message .auth-footer { margin-top: 0; }
.auth-footer a { color: var(--ds-todo); text-decoration: none; }
/* Wylogowanie to formularz POST (antyforgery), wyglądający jak link w stopce. */
.auth-inline-form { display: inline; margin: 0; }
.auth-link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--ds-todo); cursor: pointer; }

/* Stopka z przyciskami zamiast linków (Aktywacja: „Zatwierdź konto”, „Przejdź do aplikacji”). */
.auth-footer--actions a, .auth-footer--actions button {
  display: inline-block; padding: 9px 20px; background: var(--ds-ink); color: var(--ds-surface); border: 0; border-radius: 6px;
  text-decoration: none; font-size: 15px; font-weight: 500; cursor: pointer; font-family: inherit;
}
.auth-footer--actions a.secondary { background: transparent; color: var(--ds-ink); border: 1px solid var(--ds-line); margin-left: 8px; }

@media (max-width: 480px) {
  body { align-items: flex-start; padding: 24px 16px; }
  .auth-card { padding: 24px 18px; box-shadow: none; }
}
