/* === CARDS === */
.card {
  background: var(--gradient-card);
  border: 1px solid var(--color-border-default);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

/* === BOTÕES === */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: var(--gradient-neon-glow);
  color: var(--color-text-inverse);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-base);
  padding: 0.875rem 2rem;
  border-radius: 12px;
  border: none;
  box-shadow: var(--shadow-button);
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-button-hover);
}

.btn-primary:active {
  transform: translateY(0) scale(0.99);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: transparent;
  color: var(--color-neon);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-base);
  padding: 0.875rem 2rem;
  border-radius: 12px;
  border: 1px solid var(--color-border-active);
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.btn-secondary:hover {
  background: rgba(0, 229, 255, 0.08);
  box-shadow: var(--shadow-neon-sm);
}

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

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: transparent;
  color: var(--color-text-secondary);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-base);
  padding: 0.875rem 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--color-border-subtle);
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text-primary);
  border-color: var(--color-border-default);
}

.btn-ghost:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: var(--color-error-dim);
  color: var(--color-error);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-base);
  padding: 0.875rem 1.5rem;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.25);
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.25);
}

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

/* Tamanhos de botão */
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: var(--text-sm);
  border-radius: 8px;
}

.btn-lg {
  padding: 1rem 2.5rem;
  font-size: var(--text-lg);
}

.btn-full {
  width: 100%;
}

/* Loading state em botões */
.btn-loading {
  pointer-events: none;
  position: relative;
}

.btn-loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  margin-left: 8px;
  vertical-align: middle;
}

/* === BADGES === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.badge-neon {
  background: rgba(0, 229, 255, 0.10);
  color: var(--color-neon);
  border: 1px solid rgba(0, 229, 255, 0.20);
}

.badge-success {
  background: var(--color-success-dim);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-warning {
  background: var(--color-warning-dim);
  color: var(--color-warning);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-error {
  background: var(--color-error-dim);
  color: var(--color-error);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-muted {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border-subtle);
}

/* === INPUTS === */
.input {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-default);
  border-radius: 10px;
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  padding: 0.75rem 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  outline: none;
}

.input::placeholder {
  color: var(--color-text-muted);
}

.input:focus {
  border-color: var(--color-border-active);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.10);
}

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

.input-readonly {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--color-border-subtle);
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: default;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--color-border-subtle);
  font-size: var(--text-base);
  font-family: var(--font-body);
}

.textarea {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-default);
  border-radius: 10px;
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  padding: 0.75rem 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  resize: vertical;
  min-height: 100px;
  outline: none;
}

.textarea::placeholder {
  color: var(--color-text-muted);
}

.textarea:focus {
  border-color: var(--color-border-active);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.10);
}

.select {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-default);
  border-radius: 10px;
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  padding: 0.75rem 1rem;
  transition: border-color 0.2s ease;
  width: 100%;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.select:focus {
  border-color: var(--color-border-active);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.10);
}

/* Campo com senha e toggle */
.input-password-wrapper {
  position: relative;
}

.input-password-wrapper .input {
  padding-right: 3rem;
}

.btn-password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
}

.btn-password-toggle:hover {
  color: var(--color-text-primary);
}

/* === FIELD GROUPS === */
.field-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.field-group.field-readonly .input-readonly {
  pointer-events: none;
}

.field-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.field-hint {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-normal);
}

.field-hint-inline {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-left: auto;
}

.field-error {
  font-size: var(--text-sm);
  color: var(--color-error);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.field-error.hidden {
  display: none;
}

/* Input em estado de erro */
.input-error {
  border-color: var(--color-error) !important;
  box-shadow: 0 0 0 3px var(--color-error-dim) !important;
}

/* === MODAL === */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: fadeIn 0.2s ease;
}

.modal-panel {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  border-radius: 20px;
  box-shadow: var(--shadow-neon-md);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: scaleIn 0.25s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6);
  border-bottom: 1px solid var(--color-border-subtle);
}

.modal-header h3 {
  font-size: var(--text-xl);
  font-weight: 600;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: var(--space-1);
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}

.modal-close:hover {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.modal-body {
  padding: var(--space-6);
}

.modal-footer {
  padding: var(--space-4) var(--space-6) var(--space-6);
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  border-top: 1px solid var(--color-border-subtle);
}

/* === TOASTS === */
.toast-container {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: 360px;
  width: 100%;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: 12px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-default);
  box-shadow: var(--shadow-card);
  animation: slideInRight 0.3s ease;
  font-size: var(--text-sm);
  font-family: var(--font-body);
  color: var(--color-text-primary);
}

.toast.toast-hide {
  animation: slideOutRight 0.3s ease forwards;
}

.toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-message {
  flex: 1;
  line-height: var(--leading-snug);
}

.toast-close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0;
  font-size: var(--text-base);
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.toast-close:hover {
  color: var(--color-text-primary);
}

.toast-success {
  border-color: rgba(16, 185, 129, 0.30);
  background: linear-gradient(145deg, var(--color-bg-elevated) 0%, rgba(16, 185, 129, 0.05) 100%);
}

.toast-error {
  border-color: rgba(239, 68, 68, 0.30);
  background: linear-gradient(145deg, var(--color-bg-elevated) 0%, rgba(239, 68, 68, 0.05) 100%);
}

.toast-warning {
  border-color: rgba(245, 158, 11, 0.30);
  background: linear-gradient(145deg, var(--color-bg-elevated) 0%, rgba(245, 158, 11, 0.05) 100%);
}

.toast-info {
  border-color: rgba(0, 229, 255, 0.20);
  background: linear-gradient(145deg, var(--color-bg-elevated) 0%, rgba(0, 229, 255, 0.04) 100%);
}

/* === LOADER GLOBAL === */
.loader-global {
  position: fixed;
  inset: 0;
  background: var(--color-bg-base);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-4);
  transition: opacity 0.3s ease;
}

.loader-global.loader-hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border-default);
  border-top-color: var(--color-neon);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loader-global-logo {
  width: var(--logo-loader-width);
  opacity: 0.8;
}

/* === DIVIDER === */
.divider {
  height: 1px;
  background: var(--color-border-subtle);
  border: none;
  margin: var(--space-6) 0;
}

/* === AVATAR === */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-neon-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--color-text-inverse);
  flex-shrink: 0;
}

/* === CHIP === */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.25rem 0.625rem;
  border-radius: 100px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-default);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.chip:hover {
  border-color: var(--color-border-hover);
  color: var(--color-text-primary);
}

.chip.active {
  background: rgba(0, 229, 255, 0.08);
  border-color: var(--color-border-active);
  color: var(--color-neon);
}

/* === TOGGLE SWITCH === */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-default);
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.toggle-track::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-text-muted);
  transition: transform 0.25s ease, background 0.25s ease;
}

.toggle-switch input:checked + .toggle-track {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--color-neon);
}

.toggle-switch input:checked + .toggle-track::before {
  transform: translateX(20px) translateY(-50%);
  background: var(--color-neon);
  box-shadow: var(--shadow-neon-sm);
}

.toggle-switch input:focus + .toggle-track {
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.10);
}

/* === SPINNER === */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--color-border-default);
  border-top-color: var(--color-neon);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
  display: inline-block;
}

.spinner-sm {
  width: 16px;
  height: 16px;
}

.spinner-lg {
  width: 36px;
  height: 36px;
  border-width: 3px;
}

/* === SKELETON === */
.skeleton {
  background: linear-gradient(90deg, var(--color-bg-elevated) 25%, var(--color-bg-subtle) 50%, var(--color-bg-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

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