/*
 * Stylesheet for the subscription product site
 * Uses a bright yellow background with red accents and black/white text.
 * Designed to be mobile-first and accessible.
 */

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, Helvetica, Arial, sans-serif;
  background-color: #ffd400; /* bright yellow */
  color: #000000; /* black text for strong contrast */
  min-height: 100vh;
}

main {
  width: 90%;
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  text-align: center;
}

h1 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 2rem;
  color: #d40000; /* vivid red for headings */
}

.image-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

#productImage {
  width: 100%;
  max-width: 300px;
  height: auto;
  transition: transform 0.3s ease;
  transform-origin: center center;
}

/* Slider styles */
input[type='range'] {
  width: 100%;
  margin-top: 8px;
}

.length-display {
  margin-top: 10px;
  font-weight: bold;
}

.reset-link {
  font-size: 0.9rem;
  color: #d40000;
  text-decoration: underline;
}

.price {
  font-size: 1.2rem;
  font-weight: bold;
  margin-top: 10px;
  margin-bottom: 20px;
}

/* Brand logo styles */
.brand-logo {
  display: block;
  margin: 0 auto 20px auto;
  max-width: 180px;
  height: auto;
}

/* Instructions box styles */
.instructions-box {
  background-color: #ffffff;
  color: #000000;
  border: 2px solid #000000;
  padding: 15px;
  margin: 20px 0;
  border-radius: 4px;
  text-align: left;
  box-sizing: border-box;
  line-height: 1.4;
}

/* Button styles */
.primary-button {
  display: inline-block;
  background-color: #d40000; /* vivid red */
  color: #ffffff; /* white text for contrast */
  border: none;
  padding: 12px 24px;
  font-size: 1rem;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.primary-button:focus,
.primary-button:hover {
  outline: 3px dashed #000000;
  outline-offset: 2px;
}

/* Form styles */
form {
  width: 100%;
  margin-top: 20px;
  text-align: left;
}

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

.form-group label {
  display: block;
  font-weight: bold;
  margin-bottom: 4px;
}

.form-group input[type='text'],
.form-group input[type='email'],
.form-group input[type='tel'],
.form-group input[type='password'],
.form-group input[type='number'],
.form-group input[type='checkbox'],
.form-group input[type='range'] {
  font-size: 1rem;
}

.form-group input[type='text'],
.form-group input[type='email'],
.form-group input[type='tel'],
.form-group input[type='password'],
.form-group input[type='number'],
.form-group input[type='date'],
.form-group input[type='range'] {
  width: 100%;
  padding: 10px;
  border: 2px solid #000000;
  border-radius: 4px;
  background-color: #ffffff;
  color: #000000;
  box-sizing: border-box;
}

.form-group input[type='checkbox'] {
  width: auto;
  margin-right: 8px;
}

.form-group .error-message {
  display: none;
  color: #d40000;
  font-size: 0.875rem;
  margin-top: 4px;
}

.form-group input[aria-invalid='true'] {
  border-color: #d40000;
}

/* Focus styles for inputs */
.form-group input:focus {
  outline: 2px dashed #000000;
  outline-offset: 2px;
}

/* Accessibility note: use strong contrast and clear focus indications */

/* Responsive behaviour */
@media (min-width: 600px) {
  main {
    padding: 40px;
  }
  h1 {
    font-size: 2.2rem;
  }
  .price {
    font-size: 1.4rem;
  }
}