/* ============================================================
   JIMPITAN — Global Form Styles
   Applies to all .form-control, .form-select, .form-check
   ============================================================ */

/* ── Floating-label wrapper (for pages that use it) ── */
.form-floating-custom {
    position: relative;
    margin-bottom: 1.25rem;
}

/* ── Base input & select ── */
.form-control,
.form-select {
    height: 48px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    color: #1a202c;
    background-color: #fafbfc;
    transition:
        border-color 0.22s ease,
        box-shadow   0.22s ease,
        background   0.22s ease,
        transform    0.15s ease;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

/* Textarea keeps auto height */
textarea.form-control {
    height: auto;
    min-height: 90px;
    resize: vertical;
    line-height: 1.6;
    padding: 0.75rem 1rem;
}

/* ── Focus state ── */
.form-control:focus,
.form-select:focus {
    border-color: #2e7d32;
    background-color: #fff;
    box-shadow: 0 0 0 3.5px rgba(46, 125, 50, 0.13);
    transform: translateY(-1px);
    color: #1a202c;
}

/* ── Hover state (not focused) ── */
.form-control:not(:focus):hover,
.form-select:not(:focus):hover {
    border-color: #a5d6a7;
    background-color: #fff;
}

/* ── Placeholder ── */
.form-control::placeholder {
    color: #a0aec0;
    font-size: 0.875rem;
}

/* ── Valid ── */
.form-control.is-valid,
.form-select.is-valid {
    border-color: #2e7d32;
    background-image: none;
    padding-right: 1rem;
}
.form-control.is-valid:focus,
.form-select.is-valid:focus {
    box-shadow: 0 0 0 3.5px rgba(46, 125, 50, 0.15);
}

/* ── Invalid ── */
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #e53e3e;
    background-image: none;
    padding-right: 1rem;
}
.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3.5px rgba(229, 62, 62, 0.13);
}
.invalid-feedback {
    font-size: 0.78rem;
    margin-top: 5px;
    color: #e53e3e;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── Select arrow ── */
.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232e7d32' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 16px;
    padding-right: 2.5rem;
    cursor: pointer;
}

/* ── Form label ── */
.form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 6px;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.form-label .label-icon {
    color: #2e7d32;
    font-size: 0.9rem;
}

/* ── Form text / hint ── */
.form-text {
    font-size: 0.76rem;
    color: #718096;
    margin-top: 4px;
}

/* ── Input group ── */
.input-group .form-control,
.input-group .form-select {
    border-radius: 0;
}
.input-group > :first-child {
    border-radius: 10px 0 0 10px !important;
}
.input-group > :last-child {
    border-radius: 0 10px 10px 0 !important;
}
.input-group-text {
    background: #f1f8e9;
    border: 1.5px solid #e2e8f0;
    color: #2e7d32;
    font-size: 0.9rem;
    transition: border-color 0.22s ease;
}
.input-group:focus-within .input-group-text {
    border-color: #2e7d32;
    background: #e8f5e9;
}

/* ── Checkbox & Radio ── */
.form-check-input {
    width: 1.1em;
    height: 1.1em;
    border: 1.5px solid #cbd5e0;
    border-radius: 5px;
    background-color: #fafbfc;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.18em;
}
.form-check-input:hover {
    border-color: #4caf50;
}
.form-check-input:checked {
    background-color: #2e7d32;
    border-color: #2e7d32;
    box-shadow: 0 2px 6px rgba(46, 125, 50, 0.3);
}
.form-check-input:focus {
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
}
.form-check-input[type="radio"] {
    border-radius: 50%;
}
.form-check-label {
    font-size: 0.875rem;
    color: #4a5568;
    cursor: pointer;
    padding-left: 3px;
}

/* ── File input ── */
.form-control[type="file"] {
    padding: 0.6rem 0.75rem;
    cursor: pointer;
}
.form-control[type="file"]::file-selector-button {
    background: linear-gradient(135deg, #2e7d32, #43a047);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.3rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.form-control[type="file"]::file-selector-button:hover {
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
}

/* ── Date/time input ── */
input[type="date"],
input[type="datetime-local"],
input[type="time"] {
    cursor: pointer;
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    opacity: 0.6;
    cursor: pointer;
    filter: invert(27%) sepia(78%) saturate(500%) hue-rotate(88deg);
    transition: opacity 0.2s;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* ── Number input ── */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 0.5;
    cursor: pointer;
}

/* ── Small form sizes ── */
.form-control-sm,
.form-select-sm {
    height: 38px;
    font-size: 0.82rem;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
}
textarea.form-control-sm {
    height: auto;
}

/* ── Form card wrapper (common pattern) ── */
.form-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
    padding: 2rem;
}
.form-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #a0aec0;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f0f4f0;
}

/* ── Submit button ── */
.btn-submit {
    height: 48px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.2px;
    background: linear-gradient(135deg, #2e7d32, #43a047);
    border: none;
    color: #fff;
    transition: all 0.25s ease;
    box-shadow: 0 3px 12px rgba(46, 125, 50, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.4);
    color: #fff;
}
.btn-submit:active {
    transform: translateY(0);
}

/* ── Animated focus ring on form-group ── */
.form-group-animated {
    position: relative;
}
.form-group-animated::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    right: 50%;
    height: 2px;
    background: #2e7d32;
    border-radius: 0 0 10px 10px;
    transition: left 0.3s ease, right 0.3s ease;
    pointer-events: none;
}
.form-group-animated:focus-within::after {
    left: 0;
    right: 0;
}

/* ── Search input ── */
.search-input-wrap {
    position: relative;
}
.search-input-wrap .search-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 0.95rem;
    pointer-events: none;
    transition: color 0.2s;
}
.search-input-wrap:focus-within .search-icon {
    color: #2e7d32;
}
.search-input-wrap .form-control {
    padding-left: 2.4rem;
}

/* ── Filter bar (admin tables) ── */
.filter-bar {
    background: #fff;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 1.25rem;
    border: 1px solid #f0f0f0;
}