* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background: #f3f4f6;
  color: #1f2937;
}

button,
input {
  font: inherit;
}

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.card {
  width: 100%;
  max-width: 480px;
  padding: 32px 24px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.1);
}

.header {
  text-align: center;
}

.logo {
  display: block;
  width: auto;
  max-width: 220px;
  max-height: 90px;
  margin: 0 auto 24px;
  object-fit: contain;
}

h1 {
  margin: 0 0 10px;
  font-size: 28px;
}

.subtitle {
  margin: 0 0 24px;
  line-height: 1.5;
  color: #6b7280;
}

.chantier-box,
.worker-box {
  margin-bottom: 18px;
  padding: 18px;
  border-radius: 12px;
  text-align: center;
}

.chantier-box {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
}

.worker-box {
  border: 1px solid #86efac;
  background: #dcfce7;
}

.label {
  margin: 0 0 6px;
  color: #166534;
  font-size: 13px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chantier-name {
  margin: 0;
  color: #14532d;
  font-size: 20px;
  font-weight: bold;
  overflow-wrap: anywhere;
}

.worker-name {
  margin: 8px 0 0;
  color: #166534;
  font-size: 22px;
  font-weight: bold;
}

.success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #16a34a;
  color: #ffffff;
  font-size: 38px;
  font-weight: bold;
}

.status-box {
  margin-bottom: 20px;
  padding: 16px;
  border-radius: 10px;
  text-align: center;
  font-weight: bold;
  line-height: 1.4;
}

.status-waiting {
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #374151;
}

.status-success {
  border: 1px solid #86efac;
  background: #dcfce7;
  color: #166534;
}

.status-error {
  border: 1px solid #fca5a5;
  background: #fee2e2;
  color: #991b1b;
}

.scanner-container {
  margin-bottom: 20px;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #ffffff;
}

#qrReader {
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
}

#qrReader video {
  width: 100% !important;
  border-radius: 8px;
}

.scanner-help {
  margin: 10px 0 2px;
  color: #6b7280;
  font-size: 14px;
  text-align: center;
}

.button-group {
  display: grid;
  gap: 12px;
}

.primary-button,
.secondary-button,
.danger-button,
.neutral-button {
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  border: 0;
  border-radius: 10px;
  font-size: 17px;
  font-weight: bold;
  cursor: pointer;
}

.primary-button {
  background: #1f2937;
  color: #ffffff;
}

.secondary-button {
  background: #166534;
  color: #ffffff;
}

.danger-button {
  background: #b91c1c;
  color: #ffffff;
}

.neutral-button {
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #374151;
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.neutral-button:hover {
  opacity: 0.9;
}

.primary-button:active,
.secondary-button:active,
.danger-button:active,
.neutral-button:active {
  transform: scale(0.99);
}

.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled,
.neutral-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.information {
  margin-top: 24px;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

.information p {
  margin: 8px 0;
}

.hidden {
  display: none !important;
}

@media (max-width: 480px) {
  .page {
    align-items: flex-start;
    padding: 10px;
  }

  .card {
    padding: 24px 16px;
    border-radius: 12px;
  }

  h1 {
    font-size: 24px;
  }

  .logo {
    max-width: 190px;
  }

  .scanner-container {
    padding: 6px;
  }
}
