:root {
  --primary-blue: #1e3a8a;
  --accent-red: #ff5e62;
  --highlight-yellow: #facc15;
  --light-bg: #e6f0fa;
  --white-bg: #ffffff;
  --glass-bg: rgba(255, 255, 255, 0.9);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

body {
  font-family: "Poppins", sans-serif;
  background: linear-gradient(135deg, var(--light-bg), #fef7f5);
  color: var(--primary-blue);
  overflow-x: hidden;
  line-height: 1.6;
  margin: 0;
}

.hero-bg {
  position: relative;
  min-height: 50vh;
  display: flex;
  align-items: center;
  text-align: center;
  color: white;
  background: url("https://img.freepik.com/premium-photo/doctor-medical-equipment-blue-table-with-stethoscope_1091302-34150.jpg?ga=GA1.1.1346594137.1747953076&semt=ais_hybrid&w=740")
    center/cover no-repeat;
  background-attachment: fixed;
}

.hero-overlay {
  background: linear-gradient(
    135deg,
    rgba(30, 58, 138, 0.8),
    rgba(255, 94, 98, 0.8)
  );
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-bg .container {
  position: relative;
  z-index: 2;
}

.hero-bg h1 {
  font-family: "Lora", serif;
  font-weight: 700;
  font-size: 3.5rem;
  text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
}

.navbar {
  background: linear-gradient(
    140deg,
    rgba(30, 58, 138, 1) 0%,
    rgba(30, 58, 138, 0.95) 50%,
    rgba(30, 58, 138, 2) 100%
  );
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--highlight-yellow);
}

.navbar-brand img {
  transition: transform 0.3s ease;
}

.navbar-brand img:hover {
  transform: scale(1.05);
}

.nav-link {
  color: white !important;
  font-weight: 500;
  position: relative;
  transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--highlight-yellow) !important;
}

.nav-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background: var(--highlight-yellow);
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.section-divider {
  height: 6px;
  background: linear-gradient(
    90deg,
    var(--primary-blue),
    var(--highlight-yellow)
  );
  margin: 2rem auto;
  width: 100px;
  border-radius: 3px;
}

.intro-section {
  padding: 3rem 0;
  text-align: center;
  background: var(--white-bg);
  border-radius: 15px;
  box-shadow: var(--shadow);
  margin: 2rem auto;
  max-width: 900px;
}

.form-container {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 2.5rem;
  max-width: 900px;
  margin: 2rem auto;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.form-section {
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  border: 1px solid rgba(30, 58, 138, 0.1);
  transition: all 0.3s ease;
}

.form-section h4 {
  color: var(--primary-blue);
  font-family: "Lora", serif;
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  cursor: pointer;
  position: relative;
}

.form-section h4::after {
  content: "\f078";
  font-family: "Bootstrap Icons";
  position: absolute;
  right: 10px;
  transition: transform 0.3s ease;
}

.form-section.collapsed h4::after {
  transform: rotate(180deg);
}

.form-control,
.form-select {
  border-radius: 10px;
  border: 2px solid var(--primary-blue);
  background: var(--white-bg);
  transition: all 0.3s ease;
  padding: 0.75rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent-red);
  box-shadow: 0 0 10px rgba(255, 94, 98, 0.3);
}

.form-label {
  color: var(--primary-blue);
  font-size: 0.9rem;
  transition: all 0.3s ease;
  position: absolute;
  top: 50%;
  left: 15px;
  transform: translateY(-50%);
  background: var(--white-bg);
  padding: 0 5px;
}

.form-control:not(:placeholder-shown) + .form-label,
.form-control:focus + .form-label,
.form-select:not(:placeholder-shown) + .form-label,
.form-select:focus + .form-label {
  top: 0;
  font-size: 0.8rem;
  color: var(--accent-red);
}

.form-control.is-invalid {
  border-color: #dc3545;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23dc3545' viewBox='0 0 12 12'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cpath stroke='%23dc3545' d='M6 3v6'/%3E%3Cpath stroke='%23dc3545' d='M3 6h6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem);
}

.btn-primary {
  background: linear-gradient(45deg, var(--primary-blue), var(--accent-red));
  border: none;
  border-radius: 12px;
  padding: 1rem 2rem;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 94, 98, 0.4);
}

.btn-outline-primary {
  border-color: var(--primary-blue);
  color: var(--primary-blue);
  border-radius: 10px;
  transition: all 0.3s ease;
}

.btn-outline-primary:hover {
  background: linear-gradient(45deg, var(--primary-blue), var(--accent-red));
  color: white;
  border-color: transparent;
}

.table {
  background: var(--white-bg);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.table th {
  background: linear-gradient(45deg, var(--primary-blue), var(--accent-red));
  color: white;
  font-weight: 600;
  padding: 1rem;
}

.table td {
  padding: 0.75rem;
  vertical-align: middle;
}

.table .form-control {
  margin: 0;
  padding: 0.5rem;
  font-size: 0.9rem;
}

.table tr:hover {
  background: rgba(255, 94, 98, 0.05);
}

.form-control[type="file"] {
  border-style: dashed;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.form-control[type="file"]:hover {
  border-color: var(--accent-red);
  background: rgba(255, 94, 98, 0.05);
}

.form-check-input {
  border: 2px solid var(--primary-blue);
}

.form-check-input:checked {
  background-color: var(--accent-red);
  border-color: var(--accent-red);
}

.footer-bg {
 background: linear-gradient(
    140deg,
    rgba(30, 58, 138, 1) 0%,
    rgba(30, 58, 138, 0.95) 50%,
    rgba(30, 58, 138, 2) 100%
  );  color: white;
  padding: 3rem 0;
}

.social-icon {
  font-size: 1.5rem;
  color: white;
  margin-right: 1rem;
  transition: transform 0.3s ease, color 0.3s ease;
}

.social-icon:hover {
  transform: rotate(360deg);
  color: var(--highlight-yellow);
}

.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(45deg, var(--primary-blue), var(--accent-red));
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0Palindrome Number3s ease, transform 0.3s ease;
}

.back-to-top.visible {
  opacity: 1;
  transform: scale(1);
}

.progress-bar {
  background: linear-gradient(45deg, var(--primary-blue), var(--accent-red));
  border-radius: 10px;
}

#formProgress {
  position: sticky;
  top: 80px;
  z-index: 1000;
  margin-bottom: 1rem;
}

/* Remove white patch and refine floating label for selects */
.form-floating > label {
  background: transparent !important;
}

/* Remove white patch on floating label when select is focused or filled */
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select:focus ~ label,
.form-floating > .form-select:not([value=""]) ~ label,
.form-floating > textarea.form-control:focus ~ label,
.form-floating > textarea.form-control:not(:placeholder-shown) ~ label {
  background: transparent !important;
  color: var(--primary-blue);
}

/* Refine select appearance for floating labels */
.form-floating > .form-select {
  background-color: #fff;
  border-radius: 12px;
  border: 2px solid #1e3a8a;
  padding-top: 1.25rem;
  padding-bottom: 0.25rem;
  min-height: 56px;
  color: #1e3a8a;
  font-size: 1rem;
  transition: border-color 0.3s;
}
.form-floating > .form-select:focus {
  border-color: #ff5e62;
  box-shadow: 0 0 12px rgba(255, 94, 98, 0.15);
  outline: none;
}
.form-select:focus {
  background-color: #fff !important;
}

@media (max-width: 768px) {
  body{
    text-align: center;
  }
  .hero-bg {
    min-height: 40vh;
  }

  .hero-bg h1 {
    font-size: 2.5rem;
  }

  .form-container {
    padding: 1.5rem;
    margin: 1rem;
  }

  .form-section {
    padding: 1rem;
  }

  .table th,
  .table td {
    font-size: 0.85rem;
    padding: 0.5rem;
  }

  .navbar-brand img {
    width: 200px;
  }
}

@media (max-width: 576px) {
  .hero-bg {
    min-height: 30vh;
  }

  .form-container {
    padding: 1rem;
  }

  .form-section h4 {
    font-size: 1.2rem;
  }

  .table-responsive {
    font-size: 0.8rem;
  }
}
