/* ============================================================
   vitagent.css — Styles for Vitagent Records form page
   Color basis: sea green (#2E8B57)
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f4f7f5;
  color: #333;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */
.site-header {
  position: relative;
  width: 100%;
  height: 150px;
  background: #2E8B57;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.header-text {
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.header-text h1 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.25rem;
}

.header-text p {
  font-size: 0.9rem;
  letter-spacing: 0.5rem;
  margin-top: 0.15rem;
}

/* ---------- Hamburger ---------- */
.hamburger {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 100;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.hamburger span {
  display: block;
  width: 28px;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100%;
  background: #245e3a;
  z-index: 1000;
  transition: left 0.3s ease;
  padding: 1rem 0;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
}

.sidebar.open {
  left: 0;
}

.sidebar-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  padding: 0.5rem 1.25rem;
  display: block;
  margin-left: auto;
}

.sidebar-links {
  list-style: none;
  margin-top: 1rem;
}

.sidebar-links li a {
  display: block;
  padding: 0.85rem 1.5rem;
  color: #d4f0df;
  text-decoration: none;
  font-size: 1rem;
  transition: background 0.2s;
}

.sidebar-links li a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999;
}

.sidebar-overlay.active {
  display: block;
}

/* ---------- Main Content ---------- */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 1rem;
}

/* ---------- Form Container ---------- */
.form-container {
  width: 100%;
  max-width: 1024px;
  background: #fff;
  border: 2px solid #4A7C2E;
  border-radius: 8px;
  padding: 2rem 2.5rem;
  box-shadow: 0 2px 12px rgba(46, 139, 87, 0.08);
  animation: fadeSlideUp 0.5s ease-out both;
}

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

.form-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: #2E8B57;
  border-bottom: 2px solid #2E8B57;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

/* ---------- Form Rows ---------- */
.form-row {
  margin-bottom: 1.25rem;
}

.form-row--grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

/* ---------- Inline Field ---------- */
.field.inline {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.field.inline label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #2E8B57;
  white-space: nowrap;
}

.field.inline input {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid #b8d8c5;
  border-radius: 4px;
  font-size: 0.95rem;
  color: #333;
  background: #fbfdfb;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field.inline input:focus {
  outline: none;
  border-color: #2E8B57;
  box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.15);
}

/* ---------- Min/Max Field Group ---------- */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
  overflow: hidden;
}

.field-group-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #2E8B57;
  white-space: nowrap;
}

.field-minmax {
  display: flex;
  gap: 0.5rem;
}

.field-minmax-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  align-self: center;
}

.field-minmax input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.6rem;
  border: 1px solid #b8d8c5;
  border-radius: 4px;
  font-size: 0.95rem;
  color: #333;
  background: #fbfdfb;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field-minmax input:focus {
  outline: none;
  border-color: #2E8B57;
  box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.15);
}

/* Full-width field (Patient Name) */
.field--full {
  flex-direction: row !important;
  align-items: center;
  gap: 1rem !important;
}

.field--full label {
  min-width: 120px;
  font-size: 0.9rem;
}

.field--full input {
  flex: 1;
}

/* ---------- Submit Button ---------- */
.form-actions {
  text-align: center;
  margin-top: 1.75rem;
}

.btn-submit {
  background: linear-gradient(135deg, #2E8B57, #3CB371);
  color: #fff;
  border: none;
  padding: 0.7rem 3rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.05rem;
  transition: opacity 0.2s, box-shadow 0.2s;
}

.btn-submit:hover {
  opacity: 0.9;
  box-shadow: 0 4px 14px rgba(46, 139, 87, 0.3);
}

/* ---------- Lightbox ---------- */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox {
  background: #fff;
  border-radius: 8px;
  width: 80%;
  padding: 2rem;
  position: relative;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.lightbox-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.75rem;
  color: #666;
  cursor: pointer;
}

.lightbox-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #2E8B57;
  margin-bottom: 1rem;
  border-bottom: 1px solid #ddd;
  padding-bottom: 0.5rem;
}

.lightbox-body {
  min-height: 120px;
  color: #555;
}

.lightbox-placeholder {
  text-align: center;
  padding: 2rem 0;
  color: #999;
  font-style: italic;
}

/* ---------- Lightbox Judge Mode ---------- */
.lightbox--judge {
  border: 4px solid #2E8B57;
}

.lightbox--stable {
  border-color: #2E8B57;
}

.lightbox--monitor {
  border-color: #E89B2D;
}

.lightbox--escalate {
  border-color: #E53935;
}

.judge-decision {
  text-align: center;
  padding: 0.75rem 0;
  margin-bottom: 1rem;
}

.judge-decision h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #333;
}

.judge-decision--stable h2 span {
  color: #2E8B57;
}

.judge-decision--monitor h2 span {
  color: #E89B2D;
}

.judge-decision--escalate h2 span {
  color: #E53935;
}

.judge-patient-info {
  display: flex;
  justify-content: center;
  gap: 3rem;
  padding: 0.75rem 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
  margin-bottom: 0;
}

.judge-timestamp {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #eee;
  margin-bottom: 1rem;
}

.judge-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.judge-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
}

.judge-value {
  font-size: 1rem;
  font-weight: 500;
  color: #333;
}

.judge-explanation h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #2E8B57;
  margin-bottom: 0.5rem;
}

.judge-explanation-body {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.5;
  background: #f9fbfa;
  border-radius: 4px;
  padding: 0.75rem;
  max-height: 200px;
  overflow-y: auto;
}

/* ---------- Lightbox Error ---------- */
.lightbox-error {
  text-align: center;
  padding: 1.5rem 0;
  color: #c0392b;
  font-weight: 500;
}

.lightbox-error .error-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}

.lightbox-dismiss {
  display: block;
  margin: 1.5rem auto 0;
  background: #2E8B57;
  color: #fff;
  border: none;
  padding: 0.5rem 2rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: opacity 0.2s;
}

.lightbox-dismiss:hover {
  opacity: 0.85;
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 1.25rem 1rem;
  font-size: 0.85rem;
  color: #777;
  border-top: 1px solid #ddd;
  background: #f9fbfa;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .site-header {
    height: 120px;
  }

  .header-text h1 {
    font-size: 1.6rem;
  }

  .header-text p {
    font-size: 0.75rem;
    letter-spacing: 0.3rem;
  }

  .form-container {
    padding: 1.25rem 1rem;
  }

  .form-row--grid {
    grid-template-columns: 1fr;
  }

  .field--full {
    flex-direction: column !important;
    align-items: flex-start;
  }
}

/* 480px already collapses to 1-col via the 768px rule above */
