html
{ height: 100%;}

*
{ margin: 0;
  padding: 0;
  box-sizing: border-box;}

body
{ font: normal 16px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #e6f0ff;
  color: #2d3748;
  line-height: 1.6;}

p
{ padding: 0 0 20px 0;
  line-height: 1.7em;}

img
{ border: 0;}

h1, h2, h3, h4, h5, h6 
{ font-weight: 600;
  color: #1a202c;
  margin: 0 0 15px 0;
  padding: 0;
  line-height: 1.3;}

h1
{ font-size: 2rem;
  font-weight: 700;
  color: #1a202c;}

h2
{ font-size: 1.5rem;
  color: #1a202c;
  font-weight: 600;}

h3
{ font-size: 1.25rem;}

h4, h5, h6
{ margin: 0;
  padding: 0 0 5px 0;
  font-size: 1.1rem;
  color: #4a5568;}

h5, h6
{ font-size: 1rem;
  color: #2d3748;}

h6
{ color: #4a5568;}

a, a:hover
{ outline: none;
  text-decoration: none;
  color: #3182ce;
  transition: color 0.2s ease;}

a:hover
{ color: #2c5aa0;}

blockquote
{ margin: 20px 0; 
  padding: 15px 20px;
  border-left: 4px solid #3182ce;
  background: #edf2f7;
  border-radius: 4px;}

ul
{ margin: 2px 0 22px 20px;}

ul li
{ list-style-type: disc;
  margin: 0 0 8px 0; 
  padding: 0 0 4px 5px;}

ol
{ margin: 8px 0 22px 20px;}

ol li
{ margin: 0 0 11px 0;}

.left
{ float: left;
  width: auto;
  margin-right: 10px;}

.right
{ float: right; 
  width: auto;
  margin-left: 10px;}

.center
{ display: block;
  text-align: center;
  margin: 20px auto;}

#main
{ display: block;
  min-height: 100vh;
  margin: 0;
  padding: 0;}

#header
{ width: 260px;
  background: linear-gradient(180deg, #071a37 0%, #030d1f 55%, #020712 100%);
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  box-shadow: 10px 0 30px rgba(2, 8, 20, 0.35);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0 0 40px 0;
  z-index: 1000;}

#logo
{ width: 100%;
  padding: 32px 26px 28px;
  border-bottom: 1px solid rgba(255,255,255,0.05);}

#logo #logo_text 
{ position: relative; 
  top: 0;
  left: 0;}

#logo h1, #logo h2
{ font-weight: 700;
  border-bottom: 0;
  text-transform: none;
  margin: 0;}

#logo_text h1, #logo_text h1 a, #logo_text h1 a:hover 
{ padding: 0;
  color: #fefefe;
  letter-spacing: 0;
  text-decoration: none;
  font-size: 1.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;}

#logo_text h1
{ position: relative;}

#logo_text h1 a .logo_colour
{ color: #ffffff;}

#logo_text h1:before
{ content: "";
  display: inline-block;
  width: 38px;
  height: 44px;
  border-radius: 10px;
  position: relative;
  background: linear-gradient(160deg, #0f62ff, #1bb9ff);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.15), 0 6px 20px rgba(15,98,255,0.45);}

#logo_text h2
{ font-size: 0.9rem;
  padding: 8px 0 0 0;
  color: rgba(255,255,255,0.65);
  font-weight: 400;
  margin-top: 4px;}

#logo #contact_details
{ position: absolute; 
  top: 60px;
  right: 65px;}

#logo #contact_details p
{ text-align: center;
  padding: 0;
  line-height: 22px;
  font-size: 110%;
  color: rgba(255,255,255,0.9);}

#menubar
{ width: 100%;
  padding: 18px 18px 0;
  border: none;
  background: transparent;} 

ul#menu
{ list-style: none;
  margin: 0; 
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;}

ul#menu li
{ margin: 0;
  padding: 0;
  list-style: none;}

ul#menu li a
{ letter-spacing: 0.04em;
  font-weight: 600;
  display: block; 
  padding: 14px 20px;
  color: rgba(227,234,245,0.8);
  text-transform: none;
  text-decoration: none;
  border: none;
  border-radius: 12px;
  background: transparent;
  transition: all 0.2s ease;
  font-size: 0.95rem;} 

ul#menu li a:hover
{ color: #ffffff;
  background: rgba(255,255,255,0.08);}

ul#menu li.selected a, ul#menu li.selected a:hover
{ color: #ffffff;
  background: linear-gradient(135deg, #1b82ff, #0d5edb);
  box-shadow: 0 10px 20px rgba(13,94,219,0.45);}

#site_content
{ margin-left: 260px;
  padding: 48px 64px 80px;
  background: #e7edf7;
  min-height: 100vh;} 

#site_content > h1
{ font-size: 2.2rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 28px;}

#site_content > h1 + p
{ color: #6b7280;
  margin-top: -18px;
  margin-bottom: 30px;}

.sidebar
{ float: right;
  width: 190px;
  padding: 0 15px 20px 15px;}

.sidebar ul
{ width: 178px; 
  padding: 4px 0 0 0; 
  margin: 4px 0 30px 0;}

.sidebar li
{ list-style: none; 
  padding: 0 0 7px 0; }

.sidebar li a, .sidebar li a:hover
{ padding: 8px 12px;
  display: block;
  background: transparent;
  border-radius: 4px;
  transition: all 0.2s ease;} 

.sidebar li a.selected
{ color: #3182ce;
  background: #e6f2ff;} 

#content
{ text-align: left;
  width: 100%;
  padding: 0;}

#content ul
{ margin: 2px 0 22px 0px;}

#content ul li
{ list-style-type: none;
  background: none;
  margin: 0 0 8px 0; 
  padding: 0 0 4px 25px;
  line-height: 1.5em;
  position: relative;}

#content ul li:before
{ content: "•";
  position: absolute;
  left: 0;
  color: #3182ce;
  font-size: 1.2em;}

#footer
{ width: 100%;
  margin-left: 260px;
  font: normal 14px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  height: auto;
  padding: 24px 60px 40px;
  text-align: left; 
  background: #e7edf7;
  color: #7f8da6;
  text-transform: none;
  letter-spacing: 0;
  border-top: 1px solid rgba(15,23,42,0.05);}

#footer a
{ color: #3182ce;
  text-decoration: none;}

#footer a:hover
{ color: #2c5aa0;
  text-decoration: underline;}

.search
{ color: #2d3748; 
  border: 1px solid #cbd5e0; 
  width: 200px; 
  padding: 10px 12px 10px 40px; 
  font: 100% -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  border-radius: 8px;
  transition: all 0.2s ease;
  background: #ffffff url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23999" stroke-width="2"><circle cx="11" cy="11" r="8"></circle><path d="m21 21-4.35-4.35"></path></svg>') no-repeat 12px center;
  background-size: 16px;}

.search:focus
{ outline: none;
  border-color: #3182ce;
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);}

.form_settings
{ margin: 15px 0 0 0;}

.form_settings p
{ padding: 0 0 4px 0;}

.form_settings span
{ float: left; 
  width: 200px; 
  text-align: left;} 
  
.form_settings input, .form_settings textarea
{ padding: 10px 12px; 
  width: 299px; 
  font: 100% -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; 
  border: 1px solid #cbd5e0; 
  background: #ffffff; 
  color: #2d3748;
  border-radius: 8px;
  transition: all 0.2s ease;} 

.form_settings input:focus, .form_settings textarea:focus
{ outline: none;
  border-color: #3182ce;
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);}
  
.form_settings .submit
{ font: 100% -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; 
  border: none; 
  width: auto;
  min-width: 120px;
  margin: 0 0 0 212px; 
  height: auto;
  padding: 12px 24px;
  cursor: pointer; 
  background: #1e3a5f;
  color: #ffffff;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);}

.form_settings .submit:hover
{ background: #2a4f7a;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);}

.form_settings textarea, .form_settings select
{ font: 100% -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; 
  width: 299px;}

.form_settings select
{ width: 310px;
  padding: 10px 12px;
  border: 1px solid #cbd5e0;
  border-radius: 8px;
  background: #ffffff;
  transition: all 0.2s ease;}

.form_settings select:focus
{ outline: none;
  border-color: #3182ce;
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);}

.form_settings .checkbox
{ margin: 4px 0; 
  padding: 0; 
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e0;
  border-radius: 4px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;}

.form_settings .checkbox:checked
{ background: #3182ce;
  border-color: #3182ce;}

.separator
{ width: 100%;
  height: 0;
  border-top: 1px solid #e2e8f0;
  border-bottom: none;
  margin: 0 0 20px 0;} 
  
table
{ margin: 10px 0 30px 0;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;}

table tr th, table tr td
{ background: #ffffff;
  color: #2d3748;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;} 
  
table tr th
{ background: #f7fafc;
  color: #2d3748;
  font-weight: 600;
  text-transform: none;
  font-size: 0.875rem;
  letter-spacing: 0;}

table tr:first-child th:first-child
{ border-top-left-radius: 8px;}

table tr:first-child th:last-child
{ border-top-right-radius: 8px;}

table tr td
{ background: #ffffff;
  color: #2d3748;}

table tr:hover td
{ background: #f7fafc;}

/* Login page specific - split screen design */
body:has(form[action="login.php"])
{ background: #ffffff;}

body:has(form[action="login.php"]) #main
{ display: flex;
  min-height: 100vh;
  width: 100%;}

body:has(form[action="login.php"]) #header
{ width: 50%;
  background: #041126;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 100vh;}

body:has(form[action="login.php"]) #logo
{ border: none;
  padding: 0;
  text-align: center;
  width: 100%;
  max-width: 260px;}

body:has(form[action="login.php"]) #logo_text
{ text-align: center;
  color: #ffffff;}

body:has(form[action="login.php"]) #logo_text::before
{ content: "";
  display: block;
  width: 130px;
  height: 150px;
  margin: 0 auto 32px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='140' viewBox='0 0 120 140'%3E%3Crect x='8' y='8' width='96' height='124' rx='18' ry='18' fill='none' stroke='%231e72ff' stroke-width='8'/%3E%3Cpath d='M84 8v36h28' fill='none' stroke='%231e72ff' stroke-width='8' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cline x1='28' y1='66' x2='88' y2='66' stroke='%231e72ff' stroke-width='8' stroke-linecap='round'/%3E%3Cline x1='28' y1='90' x2='88' y2='90' stroke='%231e72ff' stroke-width='8' stroke-linecap='round'/%3E%3Cline x1='28' y1='114' x2='72' y2='114' stroke='%231e72ff' stroke-width='8' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;}

body:has(form[action="login.php"]) #logo_text h1,
body:has(form[action="login.php"]) #logo_text h1 a
{ font-size: 0;
  border: none;
  padding: 0;}

body:has(form[action="login.php"]) #logo_text h1 a .logo_colour
{ visibility: hidden;}

body:has(form[action="login.php"]) #logo_text h1 a::after
{ content: "Form Builder";
  display: block;
  font-size: 2rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.02em;}

body:has(form[action="login.php"]) #logo_text h2
{ display: none;}

body:has(form[action="login.php"]) #menubar
{ display: none;}

body:has(form[action="login.php"]) #site_content
{ width: 50%;
  margin-left: 0;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 60px;}

body:has(form[action="login.php"]) #content
{ max-width: 420px;
  width: 100%;
  box-shadow: none;
  padding: 0;
  background: transparent;}

body:has(form[action="login.php"]) #content h1
{ margin-bottom: 32px;
  font-size: 2rem;
  color: #1d2533;}

body:has(form[action="login.php"]) #footer
{ display: none;}

/* Survey public form page -------------------------------------------------- */
body:has(#survey_form)
{ background: #eef0f6;}

body:has(#survey_form) #main
{ display: block;
  margin: 0;
  padding: 0;}

body:has(#survey_form) #header
{ background: radial-gradient(circle at 10% 20%, #a9bff7 0%, transparent 45%), #040d1f;
  border-bottom-left-radius: 40px;
  border-bottom-right-radius: 40px;
  position: relative;
  padding-bottom: 20px;
  min-height: 20px;
  width: 100%;
  left: 0;
  top: 0;
  box-shadow: none;
  position: relative;}

body:has(#survey_form) #header,
body:has(#survey_form) #logo,
body:has(#survey_form) #site_content
{ margin: 0 auto;}

body:has(#survey_form) #logo
{ margin: 0 auto;
  padding: 100px 40px 0 40px;
  position: relative;
  text-align: center;
  max-width: 960px;}

body:has(#survey_form) #logo_text
{ position: relative;
  z-index: 2;}

body:has(#survey_form) #logo_text h1
{ font-size: 0.85rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
  padding: 0;
  margin-bottom: 10px;}

body:has(#survey_form) #logo_text h2
{ font-size: 2.3rem;
  font-weight: 600;
  color: #ffffff;
  padding: 0;
  margin: 0;}

body:has(#survey_form) #menubar
{ display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  margin-top: 10px;}

body:has(#survey_form) #menubar ul
{ display: none;}

body:has(#survey_form) #menubar::after
{ content: "Add a trip - Filled";
  font-size: 0.9rem;
  color: rgba(162,172,196,0.95);
  letter-spacing: 0.2em;
  text-transform: uppercase;}

body:has(#survey_form) #content
{ background: transparent;
  box-shadow: none;
  padding: 0;}

body:has(#survey_form) #footer
{ display: none;}

body:has(#survey_form) #site_content,
body:has(#survey_form) #footer
{ margin-left: 0;}

body.login-page h1
{ margin-bottom: 30px;
  font-size: 2rem;}
