/* Guestbook Front Office Styling matching Screenshot 3 */
:root {
  --primary-green: #3d6055;
  --header-bg: #4f7267;
  --accent-mint: #cde4db;
  --body-bg: #e3ebe7;
  --blue-badge: #154c79;
  --blue-gradient: linear-gradient(135deg, #10416c, #1f6aa5);
  --green-gradient: linear-gradient(90deg, #1b5299, #3ca55c);
  --text-dark: #2c3e50;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  background-color: var(--body-bg);
  background-image: 
    radial-gradient(#b8cbca 1px, transparent 1px),
    linear-gradient(to bottom, #dbe7e2, #cbdad4);
  background-size: 20px 20px, 100% 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text-dark);
}

/* Header */
.guest-header {
  background: linear-gradient(180deg, #44685d 0%, #35534a 100%);
  color: #ffffff;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  border-bottom: 3px solid #7cbca6;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-logo {
  height: 52px;
  width: auto;
  max-width: 58px;
  background: #ffffff;
  padding: 3px 6px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  object-fit: contain;
}

.header-titles h1 {
  font-size: 1.25rem;
  letter-spacing: 1px;
  font-weight: 800;
  line-height: 1.2;
}

.header-titles h2 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #c9ede2;
  letter-spacing: 0.5px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.realtime-clock {
  font-size: 0.95rem;
  font-weight: 500;
  color: #e0f2fe;
  background: rgba(0,0,0,0.2);
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.15);
}

.btn-ikm {
  background: #22c55e;
  color: #ffffff;
  padding: 7px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(34, 197, 94, 0.4);
  transition: all 0.2s ease;
}

.btn-ikm:hover {
  background: #16a34a;
  transform: translateY(-1px);
}

.btn-admin-nav {
  background: rgba(255,255,255,0.15);
  color: #ffffff;
  padding: 7px 14px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.25);
  transition: all 0.2s;
}

.btn-admin-nav:hover {
  background: rgba(255,255,255,0.3);
}

/* Secondary mint banner */
.sub-banner {
  background-color: var(--accent-mint);
  height: 18px;
  border-bottom: 1px solid #b6d3c9;
}

/* Main Container */
.guest-container {
  max-width: 1240px;
  width: 95%;
  margin: 24px auto;
  flex: 1;
}

.guest-grid {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 24px;
  align-items: stretch;
}

/* Left welcome card */
.welcome-card {
  background: #ffffff;
  border-radius: 12px;
  border: 2px solid #a3c9be;
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: space-between;
}

.welcome-text h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #475569;
  text-transform: capitalize;
}

.welcome-text h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #15803d;
  margin: 6px 0;
  letter-spacing: 0.5px;
}

.welcome-text p {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.3;
}

.welcome-logo-box {
  width: 100%;
  padding: 16px 0;
  display: flex;
  justify-content: center;
}

.welcome-logo-box img {
  max-width: 190px;
  height: auto;
}

.welcome-instructions {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 12px;
  font-size: 0.78rem;
  color: #166534;
  text-align: left;
  line-height: 1.4;
}

.welcome-instructions ol {
  padding-left: 18px;
  margin-top: 4px;
}

/* Main Form Card */
.form-card {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  border: 1px solid #cbd5e1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-header-gradient {
  background: linear-gradient(90deg, #114b8b 0%, #2e7d32 100%);
  color: #ffffff;
  padding: 12px 20px;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 1px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-content-layout {
  padding: 22px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: start;
}

/* Form inputs styling */
.form-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.input-group {
  display: flex;
  flex-direction: column;
}

.input-group label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 4px;
}

.input-box {
  width: 100%;
  padding: 9px 12px;
  font-size: 0.88rem;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  outline: none;
  transition: all 0.2s;
  background: #ffffff;
}

.input-box:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* Prefixed input row for Bertemu & Keperluan (Blue pill matching screenshot 3) */
.prefixed-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  overflow: hidden;
}

.prefix-badge {
  background: #0f4c81;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.84rem;
  padding: 10px 12px;
  text-align: center;
  user-select: none;
  letter-spacing: 0.5px;
}

.prefix-select {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.88rem;
  border: none;
  outline: none;
  background: #ffffff;
  cursor: pointer;
}

/* Camera Section (Right side of form) */
.camera-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.btn-camera-trigger {
  width: 100%;
  background: #0369a1;
  color: #ffffff;
  border: none;
  border-radius: 5px;
  padding: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  transition: background 0.2s;
}

.btn-camera-trigger:hover {
  background: #0284c7;
}

.camera-viewport {
  width: 280px;
  height: 210px;
  background: #475569;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#webcamVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#photoPreview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.camera-placeholder {
  color: #94a3b8;
  text-align: center;
  font-size: 0.8rem;
  padding: 10px;
}

.camera-controls-mini {
  display: flex;
  gap: 8px;
  width: 100%;
}

.btn-snap, .btn-retake {
  flex: 1;
  padding: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid #cbd5e1;
}

.btn-snap {
  background: #10b981;
  color: #ffffff;
  border-color: #059669;
}

.btn-retake {
  background: #f1f5f9;
  color: #334155;
  display: none;
}

.alt-upload-box {
  width: 100%;
  font-size: 0.75rem;
  color: #64748b;
  text-align: center;
}

.alt-upload-box input {
  font-size: 0.75rem;
  margin-top: 4px;
}

/* Submit Button */
.btn-submit-guest {
  width: 100%;
  background: #334155;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.15);
  transition: all 0.2s;
  margin-top: 8px;
}

.btn-submit-guest:hover {
  background: #1e293b;
  transform: translateY(-1px);
}

/* Footer Banner */
.guest-footer {
  background: #2e6955;
  color: #ffffff;
  text-align: center;
  padding: 12px;
  margin-top: auto;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 1px;
}

.guest-footer a {
  color: #ffffff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Alert Notification */
.alert-popup {
  padding: 12px 18px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.alert-error {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

/* Responsive */
@media (max-width: 900px) {
  .guest-grid {
    grid-template-columns: 1fr;
  }
  .card-content-layout {
    grid-template-columns: 1fr;
  }
  .camera-viewport {
    width: 100%;
    max-width: 320px;
  }
}
