body {
  background: #000;
  color: #39ff14;
  font-family: 'Fira Mono', 'Consolas', 'Monaco', monospace;
  margin: 0;
  padding: 0px;
  overflow-x: hidden;
  /* Prevent zoom and pinch gestures on mobile */
  touch-action: pan-x pan-y;    /* Prevent zoom gestures */
  -webkit-touch-callout: none;  /* Disable iOS callouts */
  position: relative;
}

/* Matrix Rain Background */
#matrix-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.08;
  pointer-events: none;
}

/* Hide matrix animation on mobile devices */
@media (max-width: 768px) {
  #matrix-canvas {
    display: none;
  }
}

/* Allow text selection and interaction in form elements */
input, textarea, button, select, label {
  -webkit-user-select: text;
  -khtml-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;            /* Allow text selection */
  -webkit-touch-callout: default;
}

.navbar {
  background: #000;
  border-bottom: 1px solid #39ff14;
  padding: 15px 0;
  z-index: 1000;
}

.navbar-content {
  max-width: 1200px;
  padding: 0 20px;
  box-sizing: border-box;
}

.navbar-left {
  gap: 15px;
}

.navbar-logo {
  width: 40px;
  height: 40px;
}

.navbar-brand {
  font-size: 1.2rem;
  font-weight: bold;
  color: #39ff14;
  text-shadow: 0 0 8px #39ff14;
  letter-spacing: 1px;
}

.navbar-right {
  display: flex;
  align-items: center;
}

.navbar-link {
  color: #39ff14;
  text-decoration: none;
  font-size: 1rem;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 3px;
  transition: all 0.2s;
  text-shadow: 0 0 4px #39ff14;
  text-align: center;
}

.navbar-link:hover {
  border-color: #39ff14;
  box-shadow: 0 0 8px #39ff14;
  background: rgba(57, 255, 20, 0.1);
}

/* Add 10px right padding to the final navbar-link */
.navbar-link:last-child {
  padding-right: 10px;
}

.main-content {
  margin-top: 100px;        /* Account for fixed navbar */
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;   /* Include padding in width calculations */
}

.contact-layout {
  gap: 30px;
  align-items: flex-start;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  /* Ensure this overrides any parent flex constraints */
  align-self: stretch;
  box-sizing: border-box;   /* Include padding in width calculations */
}

.terminal-container {
  background: #181f18;
  border-radius: 8px;
  box-shadow: 0 0 18px #0f0a, 0 0 2px #39ff14;
  width: 100%;
  max-width: 1200px;        /* Increased for better desktop experience */
  min-width: 320px;
  flex: 1 1 auto;           /* Allow it to grow and take available space */
  align-items: flex-start;
  position: relative;
  box-sizing: border-box;   /* Include padding in width calculations */
}

/* Minimum width for desktop screens */
@media (min-width: 992px) {
  .terminal-container {
    min-width: 960px;
  }
}

.terminal-container-borderless {
  max-width: 480px;
  min-width: 320px;
  flex: 0 0 480px;          /* Don't grow nor shrink */
  align-items: flex-start;
  position: relative;
  /* Ensure proper flex behavior */
  box-sizing: border-box;
}

.appointment-container {
  margin-top: 0;
  margin-bottom: 50px;
}

.terminal-text {
  font-size: 1.0rem;
  line-height: 1.6;
  color: #39ff14;
  text-align: left;
}

.terminal-logo {
  position: absolute;
  top: 10px;
  right: 20px;
  width: 60px;
  height: 60px;
}

.form-container {
  width: 100%;
}

.terminal-title {
  font-size: 1.5rem;
  color: #39ff14;
  text-shadow: 0 0 8px #39ff14;
  margin-bottom: 20px;
  text-align: center;
  padding: 0;
}

.typewriter-text {
  position: relative;
  text-align: center;
  margin-top: 20px;
  height: 50px;
}

.form-title {
  font-size: 1.5rem;
  font-weight: bold;
  letter-spacing: 2px;
  margin-bottom: 8px;
  color: #39ff14;
  text-shadow: 0 0 8px #39ff14;
}

.form-line {
  font-size: 1.0rem;
  margin-top: 12px;
  margin-bottom: 12px;
  text-align: left;
}

.form-message {
  font-size: 1.0rem;
  margin-top: 10px;
  height: 40px;
  display: flex;
}

.form-submit {
  display: flex; 
  gap: 10px; 
  align-items: center;
}

.cursor {
  display: inline-block;
  width: 12px;
  height: 1.2em;
  background: #39ff14;
  margin-left: 4px;
  animation: blink 1s steps(1) infinite;
  vertical-align: middle;
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }

  51%,
  100% {
    opacity: 0;
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

form {
  margin-top: 40px;
}

label {
  font-size: 1rem;
  margin-bottom: 4px;
  color: #39ff14;
  letter-spacing: 1px;
}

input,
textarea,
button {
  width: 100%;
  box-sizing: border-box;
  background: #101c11;
  color: #39ff14;
  border: 1px solid #39ff14;
  border-radius: 3px;
  font-family: inherit;
  font-size: 1rem;
  padding: 8px 10px;
  outline: none;
  transition: border 0.2s, background 0.2s, color 0.2s;
}

select:focus,
input:focus,
textarea:focus {
  border: 1.5px solid #39ff14;
  box-shadow: 0 0 6px #39ff14;
}

select option {
  background: #101c11;
  color: #39ff14;
  padding: 8px;
  transition: background-color 0.2s, color 0.2s;
}

select option:hover {
  background: #1a2a1a;
  color: #66ff66;
}

select option:checked {
  background: #2a3a2a;
  color: #99ff99;
  font-weight: bold;
}

/* Custom scrollbar for select elements */
select[size]::-webkit-scrollbar {
  width: 12px;
}

select[size]::-webkit-scrollbar-track {
  background: #101c11;
  border-radius: 6px;
}

select[size]::-webkit-scrollbar-thumb {
  background: #39ff14;
  border-radius: 6px;
  border: 2px solid #101c11;
}

select[size]::-webkit-scrollbar-thumb:hover {
  background: #66ff66;
}

select {
  width: 100%;
  box-sizing: border-box;
  background: #101c11;
  color: #39ff14;
  border: 1px solid #39ff14;
  border-radius: 3px;
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border 0.2s, background 0.2s, color 0.2s;
}

select[size] {
  /* Listbox styling for select with size attribute */
  height: auto;
  max-height: 500px; /* Increased to accommodate 32 items */
  overflow-y: auto;
  padding: 4px;
}

/* Specific height for matter type select */
#matterType {
  height: 400px !important; /* Explicit height for better control */
  max-height: 400px !important;
  overflow-y: auto !important;
}

select:not([size]) {
  /* Dropdown styling for regular select */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  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='%2339ff14' 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 10px center;
  background-size: 16px;
  padding: 8px 40px 8px 10px;
}

textarea {
  resize: vertical;
  min-height: 60px;
  max-height: 180px;
}

button {
  background: #39ff14;
  color: #101c11;
  border: none;
  border-radius: 3px;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: bold;
  padding: 10px 0;
  margin: 8px auto 0 auto; /* center */
  width: 50%;
  cursor: pointer;
  box-shadow: 0 0 8px #39ff14;
  transition: background 0.2s, color 0.2s;
}

button:hover {
  background: #101c11;
  color: #39ff14;
  border: 1px solid #39ff14;
}

button:disabled {
  background: #333;
  color: #666;
  border: 1px solid #666;
  cursor: not-allowed;
  opacity: 0.6;
}

button:disabled:hover {
  background: #333;
  color: #666;
  border: 1px solid #666;
}

.captcha-container {
  margin: 10px auto 0 auto; /* center */

}

.captcha-container input[type="checkbox"] {
  width: 25px;
  height: 25px;
  margin: 0;
  box-shadow: 0 0 12px 2px #39ff14, 0 0 2px #39ff14;
  accent-color: #39ff14;
  background: #000;
}

.captcha-container label {
  margin: 0;
  cursor: pointer;
  font-size: 0.95rem;
}

.captcha-pulse {
  animation: pulse-red 0.5s ease-in-out 3;
}

@keyframes pulse-red {
  0%,
  100% {
    box-shadow: 0 0 12px 2px #39ff14, 0 0 2px #39ff14;
  }

  50% {
    box-shadow: 0 0 20px 4px #ff0000, 0 0 4px #ff0000;
  }
}

.service-options {
  margin-top: 8px;
}

.service-label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 2px;
}

input[type="radio"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #39ff14;
  background: #101c11;
  border-radius: 3px;
  transform: scale(1.5);
  position: relative;
  cursor: pointer;
}

input[type="radio"]:checked {
  background: #39ff14;
  box-shadow: 0 0 8px #39ff14;
}

input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 6px;
  width: 4px;
  height: 8px;
  border: solid #101c11;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

@media (max-width: 800px) {
  .terminal-container {
    margin: 10px;
    width: calc(100% - 20px);
    max-width: none;
    box-shadow: 0 0 12px #0f0a, 0 0 2px #39ff14;
  }

  .terminal-container-borderless {
    margin: 10px;
    width: calc(100% - 20px);
    max-width: none;
  }

  .address-container {
    margin-top: 0;
    margin-bottom: 0;
  }

  .form-container {
    padding: 18px 6px 18px 6px;
    margin-top: 18px;
    min-width: unset;
  }

  .captcha-container {
    justify-content: center;
  }

  .service-options {
    flex-direction: column !important;
    gap: 8px !important;
  }
}

@media (max-width: 600px) {
  .navbar-content {
    padding: 0 15px;
    max-width: 100%;
    justify-content: space-between;
  }

  .navbar-brand {
    display: none;
  }

  .navbar-link {
    font-size: 0.9rem;
    padding: 6px 12px;
  }

  .navbar-link:last-child {
    padding-right: 10px;
  }
}

@media (max-width: 400px) {
  body {
    margin: 0;
    padding: 5px;
    align-items: stretch;
  }

  .navbar-brand {
    font-size: 0.9rem;
  }

  .navbar-link {
    font-size: 0.8rem;
    padding: 4px 8px;
  }

  .navbar-link:last-child {
    padding-right: 10px;
  }

  .main-content {
    max-width: 100%;
    margin-left: 0px;
    margin-right: 0px;
    padding-left: 0;
    padding-right: 0;
  }

  .contact-layout {
    flex-direction: column;
    padding: 0;
    gap: 10px;
    max-width: 100%;
  }

  .terminal-container {
    flex: 0 0 auto;
    margin: 5px 0;
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    border-radius: 0;
    box-shadow: none;
    background: #000;
  }

  .terminal-title {
    width: 100%;
    font-size: 1.5rem;
  }

  .terminal-container-borderless {
    margin: 0;
    padding: 8px;
    box-sizing: border-box;
    border-radius: 0;
    box-shadow: none;
    background: #000;
    overflow: visible; /* Allow all content to be visible */
  }

  .form-container {
    width: 100%;
    padding: 0;
  }

  .service-options {
    flex-direction: column !important;
    gap: 8px !important;
  }
}

/* Extra small mobile devices - make navbar text even smaller */
@media (max-width: 320px) {
  .navbar-brand {
    font-size: 0.8rem;
  }

  .navbar-link {
    font-size: 0.7rem;
    padding: 3px 6px;
  }

  .navbar-link:last-child {
    padding-right: 20px;
  }
}

/* Hero section full width */
#hero .terminal-container-borderless {
  max-width: none !important;
  width: 100% !important;
  flex: none !important;
}

/* Center terminal-title and terminal-text in hero section */
#hero .terminal-title,
#hero .terminal-text {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* Hero section full width */
#hero .terminal-container-borderless {
  max-width: none !important;
  width: 100% !important;
  flex: none !important;
}

/* Center terminal-title and terminal-text in hero section */
#hero .terminal-title,
#hero .terminal-text {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* Override Bootstrap form-control styling */
.form-control {
  background: #101c11 !important;
  color: #39ff14 !important;
  border: 1px solid #39ff14 !important;
}
.form-control:focus {
  background: #101c11 !important;
  color: #39ff14 !important;
  border: 1.5px solid #39ff14 !important;
  box-shadow: 0 0 6px #39ff14 !important;
  outline: none !important;
}

/* Additional styles for the single page layout */
.terminal-text ul {
  list-style-type: none;
  padding-left: 0;
}

.terminal-text li {
  margin-bottom: 8px;
  padding-left: 20px;
  position: relative;
}

.terminal-text li:before {
  content: ">";
  color: #39ff14;
  position: absolute;
  left: 0;
  font-weight: bold;
}

.terminal-text strong {
  color: #66ff66;
  text-shadow: 0 0 8px #66ff66;
}

.terminal-text em {
  font-style: italic;
  color: #99ff99;
}

.mt-3 {
  margin-top: 1rem;
}

.mt-4 {
  margin-top: 1.5rem;
}

.pb-4 {
  padding-bottom: 1.5rem;
}

/* Override Bootstrap form-control styling */
.form-control {
  background: #101c11 !important;
  color: #39ff14 !important;
  border: 1px solid #39ff14 !important;
}
.form-control:focus {
  background: #101c11 !important;
  color: #39ff14 !important;
  border: 1.5px solid #39ff14 !important;
  box-shadow: 0 0 6px #39ff14 !important;
  outline: none !important;
}

.submit-button {
  background: #101c11;;
  color: #756854;
}
.submit-button:hover {
  background: #39ff14;
  color: #000000;
}

/* Move content higher towards the navbar */
.main-content {
  padding-top: 0 !important;
}

/* Hamburger Menu Styles */
.hamburger-menu {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 30px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: 15px;
}

.hamburger-line {
  width: 100%;
  height: 3px;
  background: #39ff14;
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

/* Mobile dropdown menu */
.navbar-links {
  display: flex;
  gap: 16px;
  align-items: center;
}

/* Mobile responsive styles */
@media (max-width: 600px) {
  .hamburger-menu {
    display: flex;
  }

  .navbar-links {
    position: fixed;
    top: 100%;
    left: 0;
    right: 0;
    background: #000;
    border-bottom: 1px solid #39ff14;
    flex-direction: column;
    padding: 20px;
    gap: 15px;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(57, 255, 20, 0.1);
  }

  .navbar-links.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
  }

  .hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
  }

  .hamburger-menu.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }
}

/* Services Grid Layout - Beautifully Centered */
.services-grid {
  display: grid;
  gap: 2rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  justify-items: center; /* Center items horizontally within grid cells */
}

/* Service card width constraints for beautiful centering */
.service-card {
  width: 100%;
  max-width: 400px; /* Constrained width for optimal centering effect */
  min-width: 300px; /* Minimum width to maintain readability */
}

/* Mobile: 1 column - perfectly centered */
@media (max-width: 767px) {
  .services-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1rem;
  }

  .service-card {
    max-width: 100%; /* Full width on mobile for single column */
    min-width: 280px;
  }
}

/* Tablet: 2 columns - each card beautifully centered */
@media (min-width: 768px) and (max-width: 1199px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    padding: 2rem;
  }

  .service-card {
    max-width: 350px; /* Optimal width for 2-column layout centering */
  }
}

/* Desktop: 3 columns - each card perfectly centered */
@media (min-width: 1200px) {
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    padding: 2rem;
  }

  .service-card {
    max-width: 400px; /* Full optimal width for 3-column layout */
  }

  /* Center the contact-us card (4th item) by spanning all columns */
  .service-card[data-service="contact-us"] {
    grid-column: 1 / -1; /* Span all columns */
    max-width: 400px; /* Keep reasonable width */
    margin: 0 auto; /* Center within the spanned area */
  }
}

/* Custom checkbox styling for stamp duty page */
#first-home-buyer:checked {
  background: #39ff14 !important;
  box-shadow: 0 0 8px #39ff14;
  border-color: #39ff14;
}

#first-home-buyer:checked::after {
  content: '';
  position: absolute;
  top: 0px;
  left: 4px;
  width: 8px;
  height: 12px;
  border: solid #101c11;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
  z-index: 2;
}

/* Larger font size for property value input */
#property-value {
  font-size: 2rem !important;
  font-weight: bold;
  width: 70% !important; /* Half the width */
  max-width: 300px; /* Reasonable max width for half-size */
}
