/* ================================================================
   Dokumen Digital Medis - Premium Design System
   ================================================================ */

/* 1. Google Fonts already loaded via link tag in base.html */

/* 2. CSS Reset & Root Variables */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary:         #3b82f6;
  --primary-dark:    #1d4ed8;
  --primary-hover:   #2563eb;
  --secondary:       #10b981;
  --danger:          #ef4444;
  --text-main:       #1e293b;
  --text-muted:      #64748b;
  --border:          #e2e8f0;
  --border-focus:    rgba(59,130,246,0.5);
  --bg-body-start:   #003f88;
  --bg-body-end:     #003f88;
  --surface:         rgba(255,255,255,0.9);
  --shadow-sm:       0 2px 8px rgba(0,0,0,0.07);
  --shadow-md:       0 8px 24px rgba(0,0,0,0.1);
  --shadow-lg:       0 20px 40px rgba(0,0,0,0.12);
  --radius-sm:       8px;
  --radius-md:       12px;
  --radius-lg:       20px;
  --transition:      all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 3. Body & Global */
html, body {
  width: 100%;
  min-height: 100vh;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-main);
  background: linear-gradient(135deg, var(--bg-body-start) 0%, var(--bg-body-end) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5 {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-main);
}

/* 4. Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.9) 0%, rgba(255, 255, 255, 0.9) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(147, 197, 253, 0.5);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.05);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Outfit', sans-serif;
  font-size: 1.375rem;
  font-weight: 700;
  color: #1e3a8a;
  letter-spacing: -0.5px;
  text-decoration: none;
}

.logo-header {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-btn {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-btn:hover {
  color: var(--primary);
  background: rgba(59,130,246,0.08);
}

/* 5. Main Layout */
.main-container {
  max-width: 1200px;
  margin: 2.5rem auto;
  padding: 0 2rem;
}

/* 6. Glass Card */
.glass-card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.glass-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* 7. Section Title */
.section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.text-muted {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* 8. Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.input-field {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  color: var(--text-main);
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

.input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.18);
}

.input-field::placeholder {
  color: #94a3b8;
}

/* 9. Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, #1e3a8a 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59,130,246,0.4);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}

/* 10. Search Result Items */
.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  border-left: 4px solid var(--primary);
  transition: var(--transition);
}

.result-item:last-child {
  margin-bottom: 0;
}

.result-item:hover {
  transform: translateX(4px);
  border-left-color: var(--secondary);
}

/* 11. Info Badge Row */
.info-banner {
  background: linear-gradient(135deg, rgba(59,130,246,0.06) 0%, rgba(16,185,129,0.06) 100%);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.info-banner-item p:first-child {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.info-banner-item p:last-child {
  font-weight: 600;
  font-size: 1rem;
}

/* 12. Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* 13. Empty/Placeholder State */
.empty-state {
  padding: 3rem 2rem;
  text-align: center;
  color: var(--text-muted);
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  background: rgba(248,250,252,0.6);
}

.empty-state p {
  margin-bottom: 0.5rem;
}

/* 14. Signature Canvas Wrapper */
.sig-wrapper {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
  overflow: hidden;
  transition: var(--transition);
}

.sig-wrapper:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

.sig-clear-btn {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.4rem 0;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
}

.sig-clear-btn:hover {
  text-decoration: underline;
}

/* 15. Responsive */
@media (max-width: 768px) {
  .nav-container {
    padding: 0 1rem;
  }
  .main-container {
    padding: 0 1rem;
    margin: 1.5rem auto;
  }
  .glass-card {
    padding: 1.5rem;
    border-radius: var(--radius-md);
  }
  .section-title {
    font-size: 1.4rem;
  }
}

/* 16. Table Responsive */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}
