:root {
  --bg-main: #0a0e17;
  --bg-card: rgba(18, 26, 44, 0.75);
  --border-color: rgba(255, 255, 255, 0.08);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-heading: #ffffff;
  
  --accent-rose: #f43f5e;
  --accent-emerald: #10b981;
  --accent-blue: #3b82f6;
  --radius-md: 14px;
  --radius-lg: 20px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 16px;
}

.absensi-container {
  width: 100%;
  max-width: 520px;
}

/* Header */
.absensi-header {
  text-align: center;
  margin-bottom: 24px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
  transition: var(--transition);
}

.back-link:hover {
  color: var(--accent-rose);
  transform: translateX(-3px);
}

.header-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-heading);
}

.text-rose {
  color: var(--accent-rose);
}

.header-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 6px;
}

/* Card */
.absensi-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Camera Frame & Animation */
.camera-wrapper {
  position: relative;
  width: 100%;
  height: 280px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #05080f;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

#videoElement {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* Mirror view kamera depan */
}

.camera-placeholder {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
  background: #05080f;
  inset: 0;
  z-index: 2;
}

.camera-placeholder i {
  font-size: 2.2rem;
  color: var(--accent-rose);
}

.scan-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.face-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 180px;
  height: 220px;
  border: 1px dashed rgba(244, 63, 94, 0.4);
  border-radius: 12px;
}

.corner {
  position: absolute;
  width: 16px;
  height: 16px;
  border-color: var(--accent-rose);
  border-style: solid;
}

.top-left { top: -2px; left: -2px; border-width: 3px 0 0 3px; }
.top-right { top: -2px; right: -2px; border-width: 3px 3px 0 0; }
.bottom-left { bottom: -2px; left: -2px; border-width: 0 0 3px 3px; }
.bottom-right { bottom: -2px; right: -2px; border-width: 0 3px 3px 0; }

.scan-line {
  position: absolute;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-rose), transparent);
  box-shadow: 0 0 8px var(--accent-rose);
  top: 0;
  animation: scanning 2.2s ease-in-out infinite;
}

@keyframes scanning {
  0% { top: 10%; opacity: 0; }
  50% { opacity: 1; }
  100% { top: 90%; opacity: 0; }
}

/* Form Styles */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 6px;
}

.form-group label i {
  color: var(--accent-rose);
  margin-right: 4px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.875rem;
  outline: none;
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--accent-rose);
  box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.2);
}

.form-group select option {
  background: #121a2c;
  color: #ffffff;
}

/* Realtime Clock Box */
.live-clock-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  text-align: center;
}

.clock-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.clock-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-rose);
}

/* Buttons */
.button-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-primary {
  background: var(--accent-rose);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: #e11d48;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.35);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* Status Alert */
.status-alert {
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-alert.success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border-color: rgba(16, 185, 129, 0.3);
}

.status-alert.error {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.3);
}

.hidden {
  display: none !important;
}
