* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #e8f4f8 0%, #d1e7f0 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.container {
  width: 100%;
  max-width: 700px;
}

header {
  text-align: center;
  color: #1a5f7a;
  margin-bottom: 40px;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  font-weight: 700;
}

header p {
  font-size: 1.1rem;
  opacity: 0.8;
}

main {
  background: white;
  border-radius: 15px;
  padding: 40px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* TABS */
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  border-bottom: 2px solid #e0e8f0;
}

.tab-btn {
  padding: 12px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: #7a9fb5;
  transition: all 0.3s;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.tab-btn.active {
  color: #1a5f7a;
  border-bottom-color: #1a5f7a;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* FORM */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #2c5f7f;
  font-weight: 600;
}

input[type="text"] {
  width: 100%;
  padding: 12px;
  border: 2px solid #d1e7f0;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

input[type="text"]:focus {
  outline: none;
  border-color: #3a8fb8;
  box-shadow: 0 0 0 3px rgba(58, 143, 184, 0.1);
}

.btn-validate {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #3a8fb8 0%, #2c6f96 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
}

.btn-validate:hover {
  transform: translateY(-2px);
}

.info-box {
  background: #e8f4f8;
  color: #1a5f7a;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 15px;
  font-size: 0.9rem;
  border-left: 4px solid #3a8fb8;
}

/* CAMERA */
.camera-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.btn-camera {
  flex: 1;
  padding: 10px;
  background: #3a8fb8;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s;
  font-size: 0.95rem;
}

.btn-camera:hover {
  background: #2c6f96;
}

.btn-camera.stop {
  background: #c85a54;
}

.btn-camera.stop:hover {
  background: #a84742;
}

#videoContainer {
  display: none;
  margin-bottom: 15px;
}

#video {
  width: 100%;
  height: 400px;
  background: #000;
  border-radius: 8px;
  display: block;
}

#canvas {
  display: none;
}

.error-message {
  background: #fce4ec;
  color: #880e4f;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 15px;
  border-left: 4px solid #c2185b;
}

.success-message {
  background: #e8f5e9;
  color: #1b5e20;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 15px;
  border-left: 4px solid #4caf50;
}

/* STATUS BOX */
.status-box {
  padding: 20px;
  border-radius: 10px;
  margin-top: 30px;
  text-align: center;
}

.status-box.success {
  background: #e8f5e9;
  border-left: 5px solid #4caf50;
}

.status-box.error {
  background: #fce4ec;
  border-left: 5px solid #c2185b;
}

.status-box h2 {
  margin-bottom: 10px;
  font-size: 1.3rem;
}

.status-box.success h2 {
  color: #1b5e20;
}

.status-box.error h2 {
  color: #880e4f;
}

.sertifikat-details {
  background: #f5f9fc;
  border-radius: 10px;
  padding: 20px;
  margin-top: 20px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #d1e7f0;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-weight: 600;
  color: #4a7c99;
}

.detail-value {
  color: #2c5f7f;
  text-align: right;
}

.btn-download {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  margin-top: 20px;
  transition: transform 0.2s;
}

.btn-download:hover {
  transform: translateY(-2px);
}

.admin-link {
  text-align: right;
  margin-top: 20px;
}

.admin-link a {
  color: #3a8fb8;
  text-decoration: none;
  font-size: 0.9rem;
}

.admin-link a:hover {
  text-decoration: underline;
}

footer {
  text-align: center;
  color: #1a5f7a;
  margin-top: 40px;
  font-size: 0.9rem;
  opacity: 0.8;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.8rem;
  }

  main {
    padding: 25px;
  }

  .tabs {
    flex-direction: column;
  }

  .tab-btn {
    border-bottom: none;
    border-left: 3px solid transparent;
    margin-bottom: 0;
    padding-left: 15px;
  }

  .tab-btn.active {
    border-left-color: #1a5f7a;
    border-bottom-color: transparent;
  }

  .detail-row {
    flex-direction: column;
    gap: 5px;
  }

  .detail-value {
    text-align: left;
  }

  #video {
    height: 300px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px;
  }

  header h1 {
    font-size: 1.5rem;
  }

  main {
    padding: 15px;
    border-radius: 10px;
  }

  .sertifikat-details {
    padding: 15px;
  }

  .detail-row {
    padding: 10px 0;
  }
}
