/* VaultMaster — Reusable Components (Design Doc Section 14) */

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  height: 48px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-button);
  font-weight: var(--weight-headline);
  letter-spacing: 0.01em;
  border: none;
  cursor: pointer;
  transition: background-color var(--duration-interaction) var(--ease-interaction),
              border-color var(--duration-interaction) var(--ease-interaction),
              box-shadow var(--duration-interaction) var(--ease-interaction),
              transform var(--duration-interaction) var(--ease-interaction),
              filter var(--duration-interaction) var(--ease-interaction);
}
@media (max-width: 767px) { .btn { height: 56px; font-size: 18px; width: 100%; } }

.btn-primary {
  background: var(--primary);
  color: var(--bg-void);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: var(--glow-button); }
.btn-primary:active { filter: brightness(0.94); box-shadow: none; transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.4; pointer-events: none; }

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-secondary:hover { background: rgba(var(--primary-rgb), 0.10); border-color: rgba(var(--primary-rgb), 0.6); }
.btn-secondary:active { background: rgba(var(--primary-rgb), 0.16); }

.btn-tertiary {
  height: auto;
  padding: 0;
  background: none;
  color: var(--text-secondary);
  font-weight: var(--weight-medium);
  position: relative;
}
.btn-tertiary::after {
  content: '';
  position: absolute;
  left: 0; bottom: -3px;
  width: 0; height: 1px;
  background: currentColor;
  transition: width 150ms var(--ease-interaction);
}
.btn-tertiary:hover { color: var(--text-primary); }
.btn-tertiary:hover::after { width: 100%; }

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
}
.card-lg { padding: var(--space-4); }

.card-interactive {
  transition: border-color var(--duration-interaction) var(--ease-interaction),
              box-shadow var(--duration-interaction) var(--ease-interaction),
              transform var(--duration-interaction) var(--ease-interaction);
}
.card-interactive:hover {
  border-color: var(--border-glow);
  box-shadow: var(--glow-hover);
  transform: translateY(-2px);
}

/* ---- Badges / Pills ---- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.pill-cyan { border-color: rgba(var(--primary-rgb), 0.35); color: var(--primary); }
.pill-green { border-color: rgba(var(--accent-rgb), 0.35); color: var(--accent); }
.pill-neutral { border-color: var(--border); color: var(--text-secondary); }

/* ---- Inputs ---- */
.input {
  height: 48px;
  width: 100%;
  padding: 0 var(--space-2);
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-body);
}
.input::placeholder { color: var(--text-tertiary); }
.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}
.input-error { border-color: var(--danger); }
.field-error {
  margin-top: 4px;
  font-size: var(--text-body-sm);
  color: var(--danger);
}
.field-success {
  margin-top: 4px;
  font-size: var(--text-body-sm);
  color: var(--accent);
}

/* ---- Icon glyphs (inline SVG — no external sprite dependency) ---- */
.icon {
  display: block;
  width: 24px;
  height: 24px;
  color: currentColor;
  stroke: var(--text-secondary);
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.icon-primary { stroke: var(--primary); }
.icon-security { stroke: var(--warn-orange); }
.icon-sm { width: 20px; height: 20px; }

.icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-deep);
  border: 1px solid var(--border);
}

/* status dots */
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--primary);
}
.dot-green { background: var(--accent); }
.dot-orange { background: var(--warn-orange); }

/* ---- Lists ---- */
.list-brand { display: flex; flex-direction: column; gap: var(--space-1); }
.list-brand li {
  position: relative;
  padding-left: 18px;
  color: var(--text-secondary);
}
.list-brand li::before {
  content: '';
  position: absolute;
  left: 0; top: 8px;
  width: 6px; height: 6px;
  background: var(--primary);
}

/* ---- Code / technical inline term ---- */
.code-term {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  color: var(--text-secondary);
  background: var(--bg-deep);
  border-radius: 4px;
  padding: 2px 6px;
}

/* ---- Tables (Comparison section) ---- */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-deep);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.compare-table th, .compare-table td {
  padding: var(--space-2);
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.compare-table thead th {
  font-size: 12px;
  font-weight: var(--weight-headline);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
}
.compare-table .check { color: var(--accent); }

/* ---- Modal / Lightbox ---- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 15, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms var(--ease-reveal);
}
.modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}
.modal-panel {
  background: var(--surface);
  border-radius: var(--radius-xl);
  max-width: 90vw;
  max-height: 90vh;
  padding: var(--space-3);
  position: relative;
  transform: scale(0.96);
  transition: transform 250ms var(--ease-reveal);
  box-shadow: var(--glow-overlay), var(--shadow-device);
}
.modal-backdrop.is-open .modal-panel { transform: scale(1); }
.modal-close {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ---- Tooltip ---- */
.tooltip {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease-interaction);
  z-index: 50;
}
.tooltip.is-visible { opacity: 1; }

/* ---- Device frame wrapper (for CSS-only fallback / caption alignment) ---- */
.device-shot {
  position: relative;
  width: 100%;
}
.device-shot img { width: 100%; height: auto; }
.device-caption {
  margin-top: var(--space-2);
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--text-body-sm);
}
