/* ========================================
   UNIFY.PRO — Reusable Components
   ======================================== */

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-clickable { cursor: pointer; }
.card-clickable:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-body { padding: var(--space-md); }
.card-prominent { box-shadow: var(--shadow-lg); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font: var(--label-large);
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.btn:hover::after { opacity: 0.08; }
.btn:active::after { opacity: 0.12; }

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}
.btn-secondary {
  background: var(--secondary);
  color: var(--on-secondary);
}
.btn-tertiary {
  background: var(--tertiary);
  color: var(--on-tertiary);
}
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--surface-variant);
}
.btn-outline:hover { border-color: var(--primary); }
.btn-text {
  background: transparent;
  color: var(--primary);
  padding: 8px 12px;
}
.btn-text-error {
  background: transparent;
  color: var(--error);
  padding: 8px 12px;
}
.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-sm { padding: 6px 14px; font: var(--label-medium); }
.btn-lg { padding: 14px 28px; font: var(--title-medium); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.btn-fab {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xl);
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--shadow-lg);
  position: fixed;
  bottom: 96px;
  right: 24px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-normal);
}
.btn-fab:hover { box-shadow: var(--shadow-xl); transform: scale(1.05); }
.btn-fab .material-symbols-outlined { font-size: 28px; }

.btn-fab-secondary {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--secondary);
  color: var(--on-secondary);
  box-shadow: var(--shadow-md);
  position: fixed;
  bottom: 170px;
  right: 32px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Inputs ---- */
.input-group {
  position: relative;
  width: 100%;
}
.input-field {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--surface-variant);
  border-radius: var(--radius-md);
  background: var(--surface);
  font: var(--body-medium);
  color: var(--on-surface);
  transition: border-color var(--transition-fast);
  outline: none;
}
.input-field:focus { border-color: var(--primary); }
.input-field::placeholder { color: var(--on-surface-variant); opacity: 0.5; }

.input-label {
  display: block;
  font: var(--label-medium);
  color: var(--on-surface-variant);
  margin-bottom: 6px;
}

.input-with-icon {
  padding-left: 44px;
}
.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--on-surface-variant);
  font-size: 20px;
}

textarea.input-field {
  resize: vertical;
  min-height: 80px;
}

.select-field {
  appearance: none;
  width: 100%;
  padding: 14px 40px 14px 16px;
  border: 1.5px solid var(--surface-variant);
  border-radius: var(--radius-md);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%2349454E' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 12px center;
  font: var(--body-medium);
  color: var(--on-surface);
  cursor: pointer;
  outline: none;
}
.select-field:focus { border-color: var(--primary); }

/* ---- Chips / Filter Chips ---- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font: var(--label-medium);
  border: 1.5px solid var(--surface-variant);
  background: transparent;
  color: var(--on-surface);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}
.chip:hover { background: var(--surface-variant); }
.chip.active {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}
.chip-sm { padding: 3px 10px; font: var(--label-small); }

/* ---- Avatar ---- */
.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-md { width: 44px; height: 44px; font-size: 14px; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.avatar-xl { width: 72px; height: 72px; font-size: 24px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Icon Containers ---- */
.icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  flex-shrink: 0;
}
.icon-box-sm { width: 40px; height: 40px; }
.icon-box-md { width: 48px; height: 48px; }
.icon-box-lg { width: 52px; height: 52px; }
.icon-box-xl { width: 56px; height: 56px; }
.icon-box-circle { border-radius: var(--radius-full); }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--surface-variant); }
.tab {
  padding: 12px 20px;
  font: var(--label-large);
  color: var(--on-surface-variant);
  cursor: pointer;
  position: relative;
  transition: color var(--transition-fast);
  border: none;
  background: none;
}
.tab:hover { color: var(--on-surface); }
.tab.active {
  color: var(--primary);
  font-weight: 700;
}
.tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 3px 3px 0 0;
}

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font: var(--label-small);
  font-weight: 700;
}
.badge-urgent {
  background: rgba(204, 118, 91, 0.1);
  color: var(--terracotta);
}
.badge-success {
  background: rgba(142, 160, 147, 0.1);
  color: var(--sage-green);
}

/* ---- Checkbox ---- */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
}
.checkbox {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: 2px solid #D0D0D0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  cursor: pointer;
  background: transparent;
}
.checkbox.checked {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.checkbox .material-symbols-outlined { font-size: 20px; }

/* ---- Divider ---- */
.divider {
  height: 1px;
  background: var(--on-surface);
  opacity: 0.08;
  margin: var(--space-md) 0;
}

/* ---- Stat Card ---- */
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-2xl);
  padding: 20px;
  flex: 1;
}
.stat-card-prominent { box-shadow: var(--shadow-lg); }
.stat-card .stat-value {
  font: var(--headline-medium);
  font-weight: 700;
  color: var(--on-surface);
}
.stat-card-prominent .stat-value {
  font: var(--display-medium);
  font-weight: 700;
}
.stat-card .stat-label {
  font: var(--body-medium);
  color: rgba(36,42,55,0.6);
}
.stat-card-prominent .stat-label {
  font: var(--title-medium);
  color: rgba(36,42,55,0.6);
}
.stat-card .stat-description {
  font: var(--label-medium);
  font-weight: 500;
}

/* ---- Progress Bar ---- */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--surface-variant);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--sage-green);
  border-radius: var(--radius-full);
  transition: width var(--transition-normal);
}

/* ---- Search Bar ---- */
.search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 4px 16px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}
.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font: var(--body-medium);
  padding: 10px 0;
}
.search-bar .material-symbols-outlined { color: gray; font-size: 22px; }

/* ---- Quick Action ---- */
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  padding: 4px;
  transition: transform var(--transition-fast);
}
.quick-action:hover { transform: translateY(-2px); }
.quick-action-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.quick-action-icon-inner {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.quick-action-label {
  font: var(--label-medium);
  color: rgba(36,42,55,0.8);
}

/* ---- Subscription Plan Cards ---- */
.plan-card {
  background: var(--surface);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 16px;
  border: 2px solid transparent;
}
.plan-card-current { border-color: var(--primary); }
.plan-card-name { font-size: 18px; font-weight: 700; color: var(--on-surface); }
.plan-card-tagline { font-size: 12px; color: gray; margin-top: 2px; }
.plan-badge {
  background: var(--primary);
  color: var(--on-primary);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  height: fit-content;
  white-space: nowrap;
}
.plan-card-price { font-size: 28px; font-weight: 700; color: var(--primary); margin: 12px 0; }
.plan-card-price-suffix { font-size: 13px; font-weight: 500; color: gray; }
.plan-card-features { list-style: none; padding: 0; margin: 0 0 16px 0; display: flex; flex-direction: column; gap: 8px; }
.plan-card-features li { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--on-surface); }
.plan-card-features li .material-symbols-outlined { font-size: 18px; color: var(--secondary); flex-shrink: 0; }

/* ---- Trial banner ---- */
.trial-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--tertiary);
  color: var(--on-tertiary);
  padding: 14px 16px;
  border-radius: var(--radius-xl);
}
.trial-banner .material-symbols-outlined { font-size: 28px; }

/* ---- Upsell / Feature locked banner ---- */
.upsell-banner {
  background: linear-gradient(135deg, rgba(36,42,55,0.06), rgba(142,160,147,0.10));
  border: 1.5px dashed var(--secondary);
  border-radius: var(--radius-xl);
  padding: 22px 18px;
  text-align: center;
}
.upsell-banner .lock-icon { font-size: 32px; color: var(--secondary); margin-bottom: 8px; }
.upsell-banner h4 { font-size: 15px; font-weight: 700; margin-bottom: 4px; color: var(--on-surface); }
.upsell-banner p { font-size: 12px; color: gray; margin-bottom: 14px; line-height: 1.4; }

/* ---- Compliance indicator ---- */
.compliance-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-xl);
  margin-bottom: 12px;
}
.compliance-card.ok { background: rgba(142,160,147,0.15); }
.compliance-card.pending { background: rgba(204,118,91,0.12); }
.compliance-card .material-symbols-outlined { font-size: 26px; }

/* ---- Onboarding ---- */
.onboarding-mode-choice {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.onboarding-mode-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 2px solid var(--surface-variant);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.onboarding-mode-card.selected { border-color: var(--primary); background: rgba(36,42,55,0.05); }
.onboarding-mode-card .material-symbols-outlined { font-size: 28px; color: var(--primary); }
.onboarding-mode-card h4 { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.onboarding-mode-card p { font-size: 12px; color: gray; }

/* ---- Accordion / FAQ ---- */
.accordion { cursor: pointer; }
.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
}
.accordion-body {
  display: none;
  padding: 0 16px 16px;
}
.accordion.open .accordion-body { display: block; }
.accordion.open .accordion-icon { transform: rotate(180deg); }
.accordion-icon { transition: transform var(--transition-normal); }
