/* TB Acumatica Volunteers — Frontend Form Styles */

#tbav-form-wrap {
    max-width: 740px;
    margin: 0 auto;
    font-family: inherit;
    line-height: 1.6;
}

.tbav-step h3 {
    font-size: 1.4em;
    margin-bottom: 10px;
    color: #1a1a2e;
}

/* ── Step 1: Identifier ───────────────────────────────────────────────────── */

.tbav-hint {
    background: #f0f4ff;
    border-left: 3px solid #2271b1;
    padding: 7px 12px;
    border-radius: 0 4px 4px 0;
    font-size: 0.9em;
    color: #444;
    margin-bottom: 18px;
}

.tbav-hint code {
    font-size: 0.97em;
    background: none;
    padding: 0;
}

.tbav-field {
    margin-bottom: 18px;
}

.tbav-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.95em;
    color: #333;
}

.tbav-field input[type="text"] {
    width: 100%;
    max-width: 400px;
    padding: 10px 14px;
    border: 2px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.tbav-field input[type="text"]:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 3px rgba(34,113,177,0.12);
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.tbav-btn {
    display: inline-block;
    padding: 11px 26px;
    border-radius: 5px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.18s, opacity 0.18s;
    text-decoration: none;
}

.tbav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tbav-btn-primary {
    background: #2271b1;
    color: #fff;
}

.tbav-btn-primary:hover:not(:disabled) {
    background: #135e96;
}

.tbav-btn-secondary {
    background: #e5e7eb;
    color: #333;
}

.tbav-btn-secondary:hover:not(:disabled) {
    background: #d1d5db;
}

.tbav-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 22px;
    align-items: center;
}

/* ── Feedback ─────────────────────────────────────────────────────────────── */

.tbav-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
    padding: 10px 14px;
    border-radius: 5px;
    margin-bottom: 14px;
    font-size: 0.93em;
}

.tbav-spinner {
    color: #666;
    font-style: italic;
    font-size: 0.9em;
    margin-top: 10px;
}

.tbav-success-box {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.tbav-success-box p {
    margin: 0 0 8px;
}

.tbav-success-box ul {
    margin: 0;
    padding-left: 20px;
}

/* ── Step 2: Task list ────────────────────────────────────────────────────── */

.tbav-greeting {
    font-size: 1.05em;
    font-weight: 600;
    color: #2271b1;
    margin: 0 0 16px;
}

.tbav-no-tasks {
    color: #888;
    font-style: italic;
}

.tbav-time-window {
    margin-bottom: 40px;
}

.tbav-time-window-title {
    font-size: 1.15em;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #2271b1;
}

.tbav-task-group {
    margin-bottom: 28px;
}

.tbav-group-title {
    font-size: 0.82em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #555;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #e5e7eb;
}

.tbav-task-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 8px;
    transition: border-color 0.18s, background 0.18s;
    cursor: pointer;
}

.tbav-task-item.tbav-task-item-static {
    cursor: default;
}

.tbav-debug-print-order {
    position: absolute;
    top: -8px;
    left: -8px;
    background: #f59e0b;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
    z-index: 1;
}

.tbav-task-item:hover {
    border-color: #93c5fd;
}

.tbav-task-item.tbav-is-assigned {
    border-color: #16a34a;
    background: #f0fdf4;
}

.tbav-task-item.tbav-is-full {
    opacity: 0.6;
    background: #f9fafb;
    cursor: default;
}

.tbav-task-item.tbav-conflict {
    border-color: #ef4444 !important;
    background: #fef2f2;
}

.tbav-task-item input[type="checkbox"] {
    margin-top: 2px;
    width: 17px;
    height: 17px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #2271b1;
}

.tbav-task-item.tbav-is-full input[type="checkbox"] {
    cursor: not-allowed;
}

.tbav-task-label {
    flex: 1;
    cursor: pointer;
}

.tbav-task-item.tbav-is-full .tbav-task-label {
    cursor: default;
}

.tbav-task-desc {
    font-weight: 500;
    color: #1a1a2e;
    font-size: 0.97em;
    margin-bottom: 5px;
}

.tbav-task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.tbav-badge {
    font-size: 0.78em;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
    font-weight: 500;
}

.tbav-badge-slots {
    background: #dbeafe;
    color: #1e40af;
}

.tbav-badge-full {
    background: #fee2e2;
    color: #b91c1c;
}

.tbav-badge-assigned {
    background: #dcfce7;
    color: #166534;
}

.tbav-badge-duty {
    background: #f3f4f6;
    color: #555;
}

.tbav-conflict-note {
    font-size: 0.8em;
    color: #b91c1c;
    font-style: italic;
    margin-top: 4px;
}

/* ── More info button + modal ─────────────────────────────────────────────── */

.tbav-info-btn {
    font-size: 0.78em;
    font-weight: 600;
    color: #2271b1;
    background: #eef4fb;
    border: none;
    border-radius: 20px;
    padding: 3px 10px;
    cursor: pointer;
    text-decoration: none;
}

.tbav-info-btn:hover {
    background: #dbeafe;
    color: #135e96;
}

.tbav-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tbav-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(17, 24, 39, 0.55);
}

.tbav-modal-box {
    position: relative;
    background: #fff;
    border-radius: 8px;
    max-width: 560px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 26px 28px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}

.tbav-modal-box h3 {
    margin: 0 24px 14px 0;
    font-size: 1.2em;
    color: #1a1a2e;
}

.tbav-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 1.6em;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 4px;
}

.tbav-modal-close:hover {
    color: #1a1a2e;
}

.tbav-modal-body {
    font-size: 0.95em;
    color: #333;
    line-height: 1.6;
}

.tbav-modal-body p:first-child {
    margin-top: 0;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
    .tbav-field input[type="text"] {
        max-width: 100%;
    }

    .tbav-task-item {
        padding: 10px 12px;
    }

    .tbav-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .tbav-btn {
        text-align: center;
    }
}
