/* ═══════════════════════════════════════════════════════════
   forms.css — Buttons, Form controls, Checkboxes, Radios
   ═══════════════════════════════════════════════════════════ */

/* ========== Prompt dialog (prompt-modal.js) ========== */
.ibb-prompt-dialog {
    border: 1px solid var(--border, #dce8dc);
    border-radius: 8px;
    padding: 1.5rem;
    min-width: 320px;
    max-width: 480px;
    box-shadow: 0 8px 28px rgba(26, 61, 28, 0.15);
}
.ibb-prompt-dialog .prompt-label {
    margin: 0 0 0.5rem;
    font-weight: 500;
}
.ibb-prompt-dialog .prompt-input {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border, #dce8dc);
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
    margin-bottom: 1rem;
    box-sizing: border-box;
}
.ibb-prompt-dialog .prompt-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* ========== Buttons ========== */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border, #dce8dc);
    border-radius: 5px;
    background: white;
    color: var(--text, #212322);
    cursor: pointer;
    font-size: 0.9rem;
    font-family: 'Lato', inherit;
    font-weight: 400;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}

.btn:hover {
    background: var(--brand-muted, #edf7ee);
    border-color: #b8d9ba;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-primary {
    background: var(--brand, #45a349);
    color: white;
    border-color: var(--brand, #45a349);
}

.btn-primary:hover {
    background: var(--brand-dark, #367f39);
    border-color: var(--brand-dark, #367f39);
    color: white;
}

.btn-success {
    background: #16a34a;
    color: white;
    border-color: #16a34a;
}

.btn-success:hover {
    background: #15803d;
    color: white;
}

.btn-danger {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}

.btn-danger:hover {
    background: #b91c1c;
    color: white;
}

.btn-warning {
    background: #ea580c;
    color: white;
    border-color: #ea580c;
}

.btn-warning:hover {
    background: #c2410c;
    color: white;
}

.btn-warning:disabled {
    background: #fed7aa;
    border-color: #fed7aa;
    color: #9a3412;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: #6b7280;
    color: white;
    border-color: #6b7280;
}
.btn-secondary:hover {
    background: #4b5563;
    color: white;
}

.btn-sm {
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
}

/* ========== Forms ========== */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 700;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border, #dce8dc);
    border-radius: 5px;
    font-size: 0.95rem;
    font-family: 'Lato', inherit;
    color: var(--text, #212322);
    background: white;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--brand, #45a349);
    box-shadow: 0 0 0 3px rgba(69, 163, 73, 0.18);
}

/* Select inputs match text inputs */
select.form-control {
    appearance: auto;
    cursor: pointer;
}

/* Form rows for inline field groups */
.form-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.form-row .form-group {
    flex: 1;
    min-width: 180px;
}

/* ========== Custom Checkboxes & Radios ========== */
input[type="checkbox"],
input[type="radio"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 2px solid #9ca3af;
    background: #fff;
    cursor: pointer;
    vertical-align: middle;
    position: relative;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

input[type="checkbox"] {
    border-radius: 4px;
}

input[type="radio"] {
    border-radius: 50%;
}

input[type="checkbox"]:hover,
input[type="radio"]:hover {
    border-color: var(--brand, #45a349);
}

input[type="checkbox"]:checked {
    background: var(--brand, #45a349);
    border-color: var(--brand, #45a349);
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

input[type="radio"]:checked {
    border-color: var(--brand, #45a349);
    background: #fff;
}

input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand, #45a349);
}

input[type="checkbox"]:focus,
input[type="radio"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(69, 163, 73, 0.18);
}

/* Remove-column checkboxes: red when checked */
.remove-checkbox:checked {
    background: #dc2626;
    border-color: #dc2626;
}

.remove-checkbox:hover {
    border-color: #dc2626;
}

/* Checkbox labels */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--brand, #45a349);
}

/* ========== User-selector search widget (user-select-search.js) ========== */
.usr-search-wrapper {
    position: relative;
}
.usr-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 4px 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    z-index: 200;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.usr-search-option {
    padding: 6px 10px;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.usr-search-option:hover,
.usr-search-option.active {
    background: #f0fdf4;
}
.usr-search-option.selected {
    font-weight: 600;
    color: var(--brand, #45a349);
}
