@charset "utf-8";

/*
   Hiking Arkansas Website
   Author: Mitchell Martin
   Date: December 10, 2025

   Filename: form.css
   Enhanced form styles with validation
*/

/* ===== FORM LAYOUT ===== */
form#contactSurvey {
   display: flex;
   flex-flow: row wrap;
   gap: 20px;
}

form#contactSurvey > fieldset {
   background-color: white;
   border: 2px solid #2c5f2d;
   border-radius: 12px;
   flex: 1 1 350px;
   padding: 20px;
   box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* ===== FIELDSET & LEGEND ===== */
fieldset {
   border: 2px solid #2c5f2d;
   border-radius: 8px;
   padding: 15px;
   margin-bottom: 20px;
}

legend {
   background-color: #2c5f2d;
   color: white;
   padding: 8px 20px;
   border-radius: 5px;
   font-family: Georgia, serif;
   font-size: 1.1em;
}

/* ===== FORM ROW LAYOUT ===== */
.formRow {
   display: flex;
   flex-flow: row wrap;
   align-items: center;
   margin: 12px 0;
   gap: 10px;
}

.formRow > label {
   flex: 0 0 180px;
   font-weight: bold;
   color: #2c5f2d;
   font-size: 0.95em;
}

.formRow > input,
.formRow > select,
.formRow > textarea {
   flex: 1 1 200px;
   padding: 10px 15px;
   border: 2px solid #ccc;
   border-radius: 8px;
   font-family: Aptos, Arial, sans-serif;
   font-size: 1em;
   transition: all 0.3s ease;
   background-color: #fafafa;
}

/* ===== INPUT FOCUS STYLES ===== */
.formRow > input:focus,
.formRow > select:focus,
.formRow > textarea:focus {
   outline: none;
   border-color: #2c5f2d;
   background-color: #e8f5e9;
   box-shadow: 0 0 8px rgba(44, 95, 45, 0.2);
}

/* ===== SELECT DROPDOWN ===== */
.formRow > select {
   cursor: pointer;
   appearance: none;
   background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232c5f2d' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
   background-repeat: no-repeat;
   background-position: right 12px center;
   background-size: 20px;
   padding-right: 45px;
}

/* ===== TEXTAREA ===== */
textarea {
   resize: vertical;
   min-height: 120px;
   line-height: 1.5;
}

/* ===== CHECKBOX & RADIO GROUPS ===== */
fieldset.optionGroup {
   border: 1px solid #ddd;
   background-color: #f9f9f9;
   padding: 10px 15px;
   margin: 5px 0;
}

fieldset.optionGroup legend {
   background-color: transparent;
   color: #2c5f2d;
   font-size: 0.9em;
   padding: 5px 10px;
}

.checkboxGroup,
.radioGroup {
   display: flex;
   flex-wrap: wrap;
   gap: 15px;
   padding: 10px 0;
}

.checkboxGroup label,
.radioGroup label {
   display: flex;
   align-items: center;
   gap: 8px;
   cursor: pointer;
   padding: 5px 10px;
   border-radius: 5px;
   transition: background-color 0.3s ease;
}

.checkboxGroup label:hover,
.radioGroup label:hover {
   background-color: #e8f5e9;
}

.checkboxGroup input[type="checkbox"],
.radioGroup input[type="radio"] {
   width: 18px;
   height: 18px;
   accent-color: #2c5f2d;
   cursor: pointer;
}

/* ===== RANGE SLIDER ===== */
.rangeContainer {
   display: flex;
   align-items: center;
   gap: 15px;
   flex: 1 1 200px;
}

.rangeContainer input[type="range"] {
   flex: 1;
   height: 8px;
   -webkit-appearance: none;
   appearance: none;
   background: linear-gradient(to right, #4caf50, #ff9800, #f44336);
   border-radius: 5px;
   cursor: pointer;
}

.rangeContainer input[type="range"]::-webkit-slider-thumb {
   -webkit-appearance: none;
   appearance: none;
   width: 22px;
   height: 22px;
   background: #2c5f2d;
   border-radius: 50%;
   border: 3px solid white;
   box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
   cursor: pointer;
}

.rangeContainer input[type="range"]::-moz-range-thumb {
   width: 22px;
   height: 22px;
   background: #2c5f2d;
   border-radius: 50%;
   border: 3px solid white;
   box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
   cursor: pointer;
}

.rangeContainer span {
   font-weight: bold;
   color: #333;
   min-width: 60px;
}

output {
   background-color: #2c5f2d;
   color: white;
   padding: 5px 12px;
   border-radius: 5px;
   font-weight: bold;
   min-width: 40px;
   text-align: center;
}

/* ===== FORM BUTTONS ===== */
.formButtons {
   display: flex;
   justify-content: center;
   gap: 20px;
   width: 100%;
   margin-top: 25px;
   flex-wrap: wrap;
}

.formButtons input[type="submit"],
.formButtons input[type="reset"],
.formButtons button {
   padding: 12px 35px;
   font-size: 1.1em;
   font-weight: bold;
   border-radius: 8px;
   cursor: pointer;
   transition: all 0.3s ease;
   font-family: Aptos, Arial, sans-serif;
   text-transform: uppercase;
   letter-spacing: 0.03em;
}

.formButtons input[type="submit"],
.formButtons button[type="submit"] {
   background-color: #2c5f2d;
   color: white;
   border: 2px solid #2c5f2d;
   box-shadow: 0 4px 10px rgba(44, 95, 45, 0.3);
}

.formButtons input[type="submit"]:hover,
.formButtons button[type="submit"]:hover {
   background-color: #1a3a1a;
   box-shadow: 0 6px 15px rgba(44, 95, 45, 0.4);
   transform: translateY(-2px);
}

.formButtons input[type="reset"],
.formButtons button[type="reset"] {
   background-color: white;
   color: #2c5f2d;
   border: 2px solid #2c5f2d;
}

.formButtons input[type="reset"]:hover,
.formButtons button[type="reset"]:hover {
   background-color: #2c5f2d;
   color: white;
}

/* ===== VALIDATION STYLES ===== */
input:required,
select:required,
textarea:required {
   border-left: 4px solid #ff9800;
}

input:focus:valid,
select:focus:valid,
textarea:focus:valid {
   border-color: #4caf50;
   border-left: 4px solid #4caf50;
   background-color: rgba(76, 175, 80, 0.1);
}

input:focus:invalid,
select:focus:invalid,
textarea:focus:invalid {
   border-color: #f44336;
   border-left: 4px solid #f44336;
   background-color: rgba(244, 67, 54, 0.1);
}

/* Validation icons using pseudo-elements on parent */
.formRow.valid input,
.formRow.valid select,
.formRow.valid textarea {
   background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%234caf50' stroke-width='3'%3e%3cpolyline points='20 6 9 17 4 12'%3e%3c/polyline%3e%3c/svg%3e");
   background-repeat: no-repeat;
   background-position: right 10px center;
   background-size: 20px;
   padding-right: 40px;
}

.formRow.invalid input,
.formRow.invalid select,
.formRow.invalid textarea {
   background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23f44336' stroke-width='3'%3e%3cline x1='18' y1='6' x2='6' y2='18'%3e%3c/line%3e%3cline x1='6' y1='6' x2='18' y2='18'%3e%3c/line%3e%3c/svg%3e");
   background-repeat: no-repeat;
   background-position: right 10px center;
   background-size: 20px;
   padding-right: 40px;
}

/* ===== REQUIRED INDICATOR ===== */
label.required::after {
   content: " *";
   color: #f44336;
   font-weight: bold;
}

/* ===== HELPER TEXT ===== */
.helperText {
   font-size: 0.85em;
   color: #666;
   margin-top: 5px;
   font-style: italic;
}

.errorText {
   font-size: 0.85em;
   color: #f44336;
   margin-top: 5px;
   display: none;
}

input:invalid ~ .errorText,
select:invalid ~ .errorText,
textarea:invalid ~ .errorText {
   display: block;
}

/* ===== RESPONSIVE FORM - TABLET ===== */
@media (max-width: 768px) {
   form#contactSurvey > fieldset {
      flex: 1 1 100%;
   }
   
   .formRow > label {
      flex: 1 1 100%;
      margin-bottom: 5px;
   }
   
   .formRow > input,
   .formRow > select,
   .formRow > textarea {
      flex: 1 1 100%;
   }
   
   .formButtons {
      flex-direction: column;
      align-items: center;
   }
   
   .formButtons input,
   .formButtons button {
      width: 100%;
      max-width: 300px;
   }
}

/* ===== RESPONSIVE FORM - MOBILE ===== */
@media (max-width: 480px) {
   form#contactSurvey > fieldset {
      padding: 15px;
   }
   
   legend {
      font-size: 1em;
      padding: 6px 15px;
   }
   
   .checkboxGroup,
   .radioGroup {
      flex-direction: column;
      gap: 10px;
   }
   
   .rangeContainer {
      flex-direction: column;
      align-items: stretch;
   }
   
   .rangeContainer span {
      text-align: center;
   }
}
