/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--font-sm);
  transition: all var(--transition-fast);
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--primary-600);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-700);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--gray-200);
}

.btn-outline {
  background: transparent;
  color: var(--primary-600);
  border: 1.5px solid var(--primary-200);
}

.btn-outline:hover {
  background: var(--primary-50);
  border-color: var(--primary-400);
}

.btn-danger {
  background: var(--error);
  color: white;
}

.btn-danger:hover {
  background: #DC2626;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-google {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1.5px solid var(--border-color);
  padding: 14px 24px;
  width: 100%;
  font-size: var(--font-base);
}

.btn-google:hover {
  background: var(--bg-tertiary);
  box-shadow: var(--shadow-md);
}

.btn-google svg {
  flex-shrink: 0;
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 8px 16px;
  font-size: var(--font-xs);
  border-radius: var(--radius-sm);
}

.btn-xs {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 6px;
}

.btn .material-icons-round {
  font-size: 18px;
}

/* Form inputs */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: var(--font-base);
  transition: all var(--transition-fast);
  outline: none;
}

.form-input:focus {
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px var(--primary-100);
}

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

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 40px;
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: var(--space-md);
  transition: all var(--transition-fast);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-flat {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: var(--space-md);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: var(--z-modal);
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--bg-primary);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-lg) var(--space-md);
  position: sticky;
  top: 0;
  background: var(--bg-primary);
  z-index: 1;
}

.modal-header h3 {
  font-size: var(--font-xl);
  font-weight: 700;
}

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

@media (min-width: 768px) {
  .modal-overlay {
    align-items: center;
  }
  .modal-content {
    border-radius: var(--radius-xl);
    max-height: 80vh;
  }
}

/* Toast */
.toast-container {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  background: var(--gray-800);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideDown 0.3s ease, fadeOut 0.3s ease 2.7s;
  pointer-events: auto;
  text-align: center;
  max-width: 90vw;
}

.toast-success {
  background: var(--success);
}

.toast-error {
  background: var(--error);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.badge-primary {
  background: var(--primary-100);
  color: var(--primary-700);
}

.badge-success {
  background: var(--success-light);
  color: #065F46;
}

.tab-badge {
  background: var(--error);
  color: white;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  margin-left: 4px;
}

/* Confetti */
.confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-confetti);
}

/* Section headers */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.section-title {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Divider */
.divider {
  height: 1px;
  background: var(--border-color);
  margin: var(--space-md) 0;
}

/* Chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: var(--font-xs);
  font-weight: 500;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1.5px solid transparent;
}

.chip:hover {
  background: var(--primary-50);
  color: var(--primary-600);
}

.chip.active {
  background: var(--primary-50);
  color: var(--primary-600);
  border-color: var(--primary-200);
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2));
}
