/* =========================
   ACCOUNT PAGE
   Depends on core.css button system
   ========================= */

:root {
  --acc-max: 1120px;
  --acc-gutter: clamp(12px, 3vw, 20px);
  --acc-radius: 18px;
  --acc-radius-sm: 12px;

  --acc-brand: #1e40af;
  --acc-text: #0f172a;
  --acc-muted: #475569;
  --acc-bg-soft: #f6f8fc;
  --acc-card: #ffffff;
  --acc-border: rgba(15, 23, 42, 0.1);
  --acc-shadow: 0 10px 22px rgba(2, 6, 23, 0.06);
  --acc-success: #16a34a;
  --acc-danger: #b91c1c;
}

[data-theme="dark"] {
  --acc-text: rgba(255, 255, 255, 0.92);
  --acc-muted: rgba(255, 255, 255, 0.7);
  --acc-bg-soft: rgba(255, 255, 255, 0.03);
  --acc-card: rgba(255, 255, 255, 0.03);
  --acc-border: rgba(255, 255, 255, 0.1);
  --acc-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
}

.acc {
  color: var(--acc-text);
}

.acc .container {
  width: min(var(--acc-max), calc(100% - 2 * var(--acc-gutter)));
  margin-inline: auto;
}

.acc-hero {
  background: var(--acc-bg-soft);
  color: var(--acc-text);
  padding: 52px 0;
}

.acc-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 18px;
  align-items: start;
}

.acc-grid > * {
  min-width: 0;
}

.acc-card {
  min-width: 0;
  max-width: 100%;
  padding: 22px;
  border-radius: var(--acc-radius);
  border: 1px solid var(--acc-border);
  background: var(--acc-card);
  box-shadow: var(--acc-shadow);
}

.acc-card__header {
  margin-bottom: 14px;
}

.acc-title {
  margin: 0 0 10px;
  font-size: clamp(1.5rem, 1.15rem + 1.3vw, 2.25rem);
  line-height: 1.12;
  color: var(--acc-text);
}

.acc-subtitle,
.acc-note,
.acc-msg {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.acc-subtitle {
  margin: 0;
  color: var(--acc-muted);
  line-height: 1.55;
}

.acc-h2 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--acc-text);
}

.acc-h3 {
  font-size: 0.95rem;
  margin: 0 0 10px;
  letter-spacing: 0.2px;
}

.acc-muted {
  color: var(--acc-muted);
  line-height: 1.55;
}

.acc-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 14px;
  padding: 14px;
  border-radius: var(--acc-radius-sm);
  border: 1px solid rgba(37, 99, 235, 0.14);
  background: rgba(37, 99, 235, 0.06);
}

[data-theme="dark"] .acc-kpis {
  background: rgba(96, 165, 250, 0.08);
  border-color: rgba(96, 165, 250, 0.22);
}

.acc-kpi {
  min-width: 0;
}

.acc-kpi__label {
  margin-bottom: 6px;
  color: var(--acc-muted);
  font-size: 12px;
  letter-spacing: 0.2px;
}

.acc-kpi__value {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.75);
  color: var(--acc-text);
  font-weight: 750;
  overflow-wrap: anywhere;
  word-break: break-word;
}

[data-theme="dark"] .acc-kpi__value {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

#acc-noads {
  border-color: rgba(22, 163, 74, 0.22);
  background: rgba(22, 163, 74, 0.08);
  color: var(--acc-success);
}

[data-theme="dark"] #acc-noads {
  background: rgba(22, 163, 74, 0.14);
  border-color: rgba(22, 163, 74, 0.25);
  color: rgba(134, 239, 172, 0.95);
}

#acc-status {
  border-color: rgba(37, 99, 235, 0.18);
  background: rgba(37, 99, 235, 0.08);
  color: var(--acc-brand);
}

[data-theme="dark"] #acc-status {
  background: rgba(96, 165, 250, 0.14);
  border-color: rgba(96, 165, 250, 0.22);
  color: rgba(191, 219, 254, 0.95);
}

.acc-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 10px;
  margin-top: 12px;
}

.acc-actions .btn {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  white-space: normal;
}

button[data-busy="1"] {
  opacity: 0.72;
  cursor: not-allowed;
}

.acc-note {
  margin-top: 14px;
  color: var(--acc-muted);
  line-height: 1.55;
}

.acc-msg {
  margin: 12px 0 0;
  min-height: 20px;
  color: var(--acc-muted);
}

.acc-msg[data-state="error"] {
  color: var(--acc-danger);
}

.acc-form {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.acc-field label {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--acc-muted);
  font-weight: 650;
}

.acc-field input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  color: var(--acc-text);
  font-size: 1rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

[data-theme="dark"] .acc-field input {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
}

.acc-field input:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
  background: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .acc-field input:focus {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.16);
}

.acc-form__msg {
  margin: 0;
  font-size: 0.92rem;
}

.acc-quick {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
}

.acc-quick__item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(2, 6, 23, 0.03);
  color: inherit;
  text-decoration: none;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.acc-quick__item + .acc-quick__item {
  margin-top: 10px;
}

.acc-quick__icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(30, 64, 175, 0.18);
  background: rgba(30, 64, 175, 0.1);
  font-size: 18px;
}

.acc-quick__content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.acc-quick__title {
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.1;
}

.acc-quick__desc {
  font-size: 0.85rem;
  line-height: 1.25;
  opacity: 0.82;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acc-quick__chev {
  margin-left: auto;
  opacity: 0.55;
  font-size: 22px;
  line-height: 1;
  transform: translateY(-1px);
}

.acc-quick__item:hover {
  transform: translateY(-1px);
  border-color: rgba(30, 64, 175, 0.35);
  background: rgba(30, 64, 175, 0.06);
  box-shadow: 0 8px 26px rgba(2, 6, 23, 0.1);
}

.acc-quick__item:active {
  transform: translateY(0);
}

.acc-quick__item:focus-visible {
  outline: 3px solid rgba(30, 64, 175, 0.3);
  outline-offset: 3px;
}

@media (max-width: 980px) {
  .acc-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .acc-hero {
    padding: 34px 0;
  }

  .acc-card {
    padding: 16px;
  }

  .acc-kpis {
    grid-template-columns: 1fr;
  }

  .acc-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 360px) {
  .acc-quick__desc {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}

/* Keep account hero readable when fs-hero-shell/fs-hero-card are auto-injected. */
.acc-hero.fs-hero-shell {
  background: var(--acc-bg-soft);
  color: var(--acc-text);
  padding: 52px 0;
}

.acc-hero.fs-hero-shell .acc-title {
  color: var(--acc-text) !important;
}

.acc-hero.fs-hero-shell .acc-subtitle {
  color: var(--acc-muted) !important;
}

@media (max-width: 640px) {
  .acc-hero.fs-hero-shell {
    padding: 34px 0;
  }
}
