/* ═══════════════════════════════════════════════════════════════════════════════
 * Account Dashboard Styles
 * ═══════════════════════════════════════════════════════════════════════════════ */

.account-page {
  min-height: 100vh;
  background: var(--color-bg-primary);
  padding-top: calc(var(--header-height) + var(--space-8));
}

.account-header {
  margin-bottom: var(--space-8);
}

.account-header h1 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-2);
}

.account-header p {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}

.account-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

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

/* --- Cards --- */

.account-card {
  background: var(--color-surface-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.account-card--full {
  grid-column: 1 / -1;
}

.account-card-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-4);
}

/* --- Form fields --- */

.account-field {
  margin-bottom: var(--space-4);
}

.account-field label {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}

.account-field input {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  transition: border-color var(--duration-normal);
}

.account-field input:focus {
  outline: none;
  border-color: var(--color-accent-blue);
}

.account-field input[readonly] {
  opacity: 0.7;
  cursor: not-allowed;
}

/* --- API key --- */

.api-key-display {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.api-key-display code {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Usage bar --- */

.usage-bar-container {
  margin: var(--space-4) 0;
}

.usage-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}

.usage-bar {
  height: 8px;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.usage-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--color-accent-blue);
  transition: width var(--duration-slow) var(--ease-out);
}

.usage-bar-fill--warning {
  background: var(--color-status-amber);
}

.usage-bar-fill--danger {
  background: var(--color-status-red);
}

/* --- Plan badge --- */

.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.plan-badge--pilot {
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-status-blue);
}

.plan-badge--growth {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-status-green);
}

.plan-badge--enterprise {
  background: rgba(139, 92, 246, 0.1);
  color: var(--color-viz-purple);
}

/* --- Buttons --- */

.account-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  border: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  transition: all var(--duration-normal) var(--ease-out);
}

.account-btn:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-border-strong);
}

.account-btn--primary {
  background: var(--color-accent-blue);
  border-color: var(--color-accent-blue);
  color: #fff;
}

.account-btn--primary:hover {
  background: var(--color-accent-blue-hover);
}

.account-btn--danger {
  color: var(--color-status-red);
  border-color: rgba(239, 68, 68, 0.3);
}

.account-btn--danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

.account-btn--small {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
}

.account-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
  flex-wrap: wrap;
}

/* --- Confirm modal --- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-surface-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--color-surface-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}

.modal h3 {
  margin-bottom: var(--space-3);
}

.modal p {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  margin-bottom: var(--space-6);
}

.modal-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
}

/* --- Toast --- */

.toast {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  background: var(--color-surface-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
  box-shadow: var(--shadow-lg);
  transform: translateY(100px);
  opacity: 0;
  transition: all var(--duration-slow) var(--ease-spring);
  z-index: 200;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.toast--success {
  border-left: 3px solid var(--color-status-green);
}

.toast--error {
  border-left: 3px solid var(--color-status-red);
}
