/* Kapow Account Page Styles
   Design system: Void #0A0A0F bg, Surface #111118 cards, Yellow #FFD60A accent, Inter font */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --void: #0A0A0F;
  --surface: #111118;
  --surface-hover: #18181F;
  --border: #1E1E28;
  --border-light: #2A2A35;
  --text: #F5F5F7;
  --text-muted: #A1A1AA;
  --text-dim: #71717A;
  --accent: #FFD60A;
  --accent-hover: #E6C009;
  --danger: #EF4444;
  --success: #22C55E;
  --radius: 8px;
  --radius-lg: 12px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background: var(--void);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Top nav bar */
.account-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.account-nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.account-nav-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 3px;
  text-decoration: none;
}

.account-nav-back {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.account-nav-back:hover {
  color: var(--accent);
}

/* Main layout */
.account-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 104px 24px 64px;
}

.account-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.account-subtitle {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 40px;
}

/* Loading state */
.account-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.account-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 214, 10, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: acct-spin 0.8s linear infinite;
}

@keyframes acct-spin {
  to { transform: rotate(360deg); }
}

/* Cards */
.account-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
}

.account-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.account-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

/* Profile section */
.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--border);
  object-fit: cover;
  flex-shrink: 0;
}

.profile-avatar-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 600;
  color: var(--text-dim);
  flex-shrink: 0;
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.profile-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.profile-email {
  font-size: 14px;
  color: var(--text-dim);
}

.profile-provider {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 10px;
  border-radius: 20px;
  margin-top: 6px;
}

.profile-provider svg {
  width: 14px;
  height: 14px;
}

/* Form fields */
.field-group {
  margin-bottom: 20px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.field-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--void);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.field-input:focus {
  border-color: var(--accent);
}

.field-input:disabled,
.field-input[readonly] {
  opacity: 0.6;
  cursor: not-allowed;
}

.field-hint {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Plan section */
.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.plan-badge-free {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.plan-badge-pro {
  background: rgba(255, 214, 10, 0.12);
  color: var(--accent);
}

.plan-badge-team {
  background: rgba(59, 130, 246, 0.12);
  color: #3B82F6;
}

.plan-badge-enterprise {
  background: rgba(168, 85, 247, 0.12);
  color: #A855F7;
}

.plan-features {
  list-style: none;
  margin-top: 20px;
}

.plan-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.plan-features li:last-child {
  border-bottom: none;
}

.plan-features li::before {
  content: '';
  display: block;
  width: 16px;
  height: 16px;
  background: var(--success);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  mask-size: contain;
  -webkit-mask-size: contain;
  flex-shrink: 0;
}

/* Buttons */
.btn-account {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn-account:active {
  transform: scale(0.98);
}

.btn-account:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary-acct {
  background: var(--accent);
  color: var(--void);
}

.btn-primary-acct:hover {
  background: var(--accent-hover);
}

.btn-secondary-acct {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary-acct:hover {
  background: var(--surface-hover);
  border-color: var(--text-dim);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: var(--danger);
}

/* Success / error messages */
.msg-success {
  color: var(--success);
  font-size: 13px;
  margin-top: 8px;
}

.msg-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 8px;
}

/* Sign out section */
.signout-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
}

.signout-text {
  font-size: 14px;
  color: var(--text-dim);
}

/* Usage section */
.usage-bars {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 16px;
}

.usage-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.usage-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.usage-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.usage-count {
  font-size: 13px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.usage-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.usage-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.4s ease;
  min-width: 0;
}

.usage-note {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.usage-upgrade {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}

.usage-upgrade a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Billing section */
.billing-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.billing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.billing-row:last-child {
  border-bottom: none;
}

.billing-label {
  font-size: 14px;
  color: var(--text-dim);
}

.billing-value {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

/* Plan active label */
.plan-active-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #22C55E;
  font-weight: 500;
}

/* Billing status styles */
.billing-status-active {
  color: var(--success) !important;
}

.billing-status-trialing {
  color: #3B82F6 !important;
}

.billing-status-past_due {
  color: #F59E0B !important;
}

.billing-status-canceled {
  color: var(--text-dim) !important;
}

.billing-status-unpaid {
  color: var(--danger) !important;
}

.billing-status-paused {
  color: var(--text-dim) !important;
}

/* Billing status badge in header */
.billing-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.billing-status-badge-active {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}

.billing-status-badge-trialing {
  background: rgba(59, 130, 246, 0.12);
  color: #3B82F6;
}

.billing-status-badge-past_due {
  background: rgba(245, 158, 11, 0.12);
  color: #F59E0B;
}

.billing-status-badge-canceled {
  background: rgba(113, 113, 122, 0.12);
  color: var(--text-dim);
}

.billing-status-badge-unpaid {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.billing-status-badge-paused {
  background: rgba(113, 113, 122, 0.12);
  color: var(--text-dim);
}

/* Cancel notice banner */
.billing-cancel-notice {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(113, 113, 122, 0.08);
  border: 1px solid rgba(113, 113, 122, 0.15);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Past due warning banner */
.billing-warning {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius);
  font-size: 13px;
  color: #F59E0B;
  line-height: 1.5;
}

/* Cancel date highlight */
.billing-cancel-date {
  color: var(--text-dim) !important;
}

/* Upgrade card */
.upgrade-text {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
}

/* Download section */
.download-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.15s;
}

.download-link:hover {
  opacity: 0.8;
}

.download-meta {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 8px;
}

/* Responsive */
@media (max-width: 600px) {
  .account-container {
    padding-top: 88px;
  }

  .account-card {
    padding: 24px 20px;
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
  }

  .account-title {
    font-size: 24px;
  }

  .signout-section {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}
