/* ============================================
   ARSES User Command Center
   Premium marketplace account dashboard
   ============================================ */

.account-page {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 90% 50% at 50% -20%, rgba(31, 122, 92, 0.1), transparent),
    var(--cream, #f6f7f5);
}

.account-main {
  padding: 24px 16px 64px;
}

.account-container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

.account-anchor {
  display: block;
  height: 0;
  scroll-margin-top: calc(var(--header-height, 72px) + 16px);
}

/* ---- Notice banner ---- */

.account-notice {
  margin-bottom: 20px;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  border: 1px solid transparent;
}

.account-notice[hidden] {
  display: none;
}

.account-notice--info {
  background: var(--mint, #e8f5ef);
  border-color: #b9e3cf;
  color: var(--green-dark, #165a44);
}

.account-notice--warning {
  background: #fff8e6;
  border-color: #f0d78c;
  color: #7a5b00;
}

/* ---- Hero ---- */

.account-hero {
  margin-bottom: 36px;
  padding: 28px 28px 32px;
  background: var(--card, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 20px;
  box-shadow: var(--shadow-lg, 0 12px 40px rgba(17, 17, 17, 0.08));
}

.account-hero--loading .account-hero__title,
.account-hero--loading .account-hero__username,
.account-hero--loading .account-hero__message {
  color: transparent;
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: account-shimmer 1.2s ease-in-out infinite;
  border-radius: 6px;
}

@keyframes account-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.account-hero__inner {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.account-hero__avatar {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--mint, #e8f5ef);
  color: var(--green-dark, #165a44);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  overflow: hidden;
}

.account-hero__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-hero__content {
  flex: 1;
  min-width: 0;
}

.account-hero__eyebrow {
  margin-bottom: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green, #1f7a5c);
}

.account-hero__title {
  margin-bottom: 4px;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text, #111);
}

.account-hero__username {
  margin-bottom: 12px;
  font-size: 0.9375rem;
  color: var(--muted, #6b7280);
}

.account-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.account-hero__badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 100px;
  background: var(--mint, #e8f5ef);
  color: var(--green-dark, #165a44);
}

.account-hero__badge--seller {
  background: #eef8f3;
  color: #165a44;
}

.account-hero__badge--admin {
  background: rgba(59, 91, 219, 0.12);
  color: #2b4acb;
}

.account-hero__badge--pending {
  background: #fff8e6;
  color: #7a5b00;
}

.account-hero__message {
  max-width: 42rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--muted, #6b7280);
}

/* ---- Sections ---- */

.account-section {
  margin-bottom: 36px;
}

.account-section--muted {
  opacity: 0.92;
}

.account-section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.account-section__title {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text, #111);
}

.account-section__hint {
  font-size: 0.8125rem;
  color: var(--muted, #6b7280);
}

/* ---- Card grid ---- */

.account-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.account-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.account-section[hidden] {
  display: none;
}

/* ---- Cards ---- */

.account-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 148px;
  padding: 20px;
  background: var(--card, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 16px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(17, 17, 17, 0.06));
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

a.account-card:hover {
  border-color: rgba(31, 122, 92, 0.35);
  box-shadow: 0 8px 24px rgba(31, 122, 92, 0.1);
  transform: translateY(-2px);
}

a.account-card:focus-visible {
  outline: 2px solid var(--green, #1f7a5c);
  outline-offset: 2px;
}

.account-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--mint, #e8f5ef);
  color: var(--green, #1f7a5c);
}

.account-card__title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text, #111);
}

.account-card__desc {
  flex: 1;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted, #6b7280);
}

.account-card__action {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--green, #1f7a5c);
}

a.account-card:hover .account-card__action {
  color: var(--green-dark, #165a44);
}

/* Placeholder / disabled cards */

.account-card--placeholder {
  cursor: default;
  background: #fafbfa;
  border-style: dashed;
}

.account-card--placeholder .account-card__icon {
  background: #f3f4f6;
  color: #9ca3af;
}

.account-card--placeholder .account-card__action {
  color: var(--muted, #6b7280);
}

/* ---- Selling panel ---- */

.account-selling {
  padding: 24px;
  background: linear-gradient(135deg, #f8fcfa 0%, #fff 55%, #f6f7f5 100%);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 18px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(17, 17, 17, 0.06));
}

.account-selling--pending {
  background: linear-gradient(135deg, #fffdf5 0%, #fff 55%, #f6f7f5 100%);
  border-color: #f0d78c;
}

.account-selling--approved {
  background: linear-gradient(135deg, #f0faf5 0%, #fff 55%, #f6f7f5 100%);
  border-color: #b9e3cf;
}

.account-selling__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.account-selling__content {
  flex: 1;
  min-width: 220px;
}

.account-selling__eyebrow {
  margin-bottom: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green, #1f7a5c);
}

.account-selling--pending .account-selling__eyebrow {
  color: #9a7b00;
}

.account-selling__title {
  margin-bottom: 8px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text, #111);
}

.account-selling__desc {
  max-width: 36rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--muted, #6b7280);
}

.account-selling__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.account-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 12px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.account-btn--primary {
  color: #fff;
  background: var(--green, #1f7a5c);
}

.account-btn--primary:hover {
  background: var(--green-dark, #165a44);
}

.account-btn--ghost {
  color: var(--green-dark, #165a44);
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
}

.account-btn--ghost:hover {
  background: var(--mint, #e8f5ef);
  border-color: rgba(31, 122, 92, 0.3);
}

.account-btn--pending {
  color: #7a5b00;
  background: #fff8e6;
  border: 1px solid #f0d78c;
  cursor: default;
}

.account-btn:disabled,
.account-btn[aria-disabled="true"] {
  opacity: 0.7;
  cursor: not-allowed;
}

.account-selling--rejected {
  background: linear-gradient(135deg, #fff8f5 0%, #fff 55%, #f6f7f5 100%);
  border-color: #f0c2b0;
}

.account-selling--suspended,
.account-selling--error {
  background: linear-gradient(135deg, #fff8f5 0%, #fff 55%, #f6f7f5 100%);
  border-color: #f0c2b0;
}

.account-selling--loading .account-selling__skeleton {
  margin-top: 14px;
  height: 10px;
  max-width: 220px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: account-shimmer 1.2s ease-in-out infinite;
}

.account-selling__inner--stack {
  flex-direction: column;
  align-items: stretch;
}

.account-selling__live:empty {
  display: none;
}

.account-selling__live {
  margin-top: 12px;
  font-size: 0.8125rem;
  color: var(--muted, #6b7280);
}

.account-selling__rejection {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #f0c2b0;
  background: #fff;
}

.account-selling__rejection-label {
  margin-bottom: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9a4b2e;
}

.account-selling__rejection-text {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text, #111);
  white-space: pre-wrap;
}

.account-seller-form {
  width: 100%;
  margin-top: 4px;
}

.account-seller-form__banner {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #f0c2b0;
  background: #fff5f2;
  color: #7a2e1a;
  font-size: 0.875rem;
  line-height: 1.5;
}

.account-seller-form__banner[hidden] {
  display: none;
}

.account-seller-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.account-seller-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.account-seller-form__field[data-seller-field="description"],
.account-seller-form__field[data-seller-field="return_policy"],
.account-seller-form__field[data-seller-field="shipping_policy"] {
  grid-column: 1 / -1;
}

.account-seller-form__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text, #111);
}

.account-seller-form__required {
  color: #9a4b2e;
}

.account-seller-form__optional {
  font-weight: 500;
  color: var(--muted, #6b7280);
}

.account-seller-form__hint {
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--muted, #6b7280);
}

.account-seller-form__input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  background: #fff;
  color: var(--text, #111);
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea.account-seller-form__input {
  min-height: 96px;
  resize: vertical;
}

.account-seller-form__input:focus {
  outline: none;
  border-color: rgba(31, 122, 92, 0.55);
  box-shadow: 0 0 0 3px rgba(31, 122, 92, 0.15);
}

.account-seller-form__input--invalid {
  border-color: #c45c3a;
}

.account-seller-form__input--invalid:focus {
  box-shadow: 0 0 0 3px rgba(196, 92, 58, 0.18);
}

.account-seller-form__error {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #9a4b2e;
}

.account-seller-form__error[hidden] {
  display: none;
}

.account-seller-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.account-seller-form__actions--modal {
  position: sticky;
  bottom: 0;
  margin-top: 20px;
  padding-top: 14px;
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #fff 28%);
  justify-content: flex-end;
}

.account-selling--compact .account-selling__desc {
  max-width: 42rem;
}

/* ---- Seller application modal ---- */

body.account-seller-modal-open {
  overflow: hidden;
}

.account-seller-modal {
  position: fixed;
  inset: 0;
  z-index: 9200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.account-seller-modal[hidden] {
  display: none !important;
}

.account-seller-modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  margin: 0;
  padding: 0;
  background: rgba(18, 27, 24, 0.48);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  cursor: pointer;
}

.account-seller-modal__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(100%, 720px);
  max-height: min(92vh, 880px);
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  box-shadow:
    0 24px 70px rgba(15, 31, 25, 0.22),
    0 4px 16px rgba(15, 31, 25, 0.08);
  outline: none;
  overflow: hidden;
}

.account-seller-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: #fff;
}

.account-seller-modal__heading {
  min-width: 0;
}

.account-seller-modal__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text, #111);
}

.account-seller-modal__intro {
  margin: 6px 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--muted, #6b7280);
}

.account-seller-modal__intro:empty {
  display: none;
}

.account-seller-modal__close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  background: #fff;
  color: var(--muted, #6b7280);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.account-seller-modal__close:hover {
  background: var(--mint, #e8f5ef);
  color: var(--green-dark, #165a44);
  border-color: rgba(31, 122, 92, 0.3);
}

.account-seller-modal__close:focus-visible,
.account-seller-form__input:focus-visible,
.account-btn:focus-visible,
.account-seller-modal__dialog:focus-visible {
  outline: 2px solid rgba(31, 122, 92, 0.65);
  outline-offset: 2px;
}

.account-seller-modal__body {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 20px 20px;
  -webkit-overflow-scrolling: touch;
}

.account-seller-modal__rejection {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #f0c2b0;
  background: #fff8f5;
}

.account-seller-modal .account-seller-form {
  margin-top: 0;
}

/* ---- Footer links ---- */

.account-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 28px;
  border-top: 1px solid var(--border, #e5e7eb);
  font-size: 0.875rem;
  color: var(--muted, #6b7280);
}

.account-footer a {
  font-weight: 600;
  color: var(--green, #1f7a5c);
}

.account-footer a:hover {
  color: var(--green-dark, #165a44);
  text-decoration: underline;
}

.account-footer__sep {
  color: var(--border, #e5e7eb);
}

/* ---- Responsive ---- */

@media (max-width: 960px) {
  .account-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 640px) {
  .account-main {
    padding: 16px 12px 48px;
  }

  .account-hero {
    padding: 22px 18px 24px;
    border-radius: 16px;
  }

  .account-hero__inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .account-hero__meta {
    justify-content: center;
  }

  .account-hero__message {
    margin: 0 auto;
  }

  .account-grid,
  .account-grid--three {
    grid-template-columns: 1fr;
  }

  .account-selling__inner {
    flex-direction: column;
    align-items: stretch;
  }

  .account-selling__actions {
    width: 100%;
  }

  .account-btn {
    width: 100%;
  }

  .account-seller-form__grid {
    grid-template-columns: 1fr;
  }

  .account-seller-form__actions .account-btn {
    width: 100%;
  }

  .account-seller-modal {
    padding: 0;
    align-items: stretch;
  }

  .account-seller-modal__dialog {
    width: 100%;
    max-width: none;
    max-height: none;
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    border-radius: 0;
    border: 0;
  }

  .account-seller-modal__header {
    padding-top: calc(14px + env(safe-area-inset-top, 0));
  }

  .account-seller-modal__body {
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0));
  }

  .account-seller-form__actions--modal {
    justify-content: stretch;
  }

  .account-seller-form__actions--modal .account-btn {
    width: 100%;
  }
}
