/* ============================================================
   FORM.CSS — Universal styling for all forms
   Mirrors philosophy of various css files for structural and appearance consistency.
   ============================================================ */

/* Universal form container */
.uniform-form {
    display: block;
    box-sizing: border-box; /* required: maintain alignment within table cells */
    width: 100%;
    margin: 0 auto;
/*top right bottom left, the text inside the input*/
    padding: 0px 0px 6px 0px;
    background-color: transparent;
    border-radius: 0;
    box-shadow: 0 0 1px rgba(0,100,0,0.1);
    font-size: 1.05em;
    text-align: left;
}

/* Reset and normalize all child elements */
.uniform-form * {
    box-sizing: border-box; /* critical: input/select sizing stability */
    font-size: 1.05em;
    line-height: 1.1em;

}

/* ----------------------------------------
   LABELS
----------------------------------------- */
.uniform-form label {
    display: block;
    margin-bottom: 0em;
    font-weight: normal;
}

/* ----------------------------------------
   TEXT INPUTS AND PASSWORD FIELDS
----------------------------------------- */
.uniform-form input[type="text"],
.uniform-form input[type="password"],
.uniform-form input[type="email"],
.uniform-form input[type="number"],
.uniform-form input[type="date"],
.uniform-form input[type="time"],
.uniform-form input[type="url"],
.uniform-form input[type="search"] {
    font-family: 'Georgia', serif;        
    font-size: 1.05em;
    display: block;
    max-width: 100%;
    width: 100%;
   min-width: 0;
    flex: 0 0 auto;
    overflow: hidden;
/*top right bottom left, the text inside the input*/
    padding: 6px 6px 6px 6px;
    margin-bottom: 0em;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #d9ffd9;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    line-height: 1.1em;
}

/* Hover / focus states for text inputs */
.uniform-form input[type="text"]:hover,
.uniform-form input[type="password"]:hover,
.uniform-form input[type="email"]:hover,
.uniform-form input[type="number"]:hover,
.uniform-form input[type="date"]:hover,
.uniform-form input[type="time"]:hover,
.uniform-form input[type="url"]:hover,
.uniform-form input[type="search"]:hover {
    border-color: #999;
}

.uniform-form input[type="text"]:focus,
.uniform-form input[type="password"]:focus,
.uniform-form input[type="email"]:focus,
.uniform-form input[type="number"]:focus,
.uniform-form input[type="date"]:focus,
.uniform-form input[type="time"]:focus,
.uniform-form input[type="url"]:focus,
.uniform-form input[type="search"]:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 4px rgba(76, 175, 80, 0.4);
    outline: none;
}

/* ----------------------------------------
   SELECT DROPDOWNS CENTERED
----------------------------------------- */
.centered-dropdown {
    text-align: center;  /* Centers text inside the select element */
    display: block;      /* Ensures the dropdown spans the full width of the container */
    width: 100%;         /* Ensures the dropdown is 100% width of the container */
    margin: 0 auto;      /* Centers the select element itself */
}

/* ----------------------------------------
   SELECT DROPDOWNS
----------------------------------------- */
.uniform-form select {
    display: table-row-group;
    width: 100%;
/*top right bottom left, the text inside the input*/
    padding: 6px 6px 6px 6px;
    margin-bottom: 0em;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #d9ffd9;
    font-family: 'Georgia', serif;       
    font-size: 1.05em;
    appearance: none;
//    background-image: linear-gradient(45deg, transparent 50%, #555 50%), 
                      linear-gradient(135deg, #555 50%, transparent 50%);
    background-position: calc(100% - 15px) center, calc(100% - 10px) center;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    line-height: 1.15em;
}

.uniform-form select:hover {
    border-color: #999;
}

.uniform-form select:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 4px rgba(76, 175, 80, 0.4);
    outline: none;
}

/* ----------------------------------------
   CHECKBOXES AND RADIO BUTTONS
----------------------------------------- */
.uniform-form input[type="checkbox"],
.uniform-form input[type="radio"] {
    appearance: none;
    width: 1em;
    height: 1em;
    border: 1px solid #888;
    border-radius: 2px;
    background-color: #d9ffd9;
    cursor: pointer;
    margin-right: 0.5em;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

.uniform-form input[type="checkbox"]:checked,
.uniform-form input[type="radio"]:checked {
    background-color: #4CAF50;
    border-color: #4CAF50;
}

.uniform-form input[type="radio"] {
    border-radius: 50%;
}

/* ----------------------------------------
   TEXTAREAS
----------------------------------------- */
.uniform-form textarea {
    width: 100%;
/*top right bottom left, the text inside the input*/
    padding: 6px 6px 6px 6px;
    margin-bottom: 1em;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #d9ffd9;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.uniform-form textarea:hover {
    border-color: #999;
}

.uniform-form textarea:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 4px rgba(76, 175, 80, 0.4);
    outline: none;
}

/* ----------------------------------------
   FIELDSETS AND LEGENDS
----------------------------------------- */
.uniform-form fieldset {
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 0.25em;
    margin-bottom: 1em;
}

.uniform-form legend {
    font-weight: bold;
    /*color: #333;*/
    padding: 0.5em 0.5em;
}

/* ----------------------------------------
   ERROR / VALIDATION MESSAGES
----------------------------------------- */
.uniform-form .error-message {
/* This is the centralized messaging area*/
    font-size: 1.1em;
    color: red;
    font-weight: lighter;
/* top right bottom left*/
    margin: 0px 0px 0px 0px;
    padding: 6px 6px 6px 6px;
    text-align: left; 
}


/* ----------------------------------------
   SUCCESS MESSAGE
----------------------------------------- */
.uniform-form .success-message {
/* This is the centralized messaging area*/
    font-size: 1.1em;
    color: #4CAF50;
    font-weight: bold;
/* top right bottom left*/
    margin: 0px 0px 0px 0px;
    padding: 6px 6px 6px 6px;
}


/* ----------------------------------------
   INFO MESSAGE
----------------------------------------- */
.uniform-form .info-message {
/* This is the centralized messaging area*/
    font-size: 1.1em;
    color: black;
    font-weight: lighter;
/* top right bottom left*/
    margin: 0px 0px 0px 0px;
    padding: 6px 6px 6px 6px;
}

/* ----------------------------------------
   FORM LAYOUT VARIANTS
----------------------------------------- */
.uniform-form.inline label {
    display: inline-block;
    margin-right: 1em;
}

.uniform-form.inline input,
.uniform-form.inline select {
    display: inline-block;
    width: auto;
    vertical-align: middle;
}

/* ----------------------------------------
   RESPONSIVE ADJUSTMENTS
----------------------------------------- */
@media (max-width: 600px) {
    .uniform-form {
/*top right bottom left*/
padding: 0px 0px 4px 0px;
        max-width: 100%;
//    background-color: #d9ffd9;
    }

/* Ensure grid spacing comes only from TABLE.CSS */
.uniform-form input,
.uniform-form select,
.uniform-form textarea {
    margin: 0 !important;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

}
