/* ==================================================
   FORM INITIALIZATION
================================================== */

/* Base Form Styles */
.form-group {
    margin-bottom: 1rem;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-control {
    display: block;
    width: 100%;
    height: 38px; /* Standard height for all inputs */
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* Ensure select elements match input height */
select.form-control,
select.form-select {
    height: 38px;
    padding-right: 1.75rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}

/* Ensure time inputs match height */
input[type="time"].form-control {
    height: 38px;
}

/* Ensure text inputs maintain height */
input[type="text"].form-control,
input[type="email"].form-control,
input[type="password"].form-control {
    height: 38px;
}

/* Form Validation */
.is-invalid {
    border-color: #dc3545;
}

.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 80%;
    color: #dc3545;
}

.is-invalid ~ .invalid-feedback {
    display: block;
}

/* Form Layout */
.form-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    width: 100%;
    margin-bottom: 0.75rem;
}

.form-col {
    position: relative;
    width: 100%;
    padding-right: 5px;
    padding-left: 5px;
}

/* Form Sizes */
.form-control-sm {
    height: 32px;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.2rem;
}

.form-control-lg {
    height: 48px;
    padding: 0.5rem 1rem;
    font-size: 1.25rem;
    line-height: 1.5;
    border-radius: 0.3rem;
}

/* Form States */
.form-control:disabled,
.form-control[readonly] {
    background-color: #e9ecef;
    opacity: 1;
}

/* Form Groups */
.input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}

.input-group-prepend {
    margin-right: -1px;
    display: flex;
}

.input-group-append {
    margin-left: -1px;
    display: flex;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    margin-bottom: 0;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    text-align: center;
    white-space: nowrap;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    height: 38px; /* Match input height */
}

/* Form Check */
.form-check {
    position: relative;
    display: block;
    padding-left: 1.25rem;
}

.form-check-input {
    position: absolute;
    margin-top: 0.3rem;
    margin-left: -1.25rem;
}

.form-check-label {
    margin-bottom: 0;
}

/* Form Select */
.form-select {
    display: block;
    width: 100%;
    padding: 0.375rem 1.75rem 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    appearance: none;
}

/* Responsive Form Styles */
/* @media (max-width: 768px) {
    .form-control {
        height: 36px;
        font-size: 0.9rem;
        padding: 0.4rem 0.6rem;
    }
    
    .form-label {
        font-size: 0.9rem;
    }
} */

/* @media (max-width: 576px) {
    .form-control {
        height: 34px;
        font-size: 0.85rem;
        padding: 0.35rem 0.5rem;
    }
    
    .form-label {
        font-size: 0.85rem;
    }
    
    .form-row {
        margin-right: -3px;
        margin-left: -3px;
    }
    
    .form-col {
        padding-right: 3px;
        padding-left: 3px;
    }
} */

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

/* Form Labels */
/* label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.5rem;
    display: block;
} */

/* Form Inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="time"],
select,
.form-control {
    width: 100%;
    height: 38px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #495057;
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    line-height: 1.5;
    box-sizing: border-box;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="time"]:focus,
select:focus {
    outline: none;
    border-color: #4ea5f2;
    box-shadow: 0 0 0 0.2rem rgba(78, 165, 242, 0.25);
}

/* Form Rows */
.form-row-background {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 0.75rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.form-row-bkg-accprofile {
    gap: 1rem;
    margin-bottom: 0.75rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.section-background {
    border-radius: 10px;
    /* border: 1px solid #e9ecef; */
    margin-bottom: 1.5rem;
    padding: 1.5em 3%;
    background: #f8f9fa;
}

/* Form Columns */
.column-forms {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
    overflow: hidden;
}

/* Error States */
.error-message {
    color: #dc3545;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.error-border {
    border-color: #dc3545 !important;
}

.container-campaign h5 {
    margin-bottom: 1.5rem;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.btn-gap {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    margin-top: 1.5rem;
}

/* @media screen and (max-width: 1366px) {
    .form-row,
    .form-row-background {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media screen and (max-width: 900px) {
    .form-row,
    .form-row-background {
        grid-template-columns: repeat(2, 1fr);
    }
    .section-background {
        padding: 1rem;
    }
}

@media screen and (max-width: 576px) {
    .form-row,
    .form-row-background {
        grid-template-columns: 1fr;
    }
    .section-background {
        padding: 0.75rem;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="time"],
    select,
    .form-control {
        height: 34px;
        font-size: 0.85rem;
        padding: 0.35rem 0.5rem;
    }
}

.inset-link {
    color: #4ea5f2;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.inset-link:hover {
    color: #3a7bb9;
}  */

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* ========== Medium screens (≤1365px) ========== */
@media (max-width: 1365px) {
    /* Form Inputs - All types */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="time"],
    select,
    .form-control {
        height: 34px;
        padding: 0.4rem 0.6rem;
        font-size: 0.65rem;
        border-radius: 3px;
    }
    
    /* Form Labels */
    label {
        font-size: 0.65rem;
        margin-bottom: 0.3rem;
    }
    
    /* Form Rows */
    .form-row,
    .form-row-background {
        gap: 1.2rem;
        margin-bottom: 0.6rem;
        padding: 0.8rem;
    }
    
    /* Form Columns */
    .column-forms {
        gap: 0.3rem;
    }
    
    /* Error Messages */
    .error-message {
        font-size: 0.65rem;
        margin-top: 0.2rem;
    }
    
    /* Form Groups */
    .form-group {
        margin-bottom: 0.8rem;
    }
    
    /* Form Labels */
    .form-label {
        font-size: 0.65rem;
        margin-bottom: 0.3rem;
    }
    
    /* Input Groups */
    .input-group-text {
        height: 34px;
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
    
    /* Form Select */
    .form-select {
        height: 34px;
        padding: 0.3rem 1.5rem 0.3rem 0.6rem;
        font-size: 0.75rem;
        background-size: 14px 10px;
    }
    
    /* Form Control Sizes */
    .form-control-sm {
        height: 28px;
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
    }
    
    .form-control-lg {
        height: 42px;
        padding: 0.4rem 0.8rem;
        font-size: 1.1rem;
    }
    
    /* Form Check */
    .form-check {
        padding-left: 1.1rem;
    }
    
    .form-check-label {
        font-size: 0.7rem;
    }
    
    /* Section Background */
    .section-background {
        padding: 1.2rem 2.5%;
        margin-bottom: 1.2rem;
    }
    
    /* Container Campaign */
    .container-campaign h5 {
        margin-bottom: 1.2rem;
        font-size: 1.1rem;
    }
    
    /* Button Gaps */
    .btn-gap {
        margin-top: 1.2rem;
        gap: 0.8rem;
    }
    
    /* Form Row Background */
    .form-row-bkg-accprofile {
        gap: 1.2rem;
        margin-bottom: 0.6rem;
        padding: 0.8rem;
    }
}