/* ===== Reset & Base ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  background: #f9f9f9;
  color: #333;
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== Header ===== */
header {
  background: #007B7F;
  color: white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 999;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
}

.top-bar h1 {
  font-size: 1.4rem;
  font-weight: 600;
}

.top-buttons .button {
  padding: 8px 14px;
  background: #20c997;
  border-radius: 6px;
  font-weight: 500;
  transition: background 0.3s ease;
}

.top-buttons .button:hover {
  background: #17a2b8;
}

nav {
  background: #17a2b8;
}

nav ul {
  display: flex;
  list-style: none;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0.5rem 0;
}

nav ul li {
  margin: 0.5rem 1rem;
}

nav ul li a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.3s ease, background 0.3s ease;
  padding: 6px 12px;
  border-radius: 6px;
}

nav ul li a:hover {
  background: rgba(255, 255, 255, 0.2);
}

nav ul li a.active {
  background: rgba(255, 255, 255, 0.25);
}

/* ===== Hero ===== */
.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3rem 2rem;
  background: white;
  flex-wrap: wrap;
  gap: 2rem;
}

.hero-content {
  flex: 1;
  max-width: 500px;
}

.hero h2 {
  font-size: 2.2rem;
  color: #007B7F;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  color: #555;
}

.hero-image img {
  width: 480px;
  max-width: 100%;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ===== About ===== */
.about {
  background: #fff;
  padding: 4rem 2rem;
}

.about-flex {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.about-text {
  flex: 1;
}

.about-text h2 {
  font-size: 2rem;
  color: #007B7F;
  margin-bottom: 1.5rem;
}

.about-text p {
  margin-bottom: 1rem;
  color: #444;
}

.about-image {
  flex: 1;
  text-align: center;
}

.about-image img {
  width: 100%;
  max-width: 450px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* ===== Vision & Mission ===== */
.vision-mission {
  background: #f1fdfd;
  padding: 4rem 2rem;
  text-align: center;
}

.vision-mission h2 {
  font-size: 2rem;
  color: #007B7F;
  margin-bottom: 2.5rem;
  font-weight: 700;
}

.vm-container {
  max-width: 1000px;
  margin: 0 auto;
}

.vm-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}

.vm-card {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  flex: 1 1 420px;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.vm-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.vm-card h3 {
  color: #20c997;
  font-size: 1.4rem;
  margin-bottom: 1rem;
  letter-spacing: 0.5px;
}

.vm-card p {
  color: #444;
  font-size: 1rem;
  line-height: 1.7;
  text-align: justify;
}

/* ===== Why Choose Us ===== */
.choose-us {
  background: #e0f7fa;
  padding: 4rem 2rem;
  text-align: center;
}

.choose-us h2 {
  font-size: 2rem;
  color: #007B7F;
  margin-bottom: 2rem;
}

.choose-grid {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.choose-card {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  flex: 1 1 200px;
  max-width: 220px;
  font-weight: 600;
  color: #007B7F;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.choose-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.18);
}

/* ===== Services ===== */
.services {
  padding: 4rem 2rem;
  background: #fff;
  text-align: center;
}

.services h2 {
  font-size: 2rem;
  color: #007B7F;
  margin-bottom: 2rem;
}

.service-grid {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.service-card {
  background: #f9f9f9;
  padding: 1.8rem;
  border-radius: 12px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  font-weight: 600;
  color: #007B7F;
  flex: 1 1 250px;
  max-width: 280px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

/* ===== Footer ===== */
footer {
  background: #007B7F;
  color: white;
  text-align: center;
  padding: 1.2rem;
  margin-top: auto;
  font-size: 0.9rem;
}

/* ===== Buttons ===== */
.button {
  background: #20c997;
  color: white;
  padding: 10px 18px;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.3s ease, transform 0.2s ease;
}

.button:hover {
  background: #17a2b8;
  transform: translateY(-2px);
}

.hidden {
  display: none;
}

/* ===== Modal (shared) ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
}

.modal.show {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ===== Modal Content ===== */
.modal-content {
  background: #fff;
  padding: 2.5rem;
  border-radius: 16px;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  animation: fadeIn 0.4s ease;
  position: relative;
}

/* ===== Modal Header ===== */
.modal-header {
  text-align: center;
  margin-bottom: 2rem;
}

.modal-header .icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.modal-header h2 {
  font-size: 1.6rem;
  color: #007B7F;
  margin-bottom: 0.3rem;
}

.modal-header .subtitle {
  font-size: 0.95rem;
  color: #666;
}

.close {
  position: absolute;
  right: 18px;
  top: 16px;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  transition: color 0.2s ease;
}

.close:hover {
  color: #000;
}

/* ===== Inputs ===== */
.modal-content label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: #333;
}

.modal-content input,
.modal-content select {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 1.2rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 1rem;
  transition: border 0.2s ease;
}

.modal-content input:focus,
.modal-content select:focus {
  border-color: #20c997;
  outline: none;
  box-shadow: 0 0 6px rgba(32, 201, 151, 0.3);
}

/* ===== Password Field ===== */
.password-field {
  position: relative;
}

.password-field input {
  padding-right: 70px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #007BFF;
  font-size: 0.9rem;
  font-weight: 600;
  user-select: none;
  background: none;
  border: none;
}

.toggle-password.active {
  color: #0056b3;
}

/* ===== Login Button ===== */
.login-btn {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  border-radius: 8px;
  margin-top: 0.5rem;
  background: #20c997;
  color: #fff;
  font-weight: 600;
  border: none;
  transition: background 0.3s ease, transform 0.2s ease;
}

.login-btn:hover {
  background: #17a2b8;
  transform: translateY(-2px);
}

.options {
  margin-top: 1rem;
  text-align: center;
}

.options a {
  font-size: 0.9rem;
  color: #007B7F;
  text-decoration: none;
}

.options a:hover {
  text-decoration: underline;
}

/* ===== Register Link ===== */
.register-link {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.95rem;
}

.register-link a {
  color: #007B7F;
  font-weight: 600;
  text-decoration: none;
}

.register-link a:hover {
  text-decoration: underline;
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ===== Small helper for auth views inside modal ===== */
.auth-view {
  width: 100%;
}

/* Keep consistent spacing for register view inputs */
#registerView input,
#registerView select {
  margin-bottom: 0.8rem;
}

/* ===== Register form scrollable container (added) ===== */
#registerFormContainer {
  max-height: 60vh;       /* limits form height to fit screen */
  overflow-y: auto;       /* enables vertical scrolling */
  padding-right: 10px;    /* prevent scrollbar overlay on content */
  scroll-behavior: smooth;
}

/* scrollbar styling for register container */
#registerFormContainer::-webkit-scrollbar {
  width: 6px;
}

#registerFormContainer::-webkit-scrollbar-thumb {
  background-color: rgba(0, 123, 127, 0.35);
  border-radius: 10px;
}

#registerFormContainer::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 123, 127, 0.65);
}

/* ===== Terms Modal specifics (centered & fixed close) ===== */
.modal-dialog {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 20px;
}

.terms-modal-content {
  width: min(900px, 95%);
  max-width: 900px;
  padding: 28px 28px 18px 28px;
  border-radius: 12px;
}

/* close button fixed inside dialog (will not scroll with .terms-body) */
.terms-close-fixed {
  position: absolute;
  right: 22px;
  top: 18px;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: #666;
  z-index: 20;
}

.terms-close-fixed:hover {
  color: #000;
}

/* scrollable body only */
.terms-body {
  margin-top: 8px;
  max-height: 65vh;
  overflow-y: auto;
  padding-right: 10px;
}

/* style paragraphs & headings inside terms to match theme */
.terms-body h3 { color: #007B7F; margin-bottom: 8px; }
.terms-body h4 { color: #20c997; margin-top: 12px; margin-bottom: 6px; }
.terms-body p { color: #444; margin-bottom: 10px; line-height: 1.6; }

/* ===== Checkbox label layout & hover glow when terms read ===== */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

/* put text inline after the checkbox with proper spacing */
.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #808080; /* default gray until enabled */
}

/* when enabled via JS, apply the clinic accent color and glow */
.checkbox-label.terms-read input[type="checkbox"],
.checkbox-label.terms-read .agree-text {
  accent-color: #20c997;
  box-shadow: 0 0 12px rgba(32,201,151,0.18);
  transition: box-shadow 0.25s ease, transform 0.12s ease;
}

/* gentle hover/glow when terms-read */
.checkbox-label.terms-read:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(32,201,151,0.12);
}

/* small note text */
#termsNote {
  font-size: 0.8rem;
  color: #888;
  display: block;
  margin-top: 6px;
}

/* responsive adjustments */
@media (max-width: 600px) {
  .terms-modal-content { padding: 18px; }
  .terms-body { max-height: 55vh; }
  #registerFormContainer { max-height: 55vh; }
}
