/*
 * Forms - Input fields, form layouts, and validation
 */

.quote-form {
  max-width: 800px;
  margin: 0 auto 48px;
  padding: 48px 40px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(26, 32, 44, 0.08);
}

.quote-form .section-header {
  margin-bottom: 32px;
}

.quote-form .eyebrow {
  text-transform: uppercase;
  letter-spacing: 1.4px;
  font-size: 0.75rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.quote-form .section-header h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.quote-form .section-header p {
  font-size: 1.05rem;
  color: var(--slate-600);
  line-height: 1.6;
}

.quote-fields {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.quote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px 20px;
}

.quote-grid.two-col {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

/* Field */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label,
.field .field-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--slate-800);
}

.field .required {
  color: var(--brand-red);
  font-weight: 800;
}

.field input,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid var(--slate-200);
  font-size: 1rem;
  font-family: inherit;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--slate-400);
}

.field input:hover,
.field textarea:hover {
  border-color: var(--slate-300);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand-red);
  box-shadow: 0 0 0 4px rgba(219, 30, 54, 0.12);
  background: #ffffff;
}

.field textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.6;
}

/* Checkbox */
.checkbox-field {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.checkbox-field input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--brand-red);
  cursor: pointer;
}

.checkbox-field label {
  font-weight: 400;
  cursor: pointer;
}

/* Product Options */
.products-single {
  padding-top: 8px;
}

.products-single .field-label {
  font-size: 1rem;
  margin-bottom: 4px;
}

.products-single .products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.product-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  border-radius: 12px;
  border: 2px solid var(--slate-200);
  background: var(--slate-50);
  cursor: pointer;
  transition: all 0.2s ease;
}

.product-option:hover {
  border-color: var(--slate-300);
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.product-option:has(input[type="checkbox"]:checked) {
  border-color: var(--brand-red);
  background: rgba(219, 30, 54, 0.02);
  box-shadow: 0 4px 16px rgba(219, 30, 54, 0.12);
}

.product-option input[type="checkbox"] {
  margin-top: 2px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--brand-red);
}

.product-name {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  color: var(--slate-800);
  margin-bottom: 4px;
}

.product-desc {
  display: block;
  color: var(--slate-600);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Actions */
.actions {
  margin-top: 8px;
}

.actions .button {
  padding: 16px 32px;
  font-size: 1.05rem;
  border-radius: 12px;
}

.small-print {
  margin: 16px 0 0;
  font-size: 0.85rem;
  color: var(--slate-500);
  line-height: 1.6;
  text-align: center;
}

/* Form Messages */
.form-errors {
  background: rgba(219, 30, 54, 0.08);
  border: 2px solid rgba(219, 30, 54, 0.35);
  color: #7b1a27;
  padding: 14px 16px;
  border-radius: 12px;
  font-weight: 700;
  margin-bottom: 24px;
}

.form-errors p {
  margin: 0;
}

.form-success {
  background: rgba(72, 187, 120, 0.12);
  border: 2px solid rgba(72, 187, 120, 0.4);
  color: #276749;
  padding: 14px 16px;
  border-radius: 12px;
  font-weight: 700;
  margin-bottom: 24px;
}

.form-success p {
  margin: 0;
}

/* Address Checker */
.address-checker-form {
  width: 100%;
}

.address-input-wrapper {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.address-input {
  flex: 1;
  padding: 14px 18px;
  border: 2px solid var(--slate-300);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: white;
}

.address-input:focus {
  outline: none;
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(219, 30, 54, 0.1);
}

.address-input::placeholder {
  color: var(--slate-400);
}

.address-input-wrapper .button {
  white-space: nowrap;
  padding: 14px 24px;
}

.address-result {
  min-height: 60px;
  padding: 20px;
  border-radius: 10px;
  font-size: 0.9375rem;
  line-height: 1.6;
  display: none;
}

.address-result.show {
  display: block;
}

.address-result.success {
  background: #c6f6d5;
  color: #22543d;
  border: 2px solid #9ae6b4;
}

.address-result.error {
  background: #fed7d7;
  color: #742a2a;
  border: 2px solid #fc8181;
}

.address-result.info {
  background: #bee3f8;
  color: #2c5282;
  border: 2px solid #90cdf4;
}

.address-result.warning {
  background: #fef3c7;
  color: #78350f;
  border: 2px solid #fbbf24;
}

.address-result strong {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 1.0625rem;
}

.address-suggestions {
  position: relative;
  margin: -4px 0 16px 0;
  background: white;
  border: 2px solid var(--slate-200);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 400px;
  overflow-y: auto;
  display: none;
  z-index: 100;
}

.address-suggestions.show {
  display: block;
}

.suggestion-item {
  padding: 14px 18px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  border-bottom: 1px solid var(--slate-50);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover {
  background: var(--slate-50);
  border-left: 3px solid var(--brand-red);
}

.suggestion-address {
  flex: 1;
  font-size: 0.9375rem;
  color: var(--slate-700);
  font-weight: 600;
}

.suggestion-status {
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.suggestion-item:hover .suggestion-status {
  background: white;
}

/* Application Form */
.application-form-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 24px;
}

.application-form-header {
  text-align: center;
  margin-bottom: 32px;
}

.application-form-header h2 {
  margin: 0 0 8px;
  font-size: 1.75rem;
  color: var(--text-dark);
}

.application-form-header p {
  margin: 0;
  color: var(--text-muted);
}

.application-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: white;
  border-radius: 16px;
  padding: 40px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
}

.application-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.application-form .form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.application-form label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-dark);
}

.application-form .form-input,
.application-form .form-textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 10px;
  border: 2px solid var(--slate-200);
  font-size: 1rem;
  font-family: inherit;
  background: white;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.application-form .form-input:focus,
.application-form .form-textarea:focus {
  outline: none;
  border-color: var(--brand-red);
  box-shadow: 0 0 0 4px rgba(219, 30, 54, 0.1);
}

.application-form .form-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.application-form .form-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.application-form .form-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.application-form .form-errors {
  background: rgba(219, 30, 54, 0.08);
  border: 2px solid rgba(219, 30, 54, 0.35);
  color: #7b1a27;
  padding: 16px 20px;
  border-radius: 10px;
}

.application-form .form-errors h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.application-form .form-errors ul {
  margin: 0;
  padding-left: 20px;
}

.application-form .form-errors li {
  margin-bottom: 4px;
}

@media (max-width: 640px) {
  .application-form {
    padding: 24px;
  }

  .application-form .form-actions {
    flex-direction: column;
  }

  .application-form .form-actions .button {
    width: 100%;
    text-align: center;
  }
}

/* Responsive */
@media (max-width: 960px) {
  .quote-form {
    padding: 32px 24px;
  }

  .quote-form .section-header h2 {
    font-size: 1.6rem;
  }

  .products-single .products-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .address-input-wrapper {
    flex-direction: column;
  }

  .address-input-wrapper .button {
    width: 100%;
  }
}
