/*================================================
Theme Variables
================================================*/
:root {
  --background-color: #fff; /* white */
  --text-color: #000; /* black */
}

/*================================================
Dark Theme Variables
================================================*/
[data-theme="dark"] {
  --background-color: #121212; /* very dark gray (almost black) */
  --text-color: #f5f5f5; /* near white */
}

/*================================================
General Styles
================================================*/
body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: 0;
  min-height: 100vh;
  background-color: var(--background-color); /* white or very dark gray */
  color: var(--text-color); /* black or near white */
  font-family: 'Montserrat', sans-serif;
  text-align: center;
}

/*================================================
Switch Component Styles
================================================*/
.switch {
  display: inline-block;
  position: relative;
  width: 60px;
  height: 34px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/*================================================
Slider Styles
================================================*/
.slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc; /* light gray */
  cursor: pointer;
  transition: 0.4s;
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  content: "";
  position: absolute;
  left: 4px;
  bottom: 4px;
  height: 26px;
  width: 26px;
  background-color: white; /* white */
  border-radius: 50%;
  transition: 0.4s;
}

input:checked + .slider.round:before {
  transform: translateX(26px);
}

.slider .icon {
  position: absolute;
  top: 50%;
  width: 20px;
  font-size: 16px;
  text-align: center;
  transform: translateY(-50%);
}

.slider .icon.sun {
  left: 8px;
}

.slider .icon.moon {
  right: 8px;
  opacity: 0;
  transition: opacity 0.4s;
}

input:checked + .slider .icon.sun {
  opacity: 0;
}

input:checked + .slider .icon.moon {
  opacity: 1;
}

/*================================================
Navigation Bar Styles
================================================*/
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 14px 24px;
  width: 100%;
  background-color: inherit; /* inherits parent background */
}

.nav-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
}

.nav-right {
  display: flex;
  gap: 12px;
}

.nav-tmm {
  color: inherit; /* inherits parent color */
  font-family: 'Montserrat', sans-serif;
  font-size: 24px;
  font-weight: bold;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.nav-software {
  color: inherit; /* inherits parent color */
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: normal;
  text-transform: uppercase;
}

[data-theme="dark"] .nav-tmm,
[data-theme="dark"] .nav-software {
  color: white; /* white */
}

a {
  text-decoration: none;
  color: inherit;
}

/*================================================
Hero Section Styles
================================================*/
.hero-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 1px;
  margin: auto;
  max-width: 900px;
}

.hero-letter-t-1 {
  padding-right: 18px;
  font-size: 48px;
  font-weight: bold;
  text-align: center;
}

.hero-letter-m-1 {
  padding: 1px 18px;
  font-size: 48px;
  font-weight: bold;
  text-align: center;
}

.hero-letter-m-2 {
  padding-left: 18px;
  font-size: 48px;
  font-weight: bold;
  text-align: center;
}

.hero-title-2 {
  font-size: 36px;
  font-weight: normal;
}

.subtitle-1,
.subtitle-2 {
  color: #999; /* medium gray */
  font-size: 18px;
  text-align: center;
}

.subtitle-1 {
  padding-top: 40px;
  margin-bottom: 0.2em;
}

/*================================================
Product Section Styles
================================================*/
.product-container {
  display: flex;
  justify-content: center;
  gap: 50px;
  margin: auto;
  max-width: 1200px;
  flex-wrap: wrap;
}

.product {
  margin: auto;
  display: flex;
  flex: 1 1 320px;
  flex-direction: column;
  min-width: 320px;  /* ensure we don't shrink below 320px */
  max-width: 400px;  /* optional: cap how wide each product can get */
  padding: 10px;
  border: 1px solid transparent; /* transparent border */
  border-radius: 8px;
  text-align: center;
  transition: border-color 0.3s ease;
}

.product:hover {
  border-color: #C89B3C; /* gold-ish color */
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1); /* semi-transparent black */
}

.product h3 {
  min-height: 4.5em;
  line-height: 1.2;
}

[data-theme="dark"] .product:hover {
  border-color: #C89B3C; /* gold-ish color */
  box-shadow: 0 3px 10px rgba(255, 255, 255, 0.15); /* semi-transparent white */
}

/*================================================
Email Input & Suggestions Styles
================================================*/
.email-input {
  display: block;
  margin-bottom: 10px;
  max-width: 250px;
  padding: 10px 20px;
  width: 100%;
  background-color: white; /* white */
  border: 2px solid #C89B3C; /* gold-ish color */
  border-radius: 999px;
  text-align: center;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.email-input::placeholder {
  color: #5A4A33; /* dark brown */
  font-size: 14px;
  opacity: 1;
}

.email-input:focus {
  background-color: #faf3e0; /* light beige */
  border-color: #b38a2e; /* muted gold */
  outline: none;
}

.email-input:valid {
  background-color: #e6ffe6; /* pale green */
  border-color: #2ecc71; /* bright green */
  color: darkslategray; /* dark slate gray */
  font-weight: lighter;
}

.email-input:invalid:not(:placeholder-shown) {
  background-color: white; /* white */
  border-color: #e74c3c; /* vivid red */
  color: darkslategray; /* dark slate gray */
  font-weight: lighter;
}

.email-input:invalid:not(:focus):not(:placeholder-shown) {
  background-color: #FAFAFA; /* very light gray */
  border-color: #e74c3c; /* vivid red */
}

.input-wrapper {
  display: inline-block;
  position: relative;
}

.email-suggestions-container {
  position: absolute;
  top: 80%;
  left: 0;
  z-index: 1000;
  max-height: 120px;
  max-width: 250px;
  width: 100%;
  background-color: #FAFAFA; /* very light gray */
  border: 2px dotted #ccc; /* light gray */
  border-radius: 999px;
  overflow-y: auto;
  display: none;
}

.suggestion-item {
  padding: 10px 20px;
  font: inherit;
  font-size: 14px;
  font-weight: lighter;
  text-align: right;
  color: #333; /* dark gray */
  cursor: pointer;
  outline: none;
  transition: all 0.3s ease;
}

.suggestion-item:hover,
.suggestion-item:focus,
.suggestion-item.highlight {
  background-color: #F2F2F2; /* very light gray */
  color: #27ae60; /* bright green */
  font-size: 14px;
  padding: 0.2em 0.4em;
}

/*================================================
Custom Button Styles
================================================*/
.btn-waitlist {
  margin: 10px;
  padding: 10px 20px;
  background-color: transparent; /* transparent */
  border: 1px solid #ccc; /* light gray */
  border-radius: 999px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1); /* semi-transparent black */
  color: currentColor; /* currentColor (inherited) */
  font-size: 15px;
  cursor: not-allowed;
  opacity: 0.5;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.2s ease;
}

.btn-waitlist.valid {
  background-color: #2ecc71; /* bright green */
  border: 1px solid #e6ffe6; /* pale green */
  color: black; /* black */
  cursor: pointer !important;
  opacity: 1;
}

.btn-waitlist.valid:hover {
  background-color: #27ae60; /* bright green */
}

.btn-waitlist:hover {
  background-color: #2ecc71; /* bright green */
  border-color: #C89B3C; /* gold-ish color */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); /* semi-transparent black */
}

.btn-waitlist.active {
  background-color: #2ecc71; /* bright green */
  transform: scale(0.97);
}

.btn-waitlist.sending {
  background-color: #2ecc71; /* bright green */
  cursor: wait;
  animation: pulse 0.7s infinite alternate;
}

@keyframes pulse {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.05);
  }
}

.btn-waitlist.success {
  background-color: #2ecc71 !important; /* bright green */
  color: black !important; /* black */
  cursor: default;
  transition: background-color 0.3s ease;
}

.btn-waitlist.error {
  background-color: #FF5733 !important; /* red */
  color: black !important; /* black */
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  50% {
    transform: translateX(5px);
  }
  75% {
    transform: translateX(-5px);
  }
}

[data-theme="dark"] .btn-waitlist:hover {
  box-shadow: 0 3px 10px rgba(255, 255, 255, 0.15); /* semi-transparent white */
}

.btn-waitlist:disabled {
  cursor: not-allowed;
}

.btn-download {
  align-self: center;
  padding: 10px 20px;
  background-color: transparent; /* transparent */
  border: 1px solid #ccc; /* light gray */
  border-radius: 999px;
  color: currentcolor; /* currentColor (inherited) */
  font-size: 15px;
  cursor: not-allowed;
  transition: background-color 0.3s ease, transform 0.1s ease-in-out;
}

.btn-download:hover {
  background-color: #2ecc71; /* bright green */
  border-color: #C89B3C; /* gold-ish color */
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1); /* semi-transparent black */
}

[data-theme="dark"] .btn-download:hover {
  box-shadow: 0 3px 10px rgba(255, 255, 255, 0.15); /* semi-transparent white */
}

.btn-switch {
  padding: 10px 20px;
  background-color: currentColor; /* currentColor (inherited) */
  border: 1px solid #ccc; /* light gray */
  border-radius: 999px;
  color: currentColor; /* currentColor (inherited) */
  font-size: 15px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.1s ease-in-out;
}

.btn-switch:hover {
  background-color: #777; /* dark gray */
  border-color: #C89B3C; /* gold-ish color */
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1); /* semi-transparent black */
}

[data-theme="dark"] .btn-switch:hover {
  box-shadow: 0 3px 10px rgba(255, 255, 255, 0.15); /* semi-transparent white */
}

.btn-signin,
.btn-login {
  padding: 10px 20px;
  background-color: transparent; /* transparent */
  border: 1px solid #ccc; /* light gray */
  border-radius: 999px;
  color: currentColor; /* currentColor (inherited) */
  font-size: 15px;
  cursor: not-allowed;
  transition: background-color 0.3s ease, transform 0.1s ease-in-out;
}

.btn-signin:hover,
.btn-login:hover {
  border-color: #C89B3C; /* gold-ish color */
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1); /* semi-transparent black */
}

[data-theme="dark"] .btn-signin:hover,
[data-theme="dark"] .btn-login:hover {
  border-color: #C89B3C; /* gold-ish color */
  box-shadow: 0 3px 10px rgba(255, 255, 255, 0.15); /* semi-transparent white */
}

/*================================================
Modal Styles
================================================*/
.modal {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4); /* semi-transparent black */
  align-items: center;
  justify-content: center;
  z-index: 1001;
}

.modal-content {
  position: relative;
  margin: 10% auto;
  max-width: 600px;
  padding: 40px 20px 20px;
  width: 80%;
  height: 80vh;  
  overflow-y: auto;
  overscroll-behavior: contain;
  background-color: #FAFAFA; /* very light gray */
  border: 1px solid #888; /* gray */
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2); /* semi-transparent black */
  color: darkslategray; /* dark slate gray */
  line-height: 1.6;
}

[data-theme="dark"] .modal-content {
  background-color: #121212; /* very dark gray (almost black) */
  color: #f5f5f5; /* near white */
}

.modal-content h2 {
  text-align: center;
  margin-top: 0;
  padding-bottom: 0.5rem;
  font-size: 1.8rem;
  font-weight: 600;
  border-bottom: 1px solid #eaeaea; /* light gray */
}

.modal-content h3 {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 1.2rem;
  font-weight: 500;
}

.modal-content p,
.modal-content ul {
  margin: 1rem 0;
  text-align: left;
  font-size: 1rem;
}

.modal-content ul {
  list-style: disc;
  padding-left: 1.5rem;
}

.last-updated {
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #777; /* dark gray */
}

.close {
  position: sticky;
  top: 0;
  align-self: flex-end;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  background-color: inherit;
  padding: 1px 15px;
  z-index: 10;
  border: 1px solid #eaeaea;
  border-radius: 999px;
}

.close:hover {
  border-color: #C89B3C; /* gold-ish color */
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1); /* semi-transparent black */
}

[data-theme="dark"] .close:hover {
  border-color: #C89B3C; /* gold-ish color */
  box-shadow: 0 3px 10px rgba(255, 255, 255, 0.15); /* semi-transparent white */
}

.modal-tabs {
  margin-bottom: 10px;
}

.tablinks {
  padding: 10px 20px;
  background: none; /* none */
  border: none;
  font-size: 16px;
  cursor: pointer;
}

.tablinks.active {
  border-bottom: 2px solid #2ecc71; /* bright green */
}

/*================================================
Footer Styles
================================================*/
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  width: 100%;
  background-color: inherit; /* inherits parent background */
  color: #999; /* medium gray */
  font-size: 14px;
}

/* Prevent the copyright from wrapping */
footer > div:first-child {
  white-space: nowrap;
}

.footer-links {
  display: flex;
  width: 100%;
  margin-left: 20px;
  gap: 20px;
}

/* Force the third link (GitHub) to push itself and subsequent links to the right */
.footer-links a:nth-child(3) {
  margin-left: auto;
}

/* Ensure all link states use the same gray color and remove default link styling */
.footer-links a,
.footer-links a:visited,
.footer-links a:active {
  color: inherit;       /* inherit the gray color from footer */
  text-decoration: none;
}

/* Underline on hover */
.footer-links a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* TOS Section Styles */
.tos-section {
  /* Hidden by default; shown dynamically via JavaScript when the email is valid */
  display: none;
  margin-top: 10px;
  font-size: 0.8rem;
  text-align: left;
  color: inherit;
}

.tos-section label {
  display: block;  
  align-items: center;
  gap: 0.3rem; /* small spacing between checkbox & text */
  text-align: left;
}

.tos-checkbox {
  /* Modern browsers can style the checkbox with accent-color */
  accent-color: #2ecc71;     /* bright green accent */
  width: 18px;
  height: 18px;
  cursor: pointer;
  margin-right: 0.3rem;      /* extra spacing */
}

/* Links inside TOS section */
.tos-section a {
  color: #2ecc71;            /* bright green */
  text-decoration: none;     /* remove underline by default */
}

.tos-section a:hover {
  text-decoration: underline; /* underline on hover for clarity */
}
