/* Hide Google reCAPTCHA v3 badge — branding shown inline next to submit buttons */
.grecaptcha-badge {
    visibility: hidden !important;
}

/* Match the legacy .form-control look (padding 11px 15px, content-driven height) */
.select2-container--default .select2-selection--multiple,
.select2-container .select2-selection--multiple {
    min-height: 48px !important;
    height: auto !important;
    border: 1px solid #ced4da !important;
    border-radius: 4px !important;
    padding: 11px 28px 11px 15px !important;
    box-sizing: border-box !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered,
.select2-container .select2-selection--multiple .select2-selection__rendered {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    align-content: flex-start !important;
    max-height: none !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1.2 !important;
}

.select2-container--default .select2-search--inline,
.select2-container .select2-search--inline {
    float: none !important;
    flex: 0 0 auto !important;
}

.select2-container--default .select2-search--inline .select2-search__field,
textarea.select2-search__field {
    margin-top: 0 !important;
    margin-left: 0 !important;
    height: 22px !important;
    min-height: 22px !important;
    max-height: 22px !important;
    overflow: hidden !important;
    resize: none !important;
    box-sizing: border-box !important;
    font-family: inherit !important;
    font-size: 1rem !important;
    color: #495057;
}

textarea.select2-search__field::placeholder {
    color: #99b1cc !important;
    opacity: 1 !important;
    font-family: inherit !important;
    font-size: 1rem !important;
}

textarea.select2-search__field::-webkit-input-placeholder {
    color: #99b1cc !important;
}

.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default .select2-selection--multiple:focus {
    border-color: #80bdff !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice,
.select2-container .select2-selection--multiple .select2-selection__choice {
    background-color: #e9f3fb !important;
    border-color: #b8daf3 !important;
    color: #0a6fc2 !important;
    padding: 5px !important;
    margin: 2px 4px 2px 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    float: none !important;
    line-height: 1.2 !important;
    box-sizing: border-box !important;
    border-radius: 3px !important;
    border-width: 1px !important;
    border-style: solid !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove,
.select2-container .select2-selection--multiple .select2-selection__choice__remove {
    color: #0a6fc2 !important;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    font-size: 1.1em !important;
    cursor: pointer !important;
    position: static !important;
    top: auto !important;
    left: auto !important;
    transform: translateY(-2px);
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #064a82;
    background: transparent;
}

.drop-zone {
    position: relative;
    border: 2px dashed #ced4da;
    border-radius: 6px;
    padding: 24px;
    text-align: center;
    background: #fafafa;
    cursor: pointer;
    transition: border-color 120ms, background 120ms;
}

.drop-zone.drop-zone-hover {
    border-color: #0a6fc2;
    background: #eff6fc;
}

.drop-zone-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.drop-zone-text {
    margin: 0;
    color: #6c757d;
    pointer-events: none;
}

.drop-zone-files {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    text-align: left;
    font-size: 0.9rem;
    color: #333;
}

.drop-zone-files li {
    padding: 2px 0;
    word-break: break-all;
}

.drop-zone-files li .size {
    color: #6c757d;
    margin-left: 6px;
}

/* Pill button — sits in the bottom-right corner, rounded only on top */
.floating-help-btn {
    position: fixed;
    bottom: 0;
    right: 0;
    padding: 12px 22px 12px 18px;
    border: none;
    border-top-left-radius: 24px;
    border-top-right-radius: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    background: linear-gradient(95deg, #0a6fc2 0%, #064a82 100%);
    color: #fff;
    box-shadow: -6px -6px 18px rgba(0, 0, 0, 0.22);
    z-index: 1041;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1;
    transition: transform 150ms ease, box-shadow 150ms ease, opacity 200ms ease;
}

.floating-help-btn:hover {
    transform: translateY(-2px);
    box-shadow: -8px -8px 22px rgba(0, 0, 0, 0.26);
}

.floating-help-btn:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(10, 111, 194, 0.3), 0 6px 18px rgba(0, 0, 0, 0.28);
}

.floating-help-btn svg { display: block; }

.floating-help-btn.open {
    opacity: 0;
    pointer-events: none;
}

/* Slide-up panel — sits in the bottom-right corner, rounded only on top-left.
   Closed state: collapsed to the pill button width, below the bottom edge.
   Open state: full width, in place. Both axes animate together. */
.help-panel {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 320px;
    max-width: calc(100vw - 50px);
    max-height: calc(100vh - 50px);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    box-shadow: -10px -10px 40px rgba(0, 0, 0, 0.22);
    border-top-left-radius: 12px;
    border-top-right-radius: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    transform: translateY(calc(100% + 20px));
    pointer-events: none;
    transition: transform 340ms cubic-bezier(0.22, 1, 0.36, 1),
                width 340ms cubic-bezier(0.22, 1, 0.36, 1);
}

.help-panel.open {
    width: 400px;
    transform: translateY(0);
    pointer-events: auto;
}

.help-panel-header {
    background: linear-gradient(95deg, #0a6fc2 0%, #064a82 100%);
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    border-top-left-radius: 12px;
    border-top-right-radius: 0;
}

.help-panel-header .title {
    margin: 0;
    padding: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
}

.help-panel-header svg { display: block; }

/* × button — sits OUTSIDE the panel, top-left, slides with the panel */
.help-panel-close {
    position: absolute;
    top: 4px;
    left: -38px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    color: #333;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 150ms ease;
}

.help-panel-close:hover { transform: scale(1.08); }

.help-panel-body {
    padding: 16px;
    overflow-y: auto;
    background: #fff;
    flex: 1 1 auto;
    border-bottom-left-radius: 0;
}

@media (max-width: 480px) {
    .floating-help-btn { padding: 10px 18px 10px 14px; font-size: 0.9rem; }
    .help-panel {
        right: 0;
        bottom: 0;
        width: calc(100vw - 80px);
        max-height: calc(100vh - 50px);
    }
    .help-panel.open { width: calc(100vw - 50px); }
    .help-panel-close { left: -36px; }
}

/* Validation error state for the Products multiselect — mirror the red border + (!)
   icon that .input-validation-error gives the native .form-control fields, but apply
   it to the visible select2 widget (select2 hides the underlying <select>). */
.products-select.input-validation-error + .select2-container .select2-selection--multiple {
    border-color: #dc3545 !important;
    padding-right: 32px !important;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3E%3Ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right calc(.375em + .1875rem) center;
    background-size: calc(.75em + .375rem) calc(.75em + .375rem);
}

.products-select.input-validation-error + .select2-container--default.select2-container--focus .select2-selection--multiple {
    box-shadow: 0 0 0 .2rem rgba(220, 53, 69, .25) !important;
}

/* Validation error state for the Attachments drop-zone */
.drop-zone.drop-zone-error {
    border-color: #dc3545;
}
