/* Osnovni reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f5f7;
  color: #222;
  min-height: 100vh;
}

/* Gumbi */
.btn {
  border: none;
  padding: 0.6rem 1.3rem;
  border-radius: 999px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
  white-space: nowrap;
}

.btn.primary {
  background: #e60032;
  color: #fff;
}

.btn.secondary {
  background: #fff;
  border: 1px solid #ccc;
  color: #333;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Layout */
.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.app-header span {
  font-size: 0.95rem;
}

.app-main {
  background: #fff;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

h1,
h2,
h3 {
  margin-bottom: 1rem;
}

.button-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.button-group.bottom {
  margin-top: 1.5rem;
}

/* Forme */
.form-group {
  margin-bottom: 0.9rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="password"] {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 0.95rem;
}

.form-group input.error {
  border-color: #d93025;
  background: #ffecec;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Sporočila */
.error-message {
  color: #d93025;
  font-size: 0.8rem;
  margin-top: 0.15rem;
  min-height: 0.9em;
}

.info-message {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: #555;
}

/* Sekcije */
.hidden {
  display: none;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #fff;
  padding: 1.5rem;
  border-radius: 12px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Kartice za izpis */
.cards-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.card {
  flex: 1 1 260px;
  border-radius: 10px;
  border: 1px solid #ddd;
  padding: 1rem;
  background: #fafafa;
}

.card h3 {
  margin-bottom: 0.6rem;
}

.card-text {
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.card-user {
  font-weight: 600;
  margin-top: 0.3rem;
  margin-bottom: 0.3rem;
}

.card-id,
.card-datetime {
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

.card-logo {
  max-width: 120px;
  margin-bottom: 0.5rem;
}

.card-barcode-text {
  font-family: monospace;
  font-size: 0.9rem;
  margin-top: 0.4rem;
}

/* GDPR kartice centrirane */
.card-gdpr {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card-gdpr .card-text,
.card-gdpr .card-user,
.card-gdpr .card-id,
.card-gdpr .card-datetime {
  text-align: center;
}

/* Gumb Natisni znotraj kartice */
.btn-print {
  margin-top: 0.6rem;
}

/* Print styling: format za print-target */
/* Ctrl+P ne bo več prazen, ker ne skrivamo celega bodyja */
@media print {
  body {
    margin: 0;
  }

  /* Ko tiskamo prek gumbov (body.printing), skrij vse razen .print-target */
  body.printing * {
    visibility: hidden !important;
  }

  body.printing .print-target,
  body.printing .print-target * {
    visibility: visible !important;
  }

  body.printing .print-target {
    position: absolute !important;
    left: 0;
    top: 0;
    width: 80mm; /* ~8 cm termalni papir */
    border: none;
    box-shadow: none;
    background: #fff;
  }

  body.printing .print-target .btn-print {
    display: none !important;
  }
}


/* Status pri skeniranju */
.scan-result {
  margin-top: 1rem;
}

.status-message {
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
}

.status-success {
  color: #0b8a34;
}

.status-error {
  color: #d93025;
}

.scan-counter {
  font-size: 0.9rem;
  margin-bottom: 0.9rem;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 600px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
