@font-face {
  font-family: 'Inter';
  src: url('./assets/Inter/Inter-VariableFont_opsz\,wght.ttf')
    format('truetype');
  font-weight: 100 1000;
}

/* General styles */
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  /* font-family: 'ui-sans-serif', 'Inter', sans-serif; */
  font-family: 'Inter', sans-serif;
  background-color: var(--white);
  color: #333;
  height: 100vh;
}

button,
textarea {
  font-family: inherit !important;
}

:root {
  --green: #68e095;
  --grey: #d9d9d9;
  --lightGrey: #fafafa;
  --blue: #335df3;
  --white: #ffffff;
  --black: #000000;
}

.patient-info-brief {
  display: flex;
  flex-direction: column;
}

.patient-time {
  font-size: 0.9em;
  color: #999;
}

/* 🆕 Healthie Patient Grouping Styles */
.healthie-patient-group {
  flex-direction: column;
  align-items: flex-start;
  padding: 0 !important;
  border-bottom: 1px solid #ddd;
}

.healthie-patient-header {
  display: flex;
  align-items: center;
  /* padding: 0; */
  padding: 0.75rem 1rem;
  border-radius: 8px;

  width: 100%;
  cursor: pointer;
  gap: 8px;
  transition: background-color 0.2s;
}

.healthie-patient-header:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.healthie-expand-icon {
  font-size: 12px;
  color: #666;
  transition: transform 0.2s;
  min-width: 12px;
}

.healthie-patient-name {
  font-weight: 600;
  flex: 1;
  color: var(--blue); /* Blue color for Healthie patients */
}

.healthie-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--blue);
  background-color: rgba(51, 93, 243, 0.1);
  padding: 3px 7px;
  border-radius: 4px;
  line-height: 1;
  min-width: 20px;
  text-align: center;
}

.healthie-encounter-count {
  font-size: 11px;
  color: #666;
  font-weight: 500;
}

.healthie-encounter-list {
  width: 100%;
  list-style: none;
  padding: 0;
  margin: 0;
  background-color: rgba(0, 0, 0, 0.02);
  border-top: 1px solid #eee;
}

.healthie-encounter-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 10px 10px 35px;
  /* border-bottom: 1px solid #eee; */
  cursor: pointer;
  transition: background-color 0.2s;
}

.healthie-encounter-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* .healthie-encounter-item:last-child {
  border-bottom: none;
} */

/* 🆕 Athena Patient Grouping Styles (same pattern as Healthie) */
.athena-patient-group {
  flex-direction: column;
  align-items: flex-start;
  padding: 0 !important;
  border-bottom: 1px solid #ddd;
}

.athena-patient-header {
  display: flex;
  align-items: center;
  /* padding: 12px 10px; */
  padding: 0.75rem 1rem;

  width: 100%;
  cursor: pointer;
  gap: 8px;
  transition: background-color 0.2s;
}

.athena-patient-header:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.athena-expand-icon {
  font-size: 12px;
  color: #666;
  transition: transform 0.2s;
  min-width: 12px;
}

.athena-patient-name {
  font-weight: 600;
  flex: 1;
  color: #2563eb; /* Athena blue (different from Healthie green) */
}

.athena-badge {
  font-size: 10px;
  font-weight: 700;
  color: #2563eb;
  background-color: rgba(37, 99, 235, 0.1);
  padding: 3px 7px;
  border-radius: 4px;
  line-height: 1;
  min-width: 20px;
  text-align: center;
}

.athena-encounter-count {
  font-size: 11px;
  color: #666;
  font-weight: 500;
}

.athena-encounter-list {
  width: 100%;
  list-style: none;
  padding: 0;
  margin: 0;
  background-color: rgba(0, 0, 0, 0.02);
  border-top: 1px solid #eee;
}

.athena-encounter-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 10px 10px 35px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background-color 0.2s;
}

.athena-encounter-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.athena-encounter-item:last-child {
  border-bottom: none;
}

.encounter-date {
  font-size: 12px;
  color: #666;
  font-weight: 400;
}

.patient-status {
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.8em;
  text-transform: uppercase;
}

.patient-status.pending {
  background-color: #ffecb3;
  color: #ff9800;
}

.patient-status.in-progress {
  background-color: #bbdefb;
  color: #2196f3;
}

.patient-status.completed {
  background-color: #c8e6c9;
  color: #4caf50;
}

/* Right sidebar styles */
.right-sidebar {
  position: fixed;
  right: 0;
  top: 0;
  width: 250px;
  height: 100%;
  background-color: #ffffff;
  border-left: 1px solid #ddd;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
  resize: horizontal;
  min-width: 180px;
  max-width: 400px;
}

.right-sidebar.hidden {
  display: none;
}

/* Resizer handle for the right sidebar */
.right-sidebar-resizer {
  display: none;
  position: fixed;
  top: 0;
  bottom: 0;
  width: 10px;
  cursor: ew-resize;
  z-index: 1001;
  background: transparent;
}

/* Optional: Hover effect for the resizer */
.right-sidebar-resizer:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

/* Container styles */
.container {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}

.container h1 {
  margin-top: 0;
}

/* Patient info styles */
.patient-info .info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

/* Controls styles */
.controls {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

.control-group {
  flex: 1;
}

/* Buttons */
button {
  padding: 10px 20px;
  font-size: 1em;
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown .dropbtn {
  padding: 10px 20px;
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background-color: #fff;
  min-width: 200px;
  box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.3);
  z-index: 1;
}

.dropdown-content .dropdown-item {
  padding: 10px 20px;
  text-align: left;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
}

.dropdown-content .dropdown-item:hover {
  background-color: #f1f1f1;
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* Additional styles */
.status {
  margin-top: 10px;
  font-size: 0.9em;
  color: #999;
}

.download-buttons {
  margin-top: 10px;
}

.download-buttons button {
  padding: 10px;
  font-size: 1em;
  cursor: pointer;
}

.toggle-btn {
  background-color: #007bff;
  color: #fff;
  border: none;
  cursor: pointer;
  padding: 5px 10px;
  font-size: 16px;
  border-radius: 4px;
}

/* Style for the logout button */

/* Style for the settings button */
#settings-button {
  /* margin-bottom: 10px; */
  border: none;
  background-color: transparent;
}

/* Hide eCW direct access banner */
#ecw-direct-access-banner {
  display: none !important;
}

/* Hide settings button on mobile */
@media (max-width: 768px) {
  #settings-button {
    display: none;
  }
}

#patient-details {
  margin: 20px;
  display: none;
}

.patient-info-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.patient-info-table th,
.patient-info-table td {
  padding: 8px;
  border: 1px solid #ddd;
  text-align: left;
}

.notes-list .note {
  margin-bottom: 20px;
}

.notes-list .note h4 {
  margin-bottom: 5px;
}

.notes-list .note p {
  white-space: pre-wrap;
}

/* Sidebar styles (left and right) */
.right-sidebar {
  width: 250px; /* Changed from 250px */
  /* padding: 20px; */
  padding-left: 0;
  padding-right: 0;
  box-sizing: border-box;
  overflow-y: auto;
}

.right-sidebar {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
}

/* Ensure patient details content fits and scrolls if needed */
#patient-details {
  max-width: 100%;
  overflow: auto;
}

/* Ensure sidebars are above the main content if needed */
.right-sidebar {
  z-index: 1;
}

/* Add this to your CSS file */
.red-button {
  background-color: red;
  color: white;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 5px;
}

.red-button:hover {
  background-color: darkred;
}

.right-sidebar {
  transition:
    display 0.3s ease,
    width 0.3s ease;
}

/* Mobile Styles */
@media (max-width: 768px) {
  /* Adjust sidebar styles */
  .right-sidebar {
    position: fixed;
    width: 85%;
    max-width: 300px;
    height: 100vh;
    left: 0;
    bottom: 0;
    z-index: 100;
    background-color: #ffffff;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    /* Optimize sidebar padding for mobile */
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    /* Add these properties to prevent scrolling issues */
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
  }

  /* Show sidebar when active */
  .right-sidebar.show {
    transform: translateX(0);
    /* When visible, ensure it handles its own scrolling without affecting the main content */
    overscroll-behavior: contain;
  }

  .patient-info {
    flex-direction: column;
  }

  /* Hide Dark Mode Toggle and Codes Sidebar Toggle buttons on mobile */
  #darkModeToggle,
  #toggleCodesButton {
    display: none !important;
  }
}

/* Optional: Smooth transitions for sidebar toggle */
.right-sidebar {
  transition: all 0.3s ease;
}

/* Hide sidebars when the 'hidden' class is added */
.right-sidebar.hidden {
  display: none;
}

.right-sidebar.hidden + .main-content {
  margin-right: 0;
}

/* Style for the Register button */
#register-button {
  background-color: #28a745; /* Green background */
  color: white;
  border: none;
  padding: 12px 20px;
  cursor: pointer;
  border-radius: 5px;
  font-size: 1em;
}

#register-button:hover {
  background-color: #218838; /* Darker green on hover */
}

/* Enhance the login and register forms */
#auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%; /* Ensures the container takes full width */
  min-height: 100vh; /* Full viewport height */
  background-color: #f0f2f5; /* Match body background */
}

.auth-form {
  max-width: 400px;
  width: 100%;
  margin: 0 auto; /* Centers the form within the container */
  padding: 30px;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
}

.auth-form h2 {
  text-align: center;
  margin-bottom: 20px;
}

.auth-form input {
  width: 100%;
  padding: 12px 10px;
  margin-bottom: 15px;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.auth-form button {
  width: 100%;
  padding: 12px 20px;
  font-size: 1em;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

#login-button {
  background-color: #007bff; /* Blue background */
  color: white;
}

#login-button:hover {
  background-color: #0069d9; /* Darker blue on hover */
}

/* Links styling */
.auth-form a {
  color: #007bff;
  text-decoration: none;
}

.auth-form a:hover {
  text-decoration: underline;
}

/* Text alignment for links */
.auth-form p {
  text-align: center;
  margin-bottom: 10px;
}

/* Responsive styles for mobile devices */
@media (max-width: 600px) {
  #auth-container {
    padding: 20px;
  }

  .auth-form {
    width: 100%;
    max-width: none;
    padding: 15px;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    border: none;
  }

  .auth-form h2 {
    font-size: 1.5em;
  }

  .auth-form input,
  .auth-form button {
    font-size: 1em;
    padding: 10px;
  }

  .auth-form p {
    font-size: 0.9em;
  }
}

/* Unified Note Output Styling for All Note Types */
.soap-output,
.progress-note-output,
.visit-summary-output,
.diagnostic-insights-output,
.psych-note-output,
.mental-health-note-output,
.pain-mgmt-note-output,
.chiro-note-output,
.code-note-output,
.clarity-note-output,
.nascentia-note-output,
.care2u-note-output,
.dietitian-group-note-output,
.timothy-groth-note-output,
.noma-therapy-note-output,
.samaritan-palliative-note-output,
.samaritan-primary-care-note-output,
.athena-note-output {
  width: 100%;
  flex: 1;
  min-height: 0;
  padding: 20px;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  box-sizing: border-box;
}

/* CARE2U Note Container */
.care2u-note-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* CARE2U Rich Text Output Styling */
.care2u-rich-text {
  cursor: text;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border-radius: 0 0 8px 8px;
}
.care2u-rich-text strong,
.care2u-rich-text b {
  font-weight: 700;
}
.care2u-rich-text u {
  text-decoration: underline;
}

/* CARE2U Format Toolbar */
.care2u-format-toolbar {
  display: flex;
  gap: 4px;
  padding: 6px 8px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
}
.care2u-format-toolbar .format-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  color: #555;
  cursor: pointer;
  transition: all 0.15s ease;
}
.care2u-format-toolbar .format-btn:hover {
  background: #e8e8e8;
  border-color: #999;
  color: #333;
}
.care2u-format-toolbar .format-btn:active {
  background: #ddd;
}
.care2u-format-toolbar .format-btn i {
  font-size: 12px;
}

/* Dark mode for Care2U format toolbar */
body.dark-mode .care2u-format-toolbar {
  background: #2a3a4f;
  border-color: #3a4f69;
}
body.dark-mode .care2u-format-toolbar .format-btn {
  background: #1b263b;
  border-color: #3a4f69;
  color: #e0e0e0;
}
body.dark-mode .care2u-format-toolbar .format-btn:hover {
  background: #3a4f69;
  border-color: #5a7f99;
}

/* Mobile: hide toolbar; with toolbar gone all corners of rich text are rounded */
@media (max-width: 768px) {
  .care2u-format-toolbar {
    display: none;
  }
  .care2u-rich-text {
    border-radius: 8px;
  }
}

/* CARE2U Status Message Styling */
.care2u-status-message {
  background-color: #e3f2fd;
  border: 1px solid #2196f3;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 8px 0;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #1976d2;
  display: flex;
  align-items: center;
  gap: 8px;
}

.care2u-status-message i {
  color: #2196f3;
}

/* Ensure right sidebar is visible on larger screens */
@media (min-width: 769px) {
  .right-sidebar {
    display: block !important;
  }
  /* Override to hide the sidebar when the "hidden" class is present */
  .right-sidebar.hidden {
    display: none !important;
  }
}

/* Optional mobile adjustments (if needed, uncomment below)
@media (max-width: 768px) {
  .right-sidebar {
    display: block !important;
  }
}
*/

/* Dark Mode Styles */
body.dark-mode {
  background-color: #0d1b2a; /* Changed to a dark blue background */
  color: #e0e0e0;
}

/* Dark mode link colors */
body.dark-mode a {
  color: #bb86fc;
}

/* Dark mode for sidebars */
body.dark-mode .right-sidebar {
  background-color: #1b263b; /* Dark blue for sidebars */
}

/* Dark mode for authentication forms */
body.dark-mode .auth-form {
  background-color: #1b263b; /* Dark blue for auth forms */
  border-color: #2a3a4d; /* Blue-toned border */
  color: #e0e0e0;
}

/* Dark mode for inputs and textareas */
body.dark-mode input,
body.dark-mode textarea {
  background-color: #243447; /* Slightly lighter dark blue for inputs */
  color: #e0e0e0;
  border-color: #3a4f69; /* Blue-toned border */
}

/* Dark mode buttons */
body.dark-mode button {
  background-color: #243447; /* Use the same blue as inputs for consistency */
  color: #e0e0e0;
}

/* Dark mode dropdown */
body.dark-mode .dropdown-content {
  background-color: #1b263b; /* Consistent dark blue for dropdowns */
}

/* Dark mode note outputs */
body.dark-mode .output,
body.dark-mode .soap-output,
body.dark-mode .progress-note-output,
body.dark-mode .visit-summary-output,
body.dark-mode .diagnostic-insights-output,
body.dark-mode .psych-note-output,
body.dark-mode .mental-health-note-output,
body.dark-mode .pain-mgmt-note-output,
body.dark-mode .chiro-note-output,
body.dark-mode .code-note-output,
body.dark-mode .clarity-note-output,
body.dark-mode .nascentia-note-output,
body.dark-mode .care2u-note-output,
body.dark-mode .dietitian-group-note-output,
body.dark-mode .timothy-groth-note-output,
body.dark-mode .noma-therapy-note-output,
body.dark-mode .samaritan-palliative-note-output,
body.dark-mode .samaritan-primary-care-note-output {
  background-color: #1b263b; /* Dark blue background for outputs */
  color: #e0e0e0;
  border-color: #3a4f69; /* Matching blue-toned border */
}

/* Dark mode for Noma Therapy note containers */
body.dark-mode .noma-therapy-note-container {
  background-color: #1b263b;
  color: #e0e0e0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

/* Dark mode for Samaritan note containers */
body.dark-mode .samaritan-palliative-note-container,
body.dark-mode .samaritan-primary-care-note-container {
  background-color: #1b263b;
  color: #e0e0e0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

/* More white text in dark mode for captions */
body.dark-mode #captions {
  color: #ffffff;
}

/* Dark Mode Toggle Button Styling */
#darkModeToggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  position: fixed;
  right: 10px;
  font-size: 1.5rem;
  color: #333;
  z-index: 1001;
}

body.dark-mode #darkModeToggle {
  color: #e0e0e0;
}

/* Codes Sidebar Toggle Button Styling */
#toggleCodesButton {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  position: fixed;
  top: 110px; /* Updated to position below dark mode button */
  right: 10px;
  font-size: 1.5rem;
  color: #333;
  z-index: 1001;
}

body.dark-mode #toggleCodesButton {
  color: #e0e0e0;
}

/* Expanded state for the right-sidebar (50% wider than default 250px) */
.right-sidebar.expanded {
  width: 375px !important;
}

/* Styling for error notices */
.error-notice {
  background-color: #ffcccc;
  padding: 10px;
  border: 1px solid #ff0000;
  margin-bottom: 10px;
  color: #333;
}

/* Dark mode override for error notices */
body.dark-mode .error-notice {
  background-color: #4f1f1f;
  border-color: #ff5555;
  color: #e0e0e0;
}

/* Free Visits Banner */
#free-visits-banner {
  background-color: #f0f4ff;
  border-bottom: 1px solid #d1d5db;
  padding: 10px 20px;
  display: flex;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  z-index: 95; /* Lower than critical navigation elements */
  position: absolute; /* Use absolute instead of fixed */
  left: 0;
}

#free-visits-banner .banner-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  position: relative; /* Ensure proper stacking context */
}

#free-visits-banner .banner-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  margin-right: 20px; /* Add space between text and buttons */
}

#free-visits-banner .banner-text span {
  margin-bottom: 5px;
}

#free-visits-banner .banner-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative; /* Ensure proper stacking context */
  z-index: 101; /* Higher than the banner itself */
}

#free-visits-banner .banner-button {
  background-color: #4f46e5;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.3s;
}

#free-visits-banner .banner-button:hover {
  background-color: #4338ca;
}

#free-visits-banner .banner-dismiss-button {
  background-color: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(79, 70, 229, 0.3);
  color: #4f46e5;
  cursor: pointer;
  font-size: 16px;
  padding: 5px;
  opacity: 0.9;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  position: relative;
  z-index: 102;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#free-visits-banner .banner-dismiss-button:hover {
  opacity: 1;
  background-color: rgba(79, 70, 229, 0.1);
  transform: scale(1.05);
}

/* Free Visits Exhausted Modal */
#free-visits-exhausted-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

#free-visits-exhausted-modal .modal-content {
  background-color: white;
  padding: 30px;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  text-align: center;
}

#free-visits-exhausted-modal h2 {
  margin-top: 0;
  color: #1f2937;
}

#free-visits-exhausted-modal p {
  margin-bottom: 20px;
  color: #4b5563;
}

#free-visits-exhausted-modal .modal-buttons {
  display: flex;
  justify-content: center;
}

#free-visits-exhausted-modal .btn-primary {
  background-color: #4f46e5;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.3s;
}

#free-visits-exhausted-modal .btn-primary:hover {
  background-color: #4338ca;
}

/* Template Builder Header Button */
#templateBuilderBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  background-color: var(--green) !important;
  color: var(--white) !important;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

/* Template Builder button - no hover effects */

#templateBuilderBtn i {
  margin-right: 8px;
  font-size: 14px;
}

/* Base styles */
:root {
  --primary-color: #335df3;
  --secondary-color: #818cf8;
  --text-color: #1f2937;
  --light-bg: #f9fafb;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --error-color: #ef4444;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--light-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Navbar styles */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 5%;
  background-color: var(--white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  width: 100%;
  box-sizing: border-box;
  position: fixed;
  top: 0;
  z-index: 1000;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
}

/* Onboarding container styles */
.onboarding-container {
  flex: 1;
  width: 100%;
  max-width: 800px;
  margin: 100px auto 40px;
  padding: 32px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  overflow-y: auto;
  min-height: calc(100vh - 140px);
  box-sizing: border-box;
  min-width: 0;
  scrollbar-gutter: stable;
}

/* Carousel styles */
.carousel {
  position: relative;
  overflow: visible;
  min-height: 400px;
  display: flex;
  flex-direction: column;
}

.carousel-slide {
  display: none;
  padding: 20px 0;
  flex: 1;
}

.carousel-slide.active {
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.3s ease-in-out;
}

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

.carousel-slide h2 {
  font-size: 24px;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.carousel-slide p {
  color: var(--gray-600);
  margin-bottom: 24px;
  font-size: 16px;
  line-height: 1.6;
}

/* Form styles */
.form-group {
  margin-bottom: 24px;
  width: 100%;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--gray-700);
}

.form-group label.required::after {
  content: '*';
  color: var(--error-color);
  margin-left: 4px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 16px;
  color: var(--gray-800);
  transition: all 0.3s ease;
  background-color: var(--white);
  box-sizing: border-box;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1em;
  padding-right: 2.5rem;
}

.form-group input.invalid,
.form-group select.invalid {
  border-color: var(--error-color);
}

.error-text {
  color: var(--error-color);
  font-size: 14px;
  margin-top: 4px;
  display: none;
}

.error-text.visible {
  display: block;
}

/* Progress bar styles */
.progress-bar {
  display: flex;
  justify-content: center;
  margin: 32px 0;
  gap: 8px;
}

.progress-step {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-200);
  transition: all 0.3s ease;
}

.progress-step.active {
  background: var(--primary-color);
  transform: scale(1.2);
}

/* Button styles */
.btn-container {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  gap: 16px;
}

.btn {
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--white);
}

.btn-primary:disabled {
  background-color: var(--gray-400);
  cursor: not-allowed;
}

.btn-secondary {
  background-color: var(--gray-200);
  color: var(--gray-700);
}

.btn-secondary:hover {
  background-color: var(--gray-300);
}

/* Review page styles */
.review-info {
  background: var(--white);
  border-radius: 8px;
  padding: 24px;
  margin: 24px 0;
  border: 1px solid var(--gray-200);
}

.review-item {
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
}

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

.review-item label {
  font-weight: 600;
  min-width: 120px;
  margin-right: 16px;
  color: var(--gray-700);
}

/* Responsive styles */
@media (max-width: 768px) {
  .onboarding-container {
    margin: 80px 16px 24px;
    padding: 24px 16px;
    min-height: calc(100vh - 104px);
  }

  .carousel {
    min-height: 300px;
  }

  .carousel-slide {
    padding: 16px 0;
  }

  .carousel-slide h2 {
    font-size: 20px;
    margin-bottom: 12px;
  }

  .carousel-slide p {
    font-size: 14px;
    margin-bottom: 20px;
  }

  .form-group {
    margin-bottom: 20px;
  }

  .form-group label {
    font-size: 14px;
  }

  .form-group input,
  .form-group select {
    padding: 10px;
    font-size: 14px;
  }

  .btn-container {
    flex-direction: column-reverse;
    gap: 12px;
  }

  .btn {
    width: 100%;
    padding: 12px;
    font-size: 14px;
  }

  .review-item {
    padding: 12px;
    flex-direction: column;
  }

  .review-item label {
    min-width: 100%;
    margin-bottom: 4px;
  }
}

@media (max-width: 480px) {
  .onboarding-container {
    margin: 72px 12px 20px;
    padding: 20px 12px;
  }

  .navbar {
    padding: 16px 5%;
  }

  .logo {
    font-size: 20px;
  }
}

/* iOS Specific Optimizations */
@supports (-webkit-touch-callout: none) {
  /* CSS specific to iOS devices */
  .onboarding-container {
    -webkit-overflow-scrolling: touch; /* Enables momentum scrolling on iOS */
    padding-bottom: env(
      safe-area-inset-bottom,
      32px
    ); /* Respects the safe area on newer iOS devices */
    padding-top: env(safe-area-inset-top, 32px);
    margin-top: calc(80px + env(safe-area-inset-top, 0px));
  }

  .navbar {
    padding-top: max(20px, env(safe-area-inset-top, 20px));
    height: auto;
  }

  /* Improve touch targets for iOS */
  .form-group input,
  .form-group select,
  .btn {
    min-height: 44px; /* Apple's recommended minimum touch target size */
  }

  /* Fix iOS button styling */
  .btn {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
  }

  /* Fix iOS select styling */
  .form-group select {
    background-position: calc(100% - 15px) center;
  }

  /* Fix iOS input zoom */
  @media (max-width: 768px) {
    .form-group input,
    .form-group select {
      font-size: 16px; /* Prevents iOS from zooming in on inputs */
    }
  }
}

/* Add iOS viewport meta tag fix to ensure proper rendering and touch behavior */
@media (max-width: 768px) {
  /* More aggressive fixes for smaller iOS screens */
  .btn-container {
    padding-bottom: env(safe-area-inset-bottom, 20px);
  }

  /* Ensure iOS doesn't apply its own styles to buttons */
  .btn-primary,
  .btn-secondary {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 6px;
  }

  /* Fix iOS form elements tap highlight color */
  input,
  select,
  button {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  }

  /* Prevent iOS text size adjust after orientation change */
  html {
    -webkit-text-size-adjust: 100%;
  }

  /* Improve iOS scrolling performance */
  .carousel-slide {
    -webkit-overflow-scrolling: touch;
  }
}

/* Trial countdown banner styling */
.trial-countdown {
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: absolute; /* Use absolute instead of fixed */
  left: 0;
  width: 100%;
  z-index: 95; /* Lower than critical navigation elements */
  background-color: var(--blue);
  color: white;
  padding: 8px 15px;
  box-sizing: border-box;
}

/* Body header and navigation */
.body-header {
  background-color: var(--blue);
  height: 60px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: fixed;
  z-index: 100; /* Higher than other elements */
  padding: 0 20px;
  top: 0;
  left: 0;
}

/* Banner adjustment helper class */
.with-banner {
  padding-top: 45px; /* Additional padding when banner is visible */
}
