/* ========================================
   FORM STYLES
   ======================================== */

/* Base Form Elements */
input,
select,
textarea {
    font-style: italic;
    font-size: 0.9em;
    line-height: 1.2;
    color: #666666;
    border: 1px solid #444444;
    border-radius: 4px;
    padding: 5px;
}

input[type="password"] {
    padding-right: 40px;
}

input.read-only {
    border: none;
    background-color: #f6f6f6;
}

/* Form Groups */
.form-group {
    margin-bottom: 15px;
}

/* Form Controls */
.form-control {
    width: 100%;
    min-width: 100px;
    padding: 10px 12px;
    font-size: 1em;
    border: 1px solid #444444;
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out;
}

.form-control:focus {
    outline: 0;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* Form Rows and Layout */
.form-row {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    align-items: flex-start;
}

.form-section,
.form-half {
    flex:1;
    max-width: none;
}

.form-label,
.form-group label {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    width: 130px;
    max-width: 130px;
    font-weight: 600; 
    font-size: 1em;
    padding-top: 8px;
    margin-bottom: 10px;
    flex-shrink: 0;
    user-select: none;
}

.form-input {
    flex: 1;
    max-width: 540px;
}

.form-input input,
.form-input select,
.form-input textarea {
    width: 100%;
}

.form-input textarea {
    resize: vertical;
}

.form-section .form-input {
    max-width: none;
}

/* Character Count */
.character-count {
    font-size: 0.75em;
    text-align: right;
    color: #888;
}

/* Password Field */
.password-field-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
}

/* Form Alerts */
#form-errors,
#add-form-errors {
    margin-bottom: 25px;
    display: none;
}

.form-error {
    font-size: 0.9em;
    font-style: italic;
    color: #e95a27;
    padding-bottom: 15px;
}

#form-success {
    margin-bottom: 25px;
    display: none;
}

.form-success {
    font-size: 0.9em;
    font-style: italic;
    color: #899a78;
    padding-bottom: 15px;
}

/* Alert Messages */
.alert {
    margin-bottom: 10px;
    border-radius: 4px;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
    padding: 12px 16px;
}

.alert a {
    color: inherit;
    font-weight: 400; 
}

/* Control Inputs (for inline controls) */
input.control-input,
select.control-select {
    padding: 4px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85em;
    min-width: 0;
    transition: border-color 0.2s ease;
}

.control-input:focus,
.control-select:focus {
    outline: none;
    border-color: #899a78;
}

div.form-input {
    padding-top: 8px;
}

/* Image Sliders */
.slider-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.slider-group p {
    margin-bottom: 0;
}

.slider-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    font-size: 1em;
}

.slider {
    display: inline-block;
    width: 50px;
    height: 24px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    cursor: pointer;
    user-select: none;
}

.slider-y {
    background-image: url('../img/slider-y.png');
}

.slider-no {
    background-image: url('../img/slider-n.png');
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .form-input {
        width: 100%;
        max-width: 100%;
    }

    .form-section .form-label,
    .form-group label {
        width: 100%;
        max-width: 100%;
    }

    .form-section .form-input,
    .form-group input {
        width: 100%;
        max-width: 100%;
    }
}