/* DEL-MediCare Custom Stylesheet - High-End Futuristic UI/UX */

/* Base Typography */
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

@keyframes scaleUp {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes floatSlow {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes pulseRing {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.45);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(37, 99, 235, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

@keyframes pulseGlowEmerald {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@keyframes pulseGlowOrange {
  0% {
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.5);
  }
  70% {
    box-shadow: 0 0 0 14px rgba(249, 115, 22, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0);
  }
}

@keyframes gradientShine {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes holographicShimmer {
  0% {
    border-color: rgba(6, 182, 212, 0.5);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
  }
  50% {
    border-color: rgba(168, 85, 247, 0.6);
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.25);
  }
  100% {
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
  }
}

.animate-scale-up {
  animation: scaleUp 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-in-up {
  animation: fadeInUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slide-in-right {
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-float {
  animation: floatSlow 5s ease-in-out infinite;
}

.pulse-ring-blue {
  animation: pulseRing 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

.pulse-ring-emerald {
  animation: pulseGlowEmerald 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

.pulse-ring-orange {
  animation: pulseGlowOrange 1.8s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

.btn-gradient-shine {
  background-size: 200% 200%;
  animation: gradientShine 3s ease infinite;
}

.holographic-card {
  animation: holographicShimmer 6s infinite ease-in-out;
}

/* Glassmorphism Classes */
.glass-panel {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.glass-card-dark {
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.glass-pill {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Stepper Connector Lines */
.stepper-connector {
  position: absolute;
  top: 18px;
  left: 50%;
  right: -50%;
  height: 3px;
  z-index: 0;
}

/* Floating Label Styles */
.floating-group {
  position: relative;
}

.floating-input {
  width: 100%;
  padding-top: 1.25rem;
  padding-bottom: 0.5rem;
}

.floating-input:focus ~ .floating-label,
.floating-input:not(:placeholder-shown) ~ .floating-label {
  transform: translateY(-0.85rem) scale(0.85);
}

.floating-label {
  position: absolute;
  left: 2.5rem;
  top: 0.95rem;
  pointer-events: none;
  transform-origin: 0 0;
  transition: transform 0.15s ease-out, color 0.15s ease-out;
  color: #94a3b8;
  font-size: 0.8125rem;
}

/* Driver Night Mode High-Contrast Theme */
.driver-night-mode {
  background-color: #0b1120 !important;
  color: #f1f5f9 !important;
}

.driver-night-mode .bg-white {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}

.driver-night-mode .bg-slate-50 {
  background-color: #0f172a !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}

.driver-night-mode .text-slate-800,
.driver-night-mode .text-slate-900 {
  color: #f8fafc !important;
}

.driver-night-mode .text-slate-600,
.driver-night-mode .text-slate-500 {
  color: #94a3b8 !important;
}

.driver-night-mode .border-slate-200 {
  border-color: #334155 !important;
}

/* Doctor Digital Signature Stamp */
.doctor-stamp {
  display: inline-block;
  padding: 4px 10px;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 800;
  color: #059669;
  border: 2px dashed #059669;
  border-radius: 6px;
  transform: rotate(-3deg);
  letter-spacing: 0.05em;
  background: rgba(16, 185, 129, 0.08);
}

/* Custom Scrollbar for clean UI */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Print Styling for Surat Sakit */
@media print {
  body * {
    visibility: hidden;
  }
  #printable-surat, #printable-surat * {
    visibility: visible;
  }
  #printable-surat {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 20px;
    box-shadow: none;
    border: none;
  }
}

/* Medical Tech Portal Specific Styling (Split Screen 45:55 Modern Indonesian Health-Tech) */
.bg-mesh-medical {
  background: 
    radial-gradient(at 10% 20%, rgba(209, 250, 229, 0.75) 0px, transparent 50%),
    radial-gradient(at 90% 80%, rgba(204, 251, 241, 0.65) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(240, 253, 244, 0.85) 0px, transparent 65%),
    linear-gradient(150deg, #f0fdf4 0%, #ecfdf5 45%, #f8fafc 100%);
}

.dot-grid-pattern {
  background-image: radial-gradient(#10b981 1.2px, transparent 1.2px);
  background-size: 20px 20px;
  mask-image: linear-gradient(to right, transparent, black 35%);
  -webkit-mask-image: linear-gradient(to right, transparent, black 35%);
  opacity: 0.15;
}

.glass-card-portal {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 20px 40px -15px rgba(5, 150, 105, 0.08), 0 0 30px rgba(255, 255, 255, 0.8) inset;
}

/* ==========================================================================
   DEL-MEDICARE CINEMATIC INTRO SPLASH SCREEN
   3-Stage High-End Transition into Portal Masuk Terpadu:
   1. Tahap 1 (Teks Merenggang): Layar bersih, teks DEL-MediCare fade-in + wide letter-spacing
   2. Tahap 2 (Menyatu ke Dalam Kartu/Kotak): Merapat halus, kartu gradasi IT Del muncul, teks putih, tagline muncul
   3. Tahap 3 (Zoom Penuh & Transisi ke Halaman Login): Zoom-in skala penuh & transisi mulus ke portal login
   ========================================================================== */

#del-splash-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #f8fafc;
  transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  -webkit-user-select: none;
}

/* Dynamic ambient radial aura */
.splash-ambient-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(224, 242, 254, 0.85) 0%, rgba(240, 249, 255, 0.6) 45%, #f8fafc 80%);
  pointer-events: none;
  transition: opacity 0.6s ease;
}

/* Subtle medical cross-dot grid texture */
.splash-grid-overlay {
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(rgba(15, 76, 129, 0.08) 1.5px, transparent 1.5px),
    radial-gradient(rgba(2, 132, 199, 0.06) 1.5px, transparent 1.5px);
  background-size: 28px 28px;
  background-position: 0 0, 14px 14px;
  pointer-events: none;
}

/* Central Card Wrapper */
#splash-card-wrapper {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 1.5rem;
}

/* Morphing Card */
.splash-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 28px;
  box-shadow: none;
  padding: 1.5rem 2rem;
  max-width: 92vw;
  width: auto;
  transform-origin: center center;
  will-change: transform, background, box-shadow, border-radius;
  transition: 
    background 0.75s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.75s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.75s cubic-bezier(0.16, 1, 0.3, 1),
    padding 0.75s cubic-bezier(0.16, 1, 0.3, 1),
    width 0.75s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.85s cubic-bezier(0.7, 0, 0.2, 1),
    border-radius 0.6s ease;
}

/* Card inner shimmer effect */
@keyframes splashShimmerWave {
  0% { transform: translateX(-150%) rotate(25deg); }
  100% { transform: translateX(250%) rotate(25deg); }
}

.splash-card-shimmer {
  position: absolute;
  inset: -100px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  opacity: 0;
  transform: translateX(-150%) rotate(25deg);
  pointer-events: none;
}

/* Card Watermark */
.splash-watermark {
  opacity: 0;
  transition: opacity 0.8s ease;
}

/* Institutional Badge */
.splash-badge {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

/* Stage 1: Text Merenggang (Wide Letter-Spacing & Fade-In) */
.splash-title {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.36em; /* Merenggang */
  white-space: nowrap;
  transform-origin: center center;
  opacity: 0;
  transform: scale(0.96) translateY(4px);
  transition: 
    letter-spacing 0.85s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.65s ease-out,
    transform 0.65s ease-out;
  will-change: letter-spacing, opacity, transform;
}

@media (max-width: 640px) {
  .splash-title {
    letter-spacing: 0.22em;
  }
}

/* Initial Text Colors (Clean & Medical Fresh Green) */
.splash-del {
  color: #064e3b; /* IT Del Forest Green */
  transition: color 0.6s ease, text-shadow 0.6s ease;
}

.splash-dash {
  color: #10b981; /* Fresh Emerald Green */
  margin: 0 0.05em;
  transition: color 0.6s ease, text-shadow 0.6s ease;
}

.splash-medicare {
  color: #059669; /* Primary Klinik Del Green */
  transition: color 0.6s ease, text-shadow 0.6s ease;
}

/* Tagline Wrapper */
.splash-tagline-wrapper {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease-out 0.15s, transform 0.6s ease-out 0.15s;
}

/* State 1 Active */
#del-splash-screen.stage-1 .splash-title {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* State 2 Active: Menyatu ke Dalam Kartu/Kotak */
#del-splash-screen.stage-2 .splash-card {
  background: linear-gradient(135deg, #064e3b 0%, #059669 48%, #10b981 100%);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 
    0 25px 60px -12px rgba(5, 150, 105, 0.45),
    0 0 45px rgba(16, 185, 129, 0.25),
    inset 0 1px 1px rgba(255, 255, 255, 0.35);
  border-radius: 28px;
  padding: 2.5rem 3.5rem;
  width: 580px;
}

@media (max-width: 640px) {
  #del-splash-screen.stage-2 .splash-card {
    padding: 2rem 1.5rem;
    width: 92vw;
  }
}

#del-splash-screen.stage-2 .splash-card-shimmer {
  opacity: 1;
  animation: splashShimmerWave 2.2s ease-in-out infinite;
}

#del-splash-screen.stage-2 .splash-watermark {
  opacity: 0.12;
}

#del-splash-screen.stage-2 .splash-badge {
  opacity: 1;
  transform: translateY(0);
}

/* Text Merapat ke Tengah */
#del-splash-screen.stage-2 .splash-title {
  letter-spacing: -0.01em; /* Merapat */
}

/* Text Colors Morph to Crisp Pure White */
#del-splash-screen.stage-2 .splash-del {
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

#del-splash-screen.stage-2 .splash-dash {
  color: #a7f3d0;
  text-shadow: 0 0 12px rgba(167, 243, 208, 0.6);
}

#del-splash-screen.stage-2 .splash-medicare {
  color: #ffffff;
  text-shadow: 0 0 16px rgba(110, 231, 183, 0.5), 0 2px 10px rgba(0, 0, 0, 0.25);
}

#del-splash-screen.stage-2 .splash-tagline-wrapper {
  opacity: 1;
  transform: translateY(0);
}

/* State 3 Active: Zoom Penuh & Transisi ke Halaman Login */
#del-splash-screen.stage-3 .splash-card {
  transform: scale(34);
  border-radius: 0;
  box-shadow: none;
}

@media (max-width: 640px) {
  #del-splash-screen.stage-3 .splash-card {
    transform: scale(42);
  }
}

/* Inner contents fade out fast during full zoom so it doesn't stretch or pixelate */
#del-splash-screen.stage-3 .splash-card > * {
  opacity: 0 !important;
  transition: opacity 0.2s ease-out;
}

/* Full overlay fade out */
#del-splash-screen.stage-fade-out {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Skip Button Quick Dissolve */
#del-splash-screen.splash-skip-fade {
  opacity: 0 !important;
  transition: opacity 0.18s ease-out !important;
  pointer-events: none !important;
}

/* Sleek Skip Button (Pill Glassmorphic) */
.splash-skip-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 100000;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(203, 213, 225, 0.8);
  box-shadow: 0 4px 14px rgba(15, 76, 129, 0.08);
  color: #334155;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}

.splash-skip-btn:hover {
  background: #ffffff;
  color: #059669;
  border-color: rgba(167, 243, 208, 0.9);
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.16);
  transform: translateY(-1px) scale(1.04);
}

.splash-skip-btn:active {
  transform: scale(0.96);
}

@media (max-width: 640px) {
  .splash-skip-btn {
    bottom: 1rem;
    right: 1rem;
    padding: 0.4rem 0.85rem;
    font-size: 0.7rem;
  }
}
