/* ogarniJ — panel logowania (telefon → kod SMS → konto) */

.auth-dialog {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.auth-dialog[open] {
  width: min(26.5rem, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: 0 40px 90px rgba(17, 18, 20, 0.22);
  animation: auth-dialog-in 420ms var(--ease-scene);
}

@keyframes auth-dialog-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
}

.auth-dialog::backdrop {
  background: rgba(17, 18, 20, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: auth-backdrop-in 420ms ease;
}

@keyframes auth-backdrop-in { from { opacity: 0; } }

.auth-view { display: none; }

.auth-view.is-active {
  display: block;
  animation: auth-view-in 380ms var(--ease-scene);
}

@keyframes auth-view-in {
  from { opacity: 0; transform: translateY(10px); }
}

.auth-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(17, 18, 20, 0.05);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background var(--ms-fast) ease, color var(--ms-fast) ease;
}

.auth-close:hover { background: rgba(17, 18, 20, 0.09); color: var(--ink); }

.auth-close svg { width: 16px; height: 16px; }

/* ---------- head ---------- */

.auth-head { margin-bottom: 24px; }

.auth-mark {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 20px;
  place-items: center;
  border-radius: 14px;
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line), 0 6px 16px rgba(17, 18, 20, 0.06);
}

.auth-mark img { width: 26px; height: 26px; object-fit: contain; }

.auth-dialog h2 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.12;
  text-wrap: balance;
}

.auth-lede {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.55;
}

.auth-lede b { font-weight: 600; letter-spacing: -0.01em; }

.auth-demo-note {
  margin: 12px 0 0;
  color: var(--ink-mute);
  font-size: 0.82rem;
  line-height: 1.45;
}

/* ---------- pola ---------- */

.auth-field { display: grid; gap: 8px; }

.auth-field-label {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.auth-phone-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.auth-select,
.auth-input {
  box-sizing: border-box;
  height: 48px;
  min-height: 48px;
  min-width: 0;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  letter-spacing: -0.01em;
  transition: border-color var(--ms-fast) ease, box-shadow var(--ms-fast) ease;
}

.auth-select {
  appearance: none;
  -webkit-appearance: none;
  width: 92px;
  padding: 0 34px 0 14px;
  text-align: left;
  text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='m1 1.5 5 5 5-5' stroke='%237c8088' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  cursor: pointer;
}

.auth-select:focus,
.auth-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(47, 123, 255, 0.13);
}

.auth-input.is-invalid {
  border-color: #d64545;
  box-shadow: 0 0 0 4px rgba(214, 69, 69, 0.12);
}

.auth-actions { margin-top: 20px; }

.auth-actions .pill-button {
  width: 100%;
  min-height: 48px;
}

.auth-error {
  display: none;
  margin: 14px 0 0;
  color: #c93b3b;
  font-size: 0.9rem;
  font-weight: 500;
}

.auth-error.is-visible { display: block; }

.auth-error.is-shake { animation: auth-shake 420ms var(--ease-scene); }

@keyframes auth-shake {
  0%, 100% { transform: translateX(0); }
  22% { transform: translateX(-5px); }
  44% { transform: translateX(4px); }
  66% { transform: translateX(-3px); }
  84% { transform: translateX(2px); }
}

/* ---------- kod OTP ---------- */

.auth-otp {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.auth-otp input {
  width: 48px;
  height: 58px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  color: var(--ink);
  caret-color: var(--blue);
  font: inherit;
  font-size: 1.4rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
  transition: border-color var(--ms-fast) ease, box-shadow var(--ms-fast) ease, background var(--ms-fast) ease;
}

.auth-otp input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(47, 123, 255, 0.13);
}

.auth-otp input.is-filled { border-color: #c9ced8; background: #fafbfc; }

.auth-change {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #c9ced8;
}

.auth-change:hover { color: var(--ink); text-decoration-color: var(--ink-soft); }

.auth-resend {
  margin-top: 18px;
  color: var(--ink-mute);
  font-size: 0.9rem;
  text-align: center;
}

.auth-resend button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
}

.auth-resend button:disabled {
  color: var(--ink-mute);
  cursor: default;
}

/* ---------- success ---------- */

.auth-success {
  display: grid;
  justify-items: center;
  padding: 18px 0 6px;
  text-align: center;
}

.auth-check {
  width: 72px;
  height: 72px;
  margin-bottom: 22px;
}

.auth-check circle {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 214;
  stroke-dashoffset: 214;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  animation: auth-ring 700ms var(--ease-scene) forwards;
}

.auth-check path {
  fill: none;
  stroke: var(--blue);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 42;
  stroke-dashoffset: 42;
  animation: auth-ring 480ms var(--ease-scene) 480ms forwards;
}

@keyframes auth-ring { to { stroke-dashoffset: 0; } }

/* ---------- panel konta ---------- */

.auth-account-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.auth-account-head .auth-mark { margin: 0; }

.auth-account-head h2 { font-size: 1.45rem; }

.auth-account-sub {
  margin: 4px 0 0;
  color: var(--ink-mute);
  font-size: 0.9rem;
}

.auth-plan-chip {
  display: inline-flex;
  margin-top: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(47, 123, 255, 0.09);
  color: var(--blue-dark);
  font-size: 0.8rem;
  font-weight: 600;
}

.auth-section { margin-top: 26px; }

.auth-section-label {
  margin: 0 0 12px;
  color: var(--ink-mute);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-usage-track {
  height: 8px;
  border-radius: 999px;
  background: #eef0f4;
  overflow: hidden;
}

.auth-usage-fill {
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5f9bff, var(--blue));
}

.auth-usage-note {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.auth-usage-note b { font-weight: 600; }

.auth-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.auth-stat {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fafbfc;
}

.auth-stat b {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.auth-stat small {
  display: block;
  margin-top: 3px;
  color: var(--ink-mute);
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.35;
}

.auth-details { border-top: 1px solid var(--line); }

.auth-details > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.auth-details dt {
  color: var(--ink-mute);
  font-size: 0.9rem;
  font-weight: 500;
}

.auth-details dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-align: right;
}

.auth-logout {
  margin-top: 24px;
}

.auth-logout .pill-button { width: 100%; }

@media (max-width: 400px) {
  .auth-dialog[open] { padding: 26px 20px; }

  .auth-close { top: 14px; right: 14px; }

  .auth-otp { gap: 8px; }

  .auth-otp input { width: 42px; height: 54px; }
}

@media (max-width: 359px) {
  .auth-otp { gap: 7px; }

  .auth-otp input { width: 40px; height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-dialog[open],
  .auth-view.is-active,
  .auth-check circle,
  .auth-check path { animation: none; }

  .auth-check circle,
  .auth-check path { stroke-dashoffset: 0; }

  .auth-error.is-shake { animation: none; }
}

/* ================================================================
   Moje Ogarnij — pełnoekranowy panel konta
   ================================================================ */

.account {
  position: fixed;
  inset: 0;
  z-index: 300;
  overflow-y: auto;
  background: var(--white);
  opacity: 0;
  transform: translateY(14px) scale(0.99);
  transition: opacity 320ms var(--ease-scene), transform 320ms var(--ease-scene);
}

.account.is-open {
  opacity: 1;
  transform: none;
}

.account-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--line);
}

.account-nav-inner {
  display: flex;
  width: min(1180px, calc(100% - (2 * var(--space-page))));
  height: 100%;
  align-items: center;
  gap: 32px;
  margin: 0 auto;
}

.account-tabs {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 20px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 20px), transparent 100%);
}

.account-tabs::-webkit-scrollbar { display: none; }

.account-tabs button {
  min-height: 38px;
  flex: 0 0 auto;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: background var(--ms-fast) ease, color var(--ms-fast) ease;
}

.account-tabs button:hover { background: #f2f4f7; color: var(--ink); }

.account-tabs button[aria-current="true"] {
  background: #f2f4f7;
  color: var(--ink);
  font-weight: 600;
}

.account-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #f2f4f7;
}

.account-avatar img { width: 20px; height: 20px; object-fit: contain; }

.account-main {
  width: min(820px, calc(100% - (2 * var(--space-page))));
  margin: 0 auto;
  padding: clamp(56px, 9vw, 112px) 0 calc(var(--section-pad) + 24px);
}

.account-view { animation: account-view-in 380ms var(--ease-scene); }

@keyframes account-view-in {
  from { opacity: 0; transform: translateY(10px); }
}

.account-hello {
  margin: 0;
  font-size: clamp(2.6rem, 5.4vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1.02;
}

.account-hello-sub {
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 1.12rem;
  letter-spacing: -0.012em;
}

.account-hello-sub b { font-weight: 600; color: var(--ink); }

.account-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(32px, 5vw, 56px) clamp(24px, 4vw, 48px);
  margin: clamp(56px, 8vw, 96px) 0 0;
}

.account-facts dt {
  color: var(--ink-mute);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.account-facts dd {
  margin: 10px 0 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}

.account-bar {
  position: relative;
  height: 6px;
  margin-top: 14px;
  border-radius: 999px;
  background: #eef0f4;
  overflow: hidden;
}

.account-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #5f9bff, var(--blue));
}

.account-title {
  margin: 0;
  font-size: clamp(2.2rem, 4.4vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.04;
}

.account-subtitle {
  margin: 48px 0 0;
  color: var(--ink-mute);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* --- plan: lista jak ustawienia --- */

.account-plans {
  display: grid;
  margin-top: 40px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--white);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.account-plan + .account-plan { border-top: 1px solid var(--line); }

.account-plan.is-current { background: #fbfdff; }

.account-plan-row {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--ms-fast) ease;
}

.account-plan-row:hover { background: #f7f8fa; }

.account-plan-row b {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.account-plan-chip {
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(47, 123, 255, 0.09);
  color: var(--blue-dark);
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
}

.account-plan-price {
  margin-left: auto;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.account-plan-price small {
  color: var(--ink-mute);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0;
}

.account-plan-caret {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--ink-mute);
  transition: transform var(--ms-standard) var(--ease-scene);
}

.account-plan-row[aria-expanded="true"] .account-plan-caret {
  transform: rotate(180deg);
}

.account-plan-details {
  padding: 2px 24px 24px;
}

.account-plan-details ul {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.account-plan-details li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 0.94rem;
}

.account-plan-details li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
}

.account-plan-note {
  margin: 0;
  color: var(--ink-mute);
  font-size: 0.9rem;
}

.account-plan-details .pill-button {
  min-height: 42px;
  padding: 0 18px;
  font-size: 0.9rem;
}

/* --- płatności --- */

.account-billing-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-top: 40px;
}

.account-billing-head small,
.account-method small {
  display: block;
  color: var(--ink-mute);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.account-billing-head b,
.account-method b {
  display: block;
  margin-top: 8px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}

.account-billing-amount { text-align: right; }

.account-method {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 36px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
}

.account-method > div { flex: 1 1 auto; }

.account-method .text-link { font-size: 0.92rem; }

.account-method-card {
  position: relative;
  display: grid;
  width: 46px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  gap: 4px;
  border-radius: 8px;
  background: var(--ink);
}

.account-method-card i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f7b96d;
}

.account-method-card i:first-child { background: #eb5757; margin-right: -6px; }

.account-method-card i + i { background: #f7b96d; }

.account-history {
  display: grid;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.account-history li {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.account-history li span:first-child {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.account-history li span:nth-child(2) { flex: 1 1 auto; }

.account-history b {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.account-note {
  margin: 20px 0 0;
  color: var(--ink-mute);
  font-size: 0.88rem;
}

/* --- wykorzystanie --- */

.account-usage-big {
  margin: 48px 0 0;
  font-size: clamp(4.6rem, 10vw, 7rem);
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.account-usage-label {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 1.02rem;
}

.account-usage-track {
  height: 8px;
  margin-top: 28px;
  border-radius: 999px;
  background: #eef0f4;
  overflow: hidden;
}

.account-usage-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5f9bff, var(--blue));
}

.account-usage-rows {
  display: grid;
  margin: 40px 0 0;
}

.account-usage-rows > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.account-usage-rows dt {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.account-usage-rows dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* --- konto --- */

.account-details {
  display: grid;
  margin: 40px 0 0;
}

.account-details > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.account-details dt {
  color: var(--ink-mute);
  font-size: 0.9rem;
  font-weight: 500;
}

.account-details dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-align: right;
}

.account-details a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #c9ced8;
  transition: text-decoration-color var(--ms-fast) ease;
}

.account-details a:hover { text-decoration-color: var(--ink); }

[data-account-view="konto"] .pill-button {
  margin-top: 36px;
}

/* --- toast --- */

.account-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  z-index: 20;
  padding: 13px 22px;
  transform: translate(-50%, 16px);
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-size: 0.92rem;
  font-weight: 500;
  box-shadow: 0 18px 40px rgba(17, 18, 20, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms var(--ease-scene), transform 280ms var(--ease-scene);
}

.account-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* --- account responsive --- */

@media (max-width: 760px) {
  .account-nav-inner { gap: 12px; }

  .account-tabs { justify-content: flex-start; }

  .account-tabs button { padding: 0 12px; font-size: 0.88rem; }

  .account-facts { grid-template-columns: repeat(2, 1fr); }

  .account-billing-amount { text-align: left; }

  .account-method { flex-wrap: wrap; }

  .account-method .text-link { margin-left: 62px; }
}

@media (max-width: 420px) {
  .account-facts { grid-template-columns: 1fr; gap: 28px; }
}
