/**
 * WaMax Design System — Components
 */

/* 1. Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow-card);
  position: relative;
  transition: box-shadow 200ms var(--ease), border-color 200ms var(--ease);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.card-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

/* 2. Buttons (Strict 44px min touch target, 10px radius, 160ms transitions) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--min-touch-height);
  padding: 10px 20px;
  border-radius: var(--radius-control);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background-color 160ms var(--ease), 
              border-color 160ms var(--ease), 
              color 160ms var(--ease), 
              transform 160ms var(--ease),
              box-shadow 160ms var(--ease);
  user-select: none;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled, .btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Primary Brand Button (Cobalt Blue) */
.btn-primary {
  background: var(--brand);
  color: #ffffff !important;
  border-color: var(--brand);
}

.btn-primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  box-shadow: 0 4px 14px rgba(7, 85, 217, 0.25);
}

/* Secondary Button */
.btn-secondary {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--surface-active);
  border-color: var(--brand);
  color: var(--brand);
}

/* Outline Button */
.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-outline:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-subtle);
}

/* Full-width utility */
.btn-block {
  width: 100%;
}

/* 3. Form Controls */
.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.form-control {
  width: 100%;
  min-height: var(--min-touch-height);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 15px;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(7, 85, 217, 0.15);
  outline: none;
}

.form-control[readonly] {
  background: var(--surface-hover);
  cursor: default;
}

/* 4. Status Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-badge);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.badge-connected {
  color: var(--success);
  background: var(--success-bg);
  border: 1px solid var(--success-border);
}

.badge-warning {
  color: var(--warning);
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
}

.badge-danger {
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
}

.badge-neutral {
  color: var(--muted);
  background: var(--surface-hover);
  border: 1px solid var(--border);
}

/* Status Pulse Dot */
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* 5. Navigation Tab Switcher */
.tab-group {
  display: flex;
  background: var(--surface-hover);
  padding: 4px;
  border-radius: var(--radius-control);
  gap: 4px;
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  min-height: 40px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 160ms var(--ease);
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  background: var(--surface);
  color: var(--brand);
  box-shadow: 0 2px 6px rgba(16, 28, 48, 0.08);
}

/* 6. QR Code Quiet Zone (Brand Mandate: Pure white, zero tint, generous quiet zone) */
.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  margin: 16px 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.qr-image {
  width: 240px;
  height: 240px;
  object-fit: contain;
  display: block;
}

/* 7. Monospace Pairing Code Box */
.pairing-code-box {
  background: var(--surface-hover);
  border: 2px dashed var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  text-align: center;
  margin: 16px 0;
}

.pairing-code-display {
  font-family: var(--font-code);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--brand);
  margin: 12px 0;
  user-select: all;
}

/* 8. Instruction Steps Box */
.instruction-box {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  padding: 16px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  text-align: left;
  margin-top: 16px;
}

.instruction-box ol {
  padding-left: 18px;
  margin: 0;
}

.instruction-box li {
  margin-bottom: 6px;
}

.instruction-box strong {
  color: var(--text);
}

/* 9. Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-control);
  padding: 12px 18px;
  box-shadow: var(--shadow-card);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: wamax-enter 300ms var(--ease);
}
