/* Registered Address textarea styling - Royal Mail addressing format and auto-resize */
textarea.readonly-field {
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 1rem;
  font-size: 1rem;
  box-sizing: border-box;
  height: auto !important;
  min-height: 3rem;
  line-height: 1.5;
  white-space: pre-line;
  word-break: break-word;
  resize: none;
  color: #333;
  overflow: hidden;
  font-family: inherit;
  text-transform: none;
}

textarea.readonly-field:focus {
  border-color: #5d147c;
  box-shadow: 0 0 0 3px rgba(93, 20, 124, 0.1);
  outline: none;
}
/* Base Styles */
body {
  font-size: 16px;
  padding: 0 1rem;
  background-color: #fff;
}

h1, h2, h3 {
    margin: 1rem 0;
    color: #5d147c; /* Your brand color */
    letter-spacing: -0.5px;
    line-height: 1.25;
}

a.skip-link {
    position: absolute;
    left: -9999px; 
}

a.skip-link:focus {
    position: static;
    left: auto;
    top: 1rem;
    background: #5d147c;
    color: white;
    padding: 8px 16px;
    z-index: 1000;
    text-decoration: none;
    border-radius: 4px;
}

/* Form Styles */
.container {
  padding: 0;
  max-width: 100%;
}

.form-wrapper {
  padding: 2rem 1.5rem;
  margin: 2rem auto;
  max-width: 960px;
  transition: all 0.3s ease-in-out;
}

h1 {
    text-align: center;
}

/* Progress Bar */
.progress-bar {
    background-color: #e0e0e0;
    border-radius: 4px;
    height: 10px;
    margin: 1rem 0; 
}

.progress {
    background-color: #5d147c;
    height: 100%;
    border-radius: 4px;
}

/* Step Indicator */
.step-indicator {
    text-align: center;
    margin-bottom: 1rem;
}

.step-indicator strong {
    font-size: 1.2rem;
}

/* Grid and Form Group Styles */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 600px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .form-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.form-group {
  margin-bottom: 1rem;
}

form input[type="text"],
form input[type="email"],
form input[type="number"] {
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 1rem;
  font-size: 1rem;
  box-sizing: border-box;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

form input:focus {
  border-color: #5d147c;
  box-shadow: 0 0 0 3px rgba(93, 20, 124, 0.1);
}

/* Button Styles */
.button {
  background: #5d147c;
  color: white;
  border: none;
  border-radius: 6px;
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  margin-top: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.button:hover {
  background-color: #4a105f;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Accessibility Enhancements */
label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #444;
    font-size: 0.95rem;
}

input:focus {
    outline: 2px solid #5d147c; /* Accessible focus ring */
}

/* Responsive Styles */

@media (min-width: 600px) {
  .form-group {
    flex: 1 1 48%;
  }
}

@media (min-width: 900px) {
  .form-group {
    flex: 1 1 30%;
  }
}
/* Card Aesthetic for Service Options */
.interactive-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.25rem;
    transition: border 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.interactive-card:hover,
.interactive-card.active {
    border-color: #5d147c;
    box-shadow: 0 0 0 2px rgba(93, 20, 124, 0.15);
}

.interactive-card h3 {
    margin-top: 0;
    color: #5d147c;
}

.interactive-card p {
    color: #555;
    font-size: 0.95rem;
}

/* Ensure mobile-friendliness of .form-wrapper */
.form-wrapper {
    overflow-x: hidden;
}
/* Company Results List Styles */
#company_results {
  background: #fff;
  border-radius: 6px;
  margin-top: 0.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  font-size: 0.95rem;
  line-height: 1.4;
  max-height: 250px;
  overflow-y: auto;
}

#company_results .company-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background 0.2s ease-in-out;
}

#company_results .company-item:hover {
  background-color: #f5f0f8;
}

#company_results .company-item:last-child {
  border-bottom: none;
}

#company_results .company-item small {
  color: #666;
  display: block;
  margin-top: 2px;
  font-size: 0.85rem;
}

/* Autocomplete and Company Results Dropdown Styles */
#autocomplete-list,
.results {
  position: relative;
  width: 100%;
  border-radius: 6px;
  margin-top: 0.25rem;
  background: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  overflow: hidden;
}

.results:empty {
  border: none;
  padding: 0;
  margin: 0;
  box-shadow: none;
}

#autocomplete-list li,
.results .company-item {
  padding: 1rem;
  font-size: 1rem;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

#autocomplete-list li:hover,
.results .company-item:hover {
  background: #f8f5fb;
}