/* ABM Pro — 계정/구독/결제 페이지 + 모달 (헤더는 site-header.css) */

.mobile-auth {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.mobile-auth__title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 14px;
}

.mobile-auth__link,
.mobile-auth__btn {
  display: block;
  width: 100%;
  padding: 10px 0;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.92);
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
}

.mobile-auth__btn--login {
  margin-top: 8px;
  padding: 12px 16px;
  text-align: center;
  background: var(--color-accent);
  border-radius: 8px;
  font-weight: 600;
}

.mobile-auth__btn--danger {
  color: #fca5a5;
  margin-top: 8px;
}

/* ===== ACCOUNT MODAL ===== */
.account-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.account-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.account-modal {
  width: 100%;
  max-width: 360px;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 22px 20px 18px;
}

.account-modal__title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  padding-right: 28px;
  color: var(--color-text);
}

.account-modal__desc {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

.account-modal__info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  margin-bottom: 14px;
}

.account-modal__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.account-modal__row dt {
  color: var(--color-text-muted);
  flex-shrink: 0;
  font-size: 0.75rem;
}

.account-modal__row dd {
  font-weight: 600;
  text-align: right;
  word-break: break-all;
  color: var(--color-text);
}

.account-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.account-modal .btn-account {
  padding: 8px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 8px;
  min-height: 36px;
}

.account-modal__actions .btn-account--danger {
  margin-top: 2px;
  background: transparent;
  border-color: transparent;
  color: #dc2626;
  font-weight: 500;
  min-height: 32px;
  padding: 6px 14px;
}

.account-modal__actions .btn-account--danger:hover {
  background: #fef2f2;
  border-color: transparent;
}

.account-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: none;
  background: var(--color-bg-alt);
  border-radius: 50%;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}

.account-modal__close:hover {
  background: var(--color-border);
  color: var(--color-text);
}

.account-modal-wrap {
  position: relative;
}

/* ===== MOBILE BOTTOM SHEET ===== */
.account-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1150;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.account-sheet-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.account-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1160;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 12px 20px calc(20px + env(safe-area-inset-bottom, 0));
  transform: translateY(100%);
  transition: transform 0.28s ease;
  max-height: 80vh;
  overflow-y: auto;
}

.account-sheet.is-open {
  transform: translateY(0);
}

.account-sheet__handle {
  width: 40px;
  height: 4px;
  margin: 0 auto 16px;
  background: #e2e8f0;
  border-radius: 999px;
}

.account-sheet__title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
  padding: 0 4px;
}

/* ===== TOAST ===== */
.account-toast {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 3000;
  padding: 12px 20px;
  background: var(--color-bg-dark);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
}

.account-toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ===== ACCOUNT PAGES LAYOUT ===== */
.page-account {
  background: var(--color-bg-alt);
  min-height: 100vh;
}

.account-page {
  padding: 104px 16px 64px;
}

.account-page__inner {
  max-width: 800px;
  margin: 0 auto;
}

.account-page__head {
  margin-bottom: 28px;
}

.account-page__title {
  font-size: clamp(1.5rem, 4vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.account-page__subtitle {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.account-summary {
  display: grid;
  gap: 12px;
  padding: 24px;
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  border-radius: var(--radius);
  color: #fff;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.25);
}

.account-summary__name {
  font-size: 1.25rem;
  font-weight: 700;
}

.account-summary__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.88rem;
  opacity: 0.92;
}

.account-summary__badge {
  display: inline-flex;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.account-summary__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ===== REFERRAL / CREDIT ===== */
.referral-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

@media (min-width: 640px) {
  .referral-stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.referral-stat-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.referral-stat-card__label {
  display: block;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.referral-stat-card__value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-accent);
}

.referral-code-panel {
  text-align: center;
  padding: 8px 0 4px;
}

.referral-code-panel__code {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  color: var(--color-text);
}

.referral-code-panel__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.referral-code-panel__qr {
  margin-top: 8px;
  margin-bottom: 8px;
}

.referral-code-panel__qr img {
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

.referral-credit-hint {
  margin-top: 28px;
  text-align: center;
}

.referral-list-count {
  font-weight: 500;
  color: var(--color-text-muted);
  font-size: 0.88rem;
}

.referral-list {
  display: grid;
  gap: 10px;
}

.referral-list-item {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--color-bg-alt);
}

.referral-list-item__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.referral-list-item__name {
  font-weight: 600;
  font-size: 0.95rem;
}

.referral-list-item__status {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  white-space: nowrap;
}

.referral-list-item__status--rewarded {
  background: #ecfdf5;
  color: #047857;
}

.referral-list-item__status--converted {
  background: #fff7ed;
  color: #c2410c;
}

.referral-list-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.referral-empty {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  padding: 8px 0;
}

.account-section {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.account-section__title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.account-field {
  margin-bottom: 16px;
}

.account-field:last-child {
  margin-bottom: 0;
}

.account-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.account-field input,
.account-field .account-field__value {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.95rem;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: #fff;
  color: var(--color-text);
}

.account-field input:read-only,
.account-field input[readonly] {
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
}

.account-field__value {
  background: var(--color-bg-alt);
}

.account-field__hint {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.account-section--locked .account-field input[readonly] {
  cursor: default;
}

.account-section__note {
  margin: 4px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  font-size: 0.86rem;
  line-height: 1.55;
  color: #1e40af;
  text-align: center;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.account-actions--footer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
  justify-content: center;
}

.btn-account {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.btn-account--primary {
  background: var(--color-accent);
  color: #fff;
}

.btn-account--primary:hover {
  background: var(--color-accent-dark);
}

.btn-account--secondary {
  background: #fff;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-account--secondary:hover {
  background: var(--color-bg-alt);
}

.btn-account--danger {
  background: none;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.btn-account--danger:hover {
  background: #fef2f2;
}

.btn-account:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.account-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}

.account-status--active {
  background: #dcfce7;
  color: #166534;
}

.account-status--inactive {
  background: #f1f5f9;
  color: #64748b;
}

.account-status--pending {
  background: #fef3c7;
  color: #92400e;
}

.referral-promo-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 24px;
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
  border: 1px solid #bfdbfe;
}

.referral-promo-banner__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.referral-promo-banner__text {
  margin: 0;
  flex: 1 1 220px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.referral-promo-banner__text strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e3a8a;
}

.referral-promo-banner__text span {
  font-size: 0.82rem;
  line-height: 1.45;
  color: #475569;
}

.referral-promo-banner__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 8px;
  background: #2563eb;
  color: #fff !important;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.referral-promo-banner__cta:hover {
  background: #1d4ed8;
}

.referral-promo-banner__close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin: -4px -6px 0 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #64748b;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.referral-promo-banner__close:hover {
  background: rgba(15, 23, 42, 0.06);
  color: #334155;
}

.account-info-banner {
  margin-bottom: 24px;
  padding: 16px 18px;
  border-radius: 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.account-info-banner strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.95rem;
  color: #1e3a8a;
}

.account-info-banner p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.55;
  color: #334155;
}

.account-info-banner--trial {
  background: #ecfdf5;
  border-color: #6ee7b7;
}

.account-info-banner--trial strong {
  color: #047857;
}

.account-info-banner--trial p {
  color: #065f46;
}

.account-plan-card {
  padding: 20px;
  background: var(--color-bg-alt);
  border-radius: 12px;
  margin-bottom: 16px;
}

.account-plan-card__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  font-size: 0.92rem;
  border-bottom: 1px solid var(--color-border);
}

.account-plan-card__row[hidden] {
  display: none !important;
}

.account-plan-card__row:last-child {
  border-bottom: none;
}

.account-plan-card__label {
  color: var(--color-text-muted);
}

.account-plan-card__value {
  font-weight: 600;
  text-align: right;
}

.account-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.account-table-wrap {
  overflow-x: auto;
  margin: 0 -8px;
  padding: 0 8px;
}

.account-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.account-table th,
.account-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.account-table th {
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-bg-alt);
  font-size: 0.8rem;
}

.account-table tbody tr:hover {
  background: #fafbfc;
}

.account-table__link {
  color: var(--color-accent);
  font-weight: 500;
}

.account-support {
  text-align: center;
  padding: 32px 24px;
}

.account-support p {
  color: var(--color-text-muted);
  margin-bottom: 16px;
  line-height: 1.65;
}

@media (max-width: 768px) {
  .account-page {
    padding-top: 88px;
  }

  .account-section {
    padding: 20px 18px;
  }
}

@media (min-width: 769px) {
  .account-sheet-backdrop,
  .account-sheet {
    display: none;
  }
}
