:root {
  --bg: #0c0f14;
  --panel: #141921;
  --border: #232d3b;
  --orange: #de9b35;
  --text: #d1d5db;
  --muted: #6b7280;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: radial-gradient(#141921 1.5px, transparent 1.5px), var(--bg);
  background-size: 24px 24px;
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
}

/** Nametag Panel */

.card-panel {
  position: relative;
  padding: clamp(1rem, 4vw, 1.5rem);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 25px #0008;
}

.card-panel__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  color: white;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-panel__title-icon {
  width: 16px;
  height: 16px;
  stroke: var(--orange);
  fill: none;
}

/* Nametag input: stuff above it */
.nametag-editor__meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.nametag-editor__label {
  color: var(--muted);
}

.nametag-editor__counter {
  color: white;
}

.limit-reached {
  color: #ef4444 !important;
  animation: pulse 1.5s infinite alternate;
}
@keyframes pulse {
  to {
    opacity: 0.5;
  }
}

/* Nametag input: background & itself */

.physical-plate {
  position: relative;
  height: 52px;
  display: flex;
  align-items: center;
  padding: 0 clamp(2.5rem, 10vw, 3.5rem);

  background: linear-gradient(
    90deg,
    #888e95,
    #f1f3f5 25%,
    #bfc4c9 50%,
    #888e95
  );

  border: 2px solid #525c68;
  border-radius: 5px;

  box-shadow:
    inset 0 1px 0 #ffffffaa,
    0 4px 10px #0008;
}

.physical-plate__rivet {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background: radial-gradient(circle, #718096 20%, #2d3748 70%, #1a202c 95%);
  border: 1.5px solid #4a5568;
  border-radius: 50%;
  box-shadow:
    0 1px 1px rgba(255, 255, 255, 0.4),
    inset 0 1px 2px rgba(0, 0, 0, 0.8);
}

.physical-plate__rivet--left {
  left: 15px;
}
.physical-plate__rivet--right {
  right: 15px;
}

.barcode-sticker__bar {
  background-color: #111827;
  width: 2px;
  height: 100%;
}
.barcode-sticker__bar--thin {
  width: 1px;
}
.barcode-sticker__bar--wide {
  width: 4px;
}

.physical-plate__serial {
  position: absolute;
  left: 45px;
  bottom: 4px;
  font-family: monospace;
  font-size: 7px;
  color: #4b5563;
  letter-spacing: 0.5px;
  font-weight: bold;
  text-transform: uppercase;
  pointer-events: none;
  opacity: 0.7;
}

.physical-plate__input {
  width: 100%;
  background: transparent;
  border: 0;
  outline: 0;
  color: #111827;
  font-family: monospace;
  font-size: clamp(0.8rem, 3vw, 0.95rem);
  text-align: center;
  z-index: 5;
}

/* Nametag input: below */

.nametag-editor__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;

  margin-top: 1rem;
  padding-top: 1rem;

  border-top: 1px solid #ffffff0d;
}

.toggle-switch {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
}

.toggle-switch__input {
  display: none;
}

.toggle-switch__slider {
  position: relative;

  width: 34px;
  height: 18px;

  background: #374151;
  border-radius: 999px;
  transition: 0.2s;
}

.toggle-switch__slider::before {
  content: "";
  position: absolute;

  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;

  background: white;
  border-radius: 50%;
  transition: 0.2s;
}

.toggle-switch__input:checked + .toggle-switch__slider {
  background: var(--orange);
}

.toggle-switch__input:checked + .toggle-switch__slider::before {
  transform: translateX(16px);
}

.toggle-switch__caption {
  font-size: 0.7rem;
}

.toggle-switch__title {
  display: block;
  color: white;
  font-weight: 700;
}

.toggle-switch__subtitle {
  color: var(--muted);
}

.btn-action {
  padding: 0.5rem 1rem;

  background: #1e2530;
  border: 1px solid #374151;
  border-radius: 5px;

  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;

  cursor: pointer;
  transition: 0.15s;
}

.btn-action:hover {
  background: #2b3545;
  border-color: var(--orange);
}

/** Output */

.card-panel--results {
  margin-top: 1.5rem;
  animation: fadeIn 0.2s ease-out;
}

.card-panel__subtitle {
  font-size: 1.1rem;
  color: var(--text-muted, #9a9eab);
  margin: 1.5rem 0 0.75rem 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.validation-summary__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 480px) {
  .validation-summary__grid {
    grid-template-columns: 1fr;
  }
}

.validation-tile--full {
  grid-column: span 2;
}
@media (max-width: 480px) {
  .validation-tile--full {
    grid-column: span 1;
  }
}

.validation-tile {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.validation-tile__label {
  font-size: 0.9rem;
  color: #e2e8f0;
}

.string-preview {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 1.25rem;
}

.string-preview__group {
  margin-bottom: 0.75rem;
}
.string-preview__group:last-child {
  margin-bottom: 0;
}

.string-preview__label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.string-preview__code {
  display: block;
  background: #111;
  color: #f8fafc;
  font-family: "Courier New", Courier, monospace;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  border-left: 3px solid #6366f1;
  word-break: break-all;
}

.string-preview__code--boxed {
  border-left-color: #f59e0b;
}

.metrics-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-tag {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  color: #a5b4fc;
}

.metric-tag__value {
  color: #fff;
  margin-left: 0.25rem;
}

.table-container {
  overflow-x: auto;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.01);
}

.breakdown-table th {
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  font-weight: 600;
  padding: 0.75rem;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.breakdown-table td {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
}

.breakdown-table tbody tr:last-child td {
  border-bottom: none;
}

.breakdown-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/** Info banner */

.card-panel--info {
  margin-bottom: 1rem;
}

.card-panel__info-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card-panel__info-text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #94a3b8;
}

.card-panel__info-text strong {
  color: #f1f5f9;
  font-weight: 600;
}
