/* --- Floating Trigger Button --- */
#spbe-survey-trigger-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 99998;
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#spbe-survey-trigger-btn:hover {
    background-color: #1d4ed8;
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.spbe-btn-icon {
    font-size: 1.2rem;
}

/* --- Modal Overlay & Container --- */
#spbe-survey-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#spbe-survey-modal-overlay.spbe-modal-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.spbe-modal-container {
    position: relative;
    background: #ffffff;
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 1.5rem;
}

@media (min-width: 768px) {
    .spbe-modal-container {
        padding: 2rem;
    }
}

#spbe-modal-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: #f1f5f9;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #64748b;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#spbe-modal-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* --- Form Inside Modal --- */
.spbe-survey-wrapper * {
    box-sizing: border-box;
}

#form-survey {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    position: relative;
    width: 100%;
}

#form-survey > *:not(.form-actions) {
    width: 100%;
    text-align: center;
}

/* Form Actions Diposisikan di Paling Bawah (Bottom) secara Vertikal Rapi */
.form-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    width: 100%;
    border-top: 1px solid #e2e8f0;
    order: 999;
}

.form-actions cap-widget {
    display: flex;
    justify-content: center;
    width: 100%;
}

.form-actions input[type="submit"] {
    width: 100%;
    max-width: 300px;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    background-color: #2563eb;
    color: #ffffff;
    transition: all 0.2s ease;
}

.form-actions input[type="submit"]:hover:not(:disabled) {
    background-color: #1d4ed8;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

#form-survey input[type="submit"]:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.7;
}

.survey-info {
    width: 100%;
    padding: 1.25rem;
    border-radius: 8px;
    background-color: #f8fafc;
    border-left: 4px solid #2563eb;
    text-align: left !important;
}

.survey-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #1e293b;
    line-height: 1.3;
    font-weight: 700;
}

.survey-description {
    font-size: 0.9rem;
    color: #475569;
    margin: 0;
    line-height: 1.4;
}

.star {
    font-size: 2.75rem;
    transition: color 0.2s ease, transform 0.2s ease;
    color: #cbd5e1;
    display: inline-block;
    cursor: pointer;
}

.star.active {
    color: #eab308;
    transform: scale(1.08);
}

.aspek-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.aspek-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem 0.875rem;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.aspek-checkbox {
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
    accent-color: #2563eb;
}

.aspek-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
}

.aspek-wrapper:has(.aspek-checkbox:checked) {
    background-color: #eff6ff;
    border-color: #2563eb;
    color: #1e40af;
}

.question-block {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
    text-align: left !important;
}

.question-block label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
}

.question-block textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
}

.char-counter {
    text-align: right;
    font-size: 0.75rem;
    color: #64748b;
}

.rating-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.rating-container p {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.star-wrapper {
    position: relative;
    display: inline-flex;
    gap: 0.35rem;
}

.star-wrapper input[type="range"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}
