/* ══════════════════════════════════════════════════════════════════════
   Account pages — /conta/
   ══════════════════════════════════════════════════════════════════════ */

/* ── Auth pages (login / register) ──────────────────────────────────── */
.auth-wrapper {
  display: flex;
  justify-content: center;
  padding: 3rem 1rem;
}
.auth-card {
  width: 100%;
  max-width: 440px;
}
.auth-card__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
}
.auth-card__footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: .875rem;
  color: var(--color-text-muted);
}
.auth-card__footer a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}
.auth-card__footer a:hover {
  text-decoration: underline;
}

/* ── Account layout (sidebar + main) ────────────────────────────────── */
.account-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 3rem;
  padding: 2.5rem 0 4rem;
}
@media (max-width: 768px) {
  .account-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.5rem 0 3rem;
  }
}

.account-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

/* ── Account sidebar nav ────────────────────────────────────────────── */
.account-nav {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  position: sticky;
  top: 90px;
}
.account-nav__link {
  padding: .625rem .875rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  border-radius: 6px;
  transition: background .12s, color .12s;
}
.account-nav__link:hover {
  background: #f3f4f6;
}
.account-nav__link--active {
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
}
.account-nav__link--active:hover {
  background: var(--color-primary);
}
.account-nav__link--logout {
  margin-top: 1rem;
  color: var(--color-text-muted);
}
.account-nav__link--logout:hover {
  color: #ef4444;
  background: #fef2f2;
}

/* ── Section ────────────────────────────────────────────────────────── */
.account-section {
  margin-top: 2rem;
}
.account-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.account-section__title {
  font-size: 1rem;
  font-weight: 700;
}
.account-section__link {
  font-size: .8125rem;
  color: var(--color-primary);
  text-decoration: none;
}
.account-section__link:hover {
  text-decoration: underline;
}
.account-empty {
  color: var(--color-text-muted);
  font-size: .875rem;
  padding: 2rem 0;
}

/* ── Flecks Coin card ───────────────────────────────────────────────── */
.coin-card {
  background: linear-gradient(135deg, #1e293b, #334155);
  color: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
}
.coin-card--large {
  flex-direction: column;
  align-items: flex-start;
  padding: 2rem;
}
.coin-card__balance {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.coin-card__icon {
  font-size: 2.5rem;
}
.coin-card__amount {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
}
.coin-card__label {
  font-size: .8125rem;
  opacity: .7;
  margin-top: .25rem;
}
.coin-card__info {
  font-size: .8125rem;
  opacity: .85;
  line-height: 1.6;
}
.coin-card__info strong {
  color: #fbbf24;
}
.coin-card__rule {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .5rem;
}
.coin-card__rule-icon {
  font-size: 1.125rem;
}
.coin-card__link {
  margin-left: auto;
  font-size: .8125rem;
  color: #fbbf24;
  text-decoration: underline;
}
.coin-card__link:hover {
  color: #fde68a;
}

/* ── Order list ─────────────────────────────────────────────────────── */
.order-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.order-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .875rem 1rem;
  background: #fff;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  text-decoration: none;
  color: var(--color-text);
  transition: border-color .12s, box-shadow .12s;
}
.order-item:hover {
  border-color: var(--color-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.order-item__info {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.order-item__number {
  font-weight: 700;
}
.order-item__date {
  font-size: .8125rem;
  color: var(--color-text-muted);
}
.order-item__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.order-item__total {
  font-weight: 700;
}
.order-item__status {
  font-size: .75rem;
  font-weight: 600;
  padding: .25rem .625rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.order-item__status--pending { background: #fef3c7; color: #92400e; }
.order-item__status--confirmed { background: #d1fae5; color: #065f46; }
.order-item__status--processing { background: #f3f4f6; color: #374151; }
.order-item__status--shipped { background: #f3f4f6; color: #374151; }
.order-item__status--delivered { background: #d1fae5; color: #065f46; }
.order-item__status--cancelled { background: #fee2e2; color: #991b1b; }

/* ── Order detail ───────────────────────────────────────────────────── */
.order-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.order-table th {
  text-align: left;
  padding: .625rem .5rem;
  border-bottom: 2px solid var(--color-border, #e5e7eb);
  font-weight: 600;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-text-muted);
}
.order-table td {
  padding: .75rem .5rem;
  border-bottom: 1px solid #f3f4f6;
}

.order-totals {
  margin-top: 1.5rem;
  max-width: 320px;
  margin-left: auto;
}
.order-totals__row {
  display: flex;
  justify-content: space-between;
  padding: .375rem 0;
  font-size: .875rem;
}
.order-totals__row--total {
  font-weight: 700;
  font-size: 1rem;
  border-top: 2px solid var(--color-text);
  padding-top: .75rem;
  margin-top: .5rem;
}

/* ── Address grid ───────────────────────────────────────────────────── */
.address-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.address-card {
  position: relative;
  padding: 1.25rem;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  font-size: .875rem;
  line-height: 1.6;
}
.address-card--default {
  border-color: var(--color-primary);
}
.address-card__badge {
  position: absolute;
  top: .75rem;
  right: .75rem;
  font-size: .6875rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-primary);
  background: rgba(var(--color-primary-rgb, 0,0,0), .08);
  padding: .125rem .5rem;
  border-radius: 4px;
}
.address-card__label {
  font-weight: 700;
  margin-bottom: .25rem;
}
.address-card__actions {
  display: flex;
  gap: 1rem;
  margin-top: .75rem;
  font-size: .8125rem;
}
.address-card__actions a {
  color: var(--color-primary);
  text-decoration: none;
}
.address-card__actions a:hover {
  text-decoration: underline;
}

/* ── Coin ledger ────────────────────────────────────────────────────── */
.coin-ledger {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.coin-tx {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .75rem 1rem;
  background: #fff;
  border: 1px solid #f3f4f6;
  border-radius: 8px;
}
.coin-tx__info {
  display: flex;
  flex-direction: column;
}
.coin-tx__desc {
  font-size: .875rem;
  font-weight: 500;
}
.coin-tx__date {
  font-size: .75rem;
  color: var(--color-text-muted);
}
.coin-tx__amount {
  text-align: right;
}
.coin-tx__value {
  font-size: 1rem;
  font-weight: 700;
  display: block;
}
.coin-tx__value--positive { color: #059669; }
.coin-tx__value--negative { color: #dc2626; }
.coin-tx__balance {
  font-size: .6875rem;
  color: var(--color-text-muted);
}

/* ── Forms ──────────────────────────────────────────────────────────── */
.account-form {
  max-width: 560px;
}
.form-row {
  display: flex;
  gap: 1rem;
}
.form-group {
  margin-bottom: 1rem;
  flex: 1;
}
.form-group--half {
  flex: 1;
}
.form-group--third {
  flex: 0 0 33%;
}
.form-group label {
  display: block;
  font-size: .8125rem;
  font-weight: 600;
  margin-bottom: .375rem;
  color: var(--color-text);
}
.form-error {
  display: block;
  font-size: .75rem;
  color: #dc2626;
  margin-top: .25rem;
}
.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* ── Utility ────────────────────────────────────────────────────────── */
.link-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  padding: 0;
  text-decoration: none;
  color: var(--color-primary);
}
.link-btn:hover { text-decoration: underline; }
.link-btn--danger { color: #dc2626; }
.link-btn--danger:hover { color: #b91c1c; }

.text-muted { color: var(--color-text-muted); font-size: .875rem; }
.text-success { color: #059669; }

.alert {
  padding: .75rem 1rem;
  border-radius: 6px;
  font-size: .875rem;
  margin-bottom: 1rem;
}
.alert--success { background: #d1fae5; color: #065f46; }
.alert--danger, .alert--error { background: #fee2e2; color: #991b1b; }

/* ── Coin checkout ──────────────────────────────────────────────────── */
.coin-checkout {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.coin-checkout__title {
  font-size: .9rem;
  font-weight: 700;
  margin-bottom: .5rem;
}
.coin-checkout__balance {
  font-size: .8125rem;
  color: var(--color-text-muted);
  margin-bottom: .75rem;
}
.coin-checkout__input {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .875rem;
}
.coin-checkout__max {
  font-size: .75rem;
  color: var(--color-text-muted);
}

@media (max-width: 768px) {
  .form-row { flex-direction: column; gap: 0; }
  .order-item { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .order-item__meta { width: 100%; justify-content: space-between; }
  .coin-card { padding: 1.25rem; }
  .coin-card__amount { font-size: 2rem; }
  .coin-checkout__input { flex-wrap: wrap; }
  .account-nav {
    flex-direction: row;
    overflow-x: auto;
    gap: .25rem;
    padding-bottom: .5rem;
  }
  .account-nav__link { white-space: nowrap; }
}
