/* Mobile-First Custom Styling for Smart Buku Tamu Kemenhaj Kota Gorontalo */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --primary-brown: #854d0e;
  --primary-brown-dark: #713f12;
  --primary-brown-light: #b45309;
  --accent-gold: #d97706;
  --bg-cream: #faf6f0;
  --bg-card: #ffffff;
  --text-dark: #27180e;
  --text-muted: #6b5344;
}

* {
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-cream);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
}

/* Mobile App Shell Container */
.mobile-app-container {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  box-shadow: 0 4px 30px rgba(120, 53, 15, 0.08);
  position: relative;
  border-left: 1px solid #f3e8dc;
  border-right: 1px solid #f3e8dc;
}

@media (min-width: 640px) {
  .mobile-app-container {
    min-height: 94vh;
    margin: 20px auto;
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid #ebd8c3;
  }
}

/* Touch Button Feedback */
button:active, .touch-btn:active {
  transform: scale(0.97);
  transition: transform 0.1s ease;
}

/* Mobile Camera Viewfinder */
.mobile-scanner-card {
  position: relative;
  background: #0f0a06;
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 8px 24px -4px rgba(120, 53, 15, 0.2);
}

.camera-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 380px;
  background: #140d08;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

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

/* Freeze Frame Container */
#freeze-frame-container {
  position: absolute;
  inset: 0;
  z-index: 15;
  background: #0f0a06;
}

#freeze-frame-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Elegant Glassmorphism Loading Overlay */
.freeze-loading-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(39, 24, 14, 0.85), rgba(20, 13, 8, 0.96));
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 20px;
}

/* AI Orb Pulse Animation (Warm Amber Gold) */
.ai-pulse-orb {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b45309, #d97706, #78350f);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(217, 119, 6, 0.6);
  animation: orbRotate 3s infinite linear;
}

.ai-pulse-orb::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px dashed rgba(251, 191, 36, 0.8);
  animation: spinClockwise 6s infinite linear;
}

@keyframes orbRotate {
  0% { transform: scale(0.95); filter: hue-rotate(0deg); }
  50% { transform: scale(1.06); filter: hue-rotate(25deg); box-shadow: 0 0 45px rgba(245, 158, 11, 0.8); }
  100% { transform: scale(0.95); filter: hue-rotate(0deg); }
}

@keyframes spinClockwise {
  100% { transform: rotate(360deg); }
}

/* Mobile KTP/SIM Guideline Overlay */
.card-guide-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 88%;
  aspect-ratio: 1.586;
  border: 2px dashed rgba(253, 230, 138, 0.8);
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(15, 10, 6, 0.65);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px;
  transition: all 0.3s ease;
}

.card-guide-overlay.scanning {
  border-color: #f59e0b;
  box-shadow: 0 0 0 9999px rgba(15, 10, 6, 0.75), 0 0 24px rgba(245, 158, 11, 0.7);
}

/* Guide Corners */
.guide-corners {
  position: absolute;
  inset: -2px;
  pointer-events: none;
}

.guide-corners::before,
.guide-corners::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: #f59e0b;
  border-style: solid;
}

.guide-corners::before {
  top: 0;
  left: 0;
  border-width: 3.5px 0 0 3.5px;
  border-top-left-radius: 12px;
}

.guide-corners::after {
  bottom: 0;
  right: 0;
  border-width: 0 3.5px 3.5px 0;
  border-bottom-right-radius: 12px;
}

.guide-corners-alt::before,
.guide-corners-alt::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: #f59e0b;
  border-style: solid;
}

.guide-corners-alt::before {
  top: 0;
  right: 0;
  border-width: 3.5px 3.5px 0 0;
  border-top-right-radius: 12px;
}

.guide-corners-alt::after {
  bottom: 0;
  left: 0;
  border-width: 0 0 3.5px 3.5px;
  border-bottom-left-radius: 12px;
}

/* Laser Scanning Line (Warm Amber) */
.scan-laser-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #fbbf24, #d97706, #fbbf24, transparent);
  box-shadow: 0 0 14px #d97706, 0 0 5px #fbbf24;
  display: none;
  z-index: 10;
}

.scanning .scan-laser-line {
  display: block;
  animation: scanLaser 2s infinite ease-in-out;
}

@keyframes scanLaser {
  0% { top: 6%; opacity: 0.3; }
  50% { top: 92%; opacity: 1; }
  100% { top: 6%; opacity: 0.3; }
}

/* Auto-fill Glow Animation (Warm Brown/Gold) */
@keyframes highlightField {
  0% { background-color: rgba(217, 119, 6, 0.2); border-color: #b45309; }
  50% { background-color: rgba(245, 158, 11, 0.15); border-color: #d97706; }
  100% { background-color: #ffffff; }
}

.autofilled-glow {
  animation: highlightField 1.5s ease-out;
  border-color: #b45309 !important;
}

/* Input Fields Mobile Form Styling */
.mobile-input {
  min-height: 46px;
  font-size: 16px;
}

@media (max-width: 640px) {
  .mobile-input {
    font-size: 16px;
  }
}
