* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f4f6f8;
  color: #333;
  padding: 20px;
  max-width: 900px;
  margin: 0 auto;
}

h1 {
  text-align: center;
  margin-bottom: 20px;
  color: #2c3e50;
}

form {
  background: #fff;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-columns {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.form-columns > fieldset {
  flex: 1;
  min-width: 300px;
}

fieldset {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
}

legend {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c3e50;
  padding: 0 8px;
}

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

label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.9rem;
  font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #5a9e6f;
  box-shadow: 0 0 0 2px rgba(90, 158, 111, 0.2);
}

.name-row {
  display: flex;
  gap: 12px;
}

.name-row .form-group {
  flex: 1;
}

/* Image preview */
.image-preview-container {
  width: 100%;
  height: 200px;
  border: 2px dashed #ccc;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 10px;
  background: #fafafa;
  position: relative;
}

.image-preview-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: none;
}

.image-preview-container img.visible {
  display: block;
}

#previewPlaceholder {
  color: #aaa;
  font-size: 0.95rem;
}

#previewPlaceholder.hidden {
  display: none;
}

.file-input-row {
  margin-bottom: 12px;
}

/* Radio group */
.radio-group {
  display: flex;
  gap: 15px;
  margin-top: 4px;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 400;
  cursor: pointer;
}

/* Payment section */
.payment-details {
  max-width: 600px;
  margin: 0 auto 20px;
}

.payment-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.payment-row .form-group {
  flex: 1;
  min-width: 120px;
}

.card-number-group {
  flex: 2 !important;
}

.expiration-inputs {
  display: flex;
  align-items: center;
  gap: 4px;
}

.expiration-inputs input {
  width: 60px;
}

.terms-group {
  margin-top: 10px;
}

.terms-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  cursor: pointer;
}

/* Error messages */
.error-messages {
  background: #fce4e4;
  border: 1px solid #e0a0a0;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 15px;
  color: #c0392b;
  font-size: 0.9rem;
}

.error-messages ul {
  margin: 0;
  padding-left: 18px;
}

.error-messages li {
  margin-bottom: 3px;
}

input.invalid,
textarea.invalid,
select.invalid {
  border-color: #e74c3c;
  background-color: #fdf2f2;
}

/* Submit button */
#sendBtn {
  display: block;
  width: 200px;
  margin: 0 auto;
  padding: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c3e50;
  background-color: #c8e6c9;
  border: 2px solid #81c784;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}

#sendBtn:hover {
  background-color: #a5d6a7;
}

/* Result pages */
.result-page {
  text-align: center;
  margin-top: 60px;
  background: #fff;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.result-icon {
  font-size: 4rem;
  color: #27ae60;
  margin: 20px 0;
}

.error-icon {
  color: #e74c3c;
}

.error-reason {
  font-size: 1.1rem;
  color: #555;
  margin-bottom: 20px;
}

.back-link {
  display: inline-block;
  margin-top: 20px;
  padding: 10px 24px;
  background-color: #5a9e6f;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.back-link:hover {
  background-color: #4a8a5e;
}

/* Payment details on success page */
.payment-summary {
  text-align: left;
  margin: 20px auto;
  max-width: 400px;
}

.payment-summary p {
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.payment-summary strong {
  display: inline-block;
  width: 120px;
}

.payment-summary img {
  max-width: 200px;
  max-height: 200px;
  border-radius: 6px;
  margin-top: 10px;
}